How vladimir-ponomarenko/android works
Project Type and Purpose
• This is a full-stack Android application that gathers and analyzes mobile network data (such as signal strength, cell IDs, and traffic usage) and sends the results to a remote server for further study.
Analyzing the File Structure
• There is a well-defined separation between Android-specific Java/Kotlin code (located in app/src/main/java/com/example/login) and native C/C++ code (found in app/src/main/cpp and app/src/main/jni). This indicates the use of JNI for performance-critical or legacy operations such as diagnostics processing.
• The “assets” folder includes several configuration files (diag.cfg, full_diag.cfg, etc.) and directories for dissector tools, suggesting that the native module uses these files to process detailed network data.
• The directory “app/src/main/res” holds XML layouts and resources, confirming that the UI is structured through Android’s UI framework.
• Gradle and build scripts (build.gradle.kts, CMakeLists.txt, etc.) indicate that both Java/Kotlin and C++ code are integrated in the build process.
Key System Components
a. Frontend / User Interface:
• Components: Activities and various UI screens such as MainActivity, DataScreen, MapScreen, LoginScreen, TrafficScreen, UpdateScreen, etc.
• Role: Handle user interaction, displaying real-time network data (e.g., graphs and maps) and managing permission flows.
b. Core Application Logic (Business Logic Layer):
• Components: DataManager (for gathering location and network data), NetworkManager (for server communication, authentication, and data uploads), TrafficManager (for analyzing data usage), and Utils for shared functionality.
• Role: Interface between the UI and the underlying data collection/processing modules.
c. Native / JNI Layer:
• Components: C++ modules (such as diagRevealer.cpp, diagcfgwr.cpp, hdlc.cpp, log_packet.cpp, etc.) that perform low-level processing of network diagnostic logs and dissecting protocols.
• Role: Provide high-performance processing and potentially integration with libraries (e.g., nlohmann::json or Wireshark’s dissectors) to parse and process network diagnostic data.
d. External Services and Data Flow:
• Components: Server endpoint (remote service) where processed data is sent.
• Role: Reception and possibly further analysis of the network data collected from the device.
e. Configuration and Resources:
• Role: Provide static data and configuration parameters used by both the frontend and native layers.
Relationships and Data Flow
• Start at the UI layer where user interactions (e.g., starting data collection, navigating between screens) are performed.
• UI components invoke methods in the core application logic (DataManager, TrafficManager, etc.) to obtain and process network data.
• DataManager may pass data to and from the native layer via JNI calls; native components take care of complex data processing such as protocol dissection.
• Processed data moves back to the Java/Kotlin side to be visualized (maps and graphs) and may be sent to external servers via the NetworkManager.
Highlighting Important Architectural Patterns
• Modular Separation: The clear split between UI, business logic, and native processing should be emphasized using distinct layers or modules.
• JNI Integration: Represent the boundary between Java/Kotlin components and the native C++ modules.
• Client-Server Communication: Indicate how network data is forwarded to a server through the NetworkManager.
• Use of external configuration files and assets: Show their relationship to the native processing modules.