How javierjuanjj/voiceencryption works
Project type and purpose
• From the file tree and build files, this is an Android mobile application named “VoiceEncryption.”
• Its purpose is to capture or load audio (e.g., the provided mirage.mp3 asset), run an encryption/decryption algorithm on voice data, and play back or store the result.
File structure
• Top-level Gradle configuration:
• settings.gradle.kts, build.gradle.kts, gradle.properties, the Gradle wrapper under gradle/wrapper and gradlew(±).
• Single Android module “app”:
• app/src/main/java/com/example/voiceencryption → MainActivity.java (UI entry point), Utity.java (business-logic/encryption utility).
• app/src/main/assets → mirage.mp3 (sample audio).
• Test directories under app/src/test and app/src/androidTest.
• ProGuard rules under app/proguard-rules.pro.
README
• The README contains only the title “# VoiceEncryption” with no architectural notes. We infer architecture solely from the project layout.
a. Main components
1) User device (Android smartphone).
2) Presentation layer: MainActivity + Layout XMLs (UI).
3) Business logic layer: Utity.java (encryption/decryption algorithms).
4) Android framework services: MediaRecorder (or AudioRecord), MediaPlayer, File I/O APIs.
5) Data layer:
– Assets folder (embedded audio).
– Local storage (external/internal file storage for encrypted files).
6) Build/deployment: Gradle plugin, ProGuard/R8, AndroidManifest.
b. Relationships and interactions
– User taps UI in MainActivity → UI event invokes Utity.encrypt() or Utity.decrypt().
– If recording: MainActivity uses MediaRecorder/AudioRecord → raw PCM → Utity.encrypt() → writes encrypted blob via FileOutputStream.
– If loading asset: MainActivity reads mirage.mp3 from assets → Utity.encrypt() → stores output.
– Playback: MainActivity or Utity hands encrypted data to Utity.decrypt() → decrypted PCM/MP3 → MediaPlayer plays it.
– Gradle builds Java code, packages resources/assets, runs ProGuard → produces final APK installed on device.
c. Architectural patterns and principles
– Layered architecture (Presentation → Domain → Data).
– Single-Activity pattern (if only MainActivity).
– Encapsulation of encryption logic in a utility class.
– Separation of concerns: UI code does not contain algorithm details.
d. Key technologies/frameworks
– Android SDK (MediaRecorder, MediaPlayer, AssetManager, File APIs).
– Kotlin-DSL Gradle build (build.gradle.kts).
– ProGuard/R8 for code shrinking.
– JUnit and AndroidX Test for unit and instrumentation tests.