How lsposed/corepatch works
Main Components
• Android Module (CorePatch): Represent the compiled APK containing both the UI elements (e.g., SettingsActivity, layouts, resources) and the core patch logic.
• Xposed Framework Integration: Display that the module hooks into the Android runtime through the Xposed Framework. Include the “xposed_init” file (located in app/src/main/assets) which is crucial for ensuring that Xposed knows to load this module.
• Hook Components: Identify individual hook classes (such as CorePatchForQ, CorePatchForR, etc.) which target specific Android versions. They are essentially the heart of the patch logic.
• Support Components: Highlight helper classes (e.g., XposedHelper.java) and common utilities (like ReturnConstant.java) that assist in performing the hooks.
• Configuration & Resources: Include the Android Manifest (defining the module’s integration), layout XML files (for the settings UI), and other resources (localized strings, preferences).
• Build System & CI: Add elements for build configuration (Gradle build scripts, settings.gradle.kts, gradle properties) and CI workflows (.github/workflows) that automate the Android CI builds.
Relationships & Interactions
• From the Xposed Framework, indicate the loading of the module through the xposed_init file. Then show the initialization of the main hook component (MainHook.java) which in turn directs to specific patch classes based on Android version.
• SettingsActivity as a UI component that interacts with the hook configuration, allowing the user to control or configure behavior.
• Within the hook classes, highlight the internal interaction with system APIs for signature verification and installation procedures.
• Connections to the Gradle/CI pipeline that builds and tests the module.
Architectural Patterns & Design Principles
• Version-Based Separation: Emphasize how the patch logic is separated into different classes for specific Android versions (MVC-like separation within the business logic).
• Modularity & Extensibility: Illustrate how the project is organized in a modular fashion, which makes adding new patches easier and allows for maintainability.
• Clear Separation of Responsibilities: The user interface (settings screen) is clearly separated from the core hook logic that interacts with the system.
• Automated Build/Deployment: Include the role of Gradle scripts and GitHub workflows that automate testing and releases.
Relevant Technologies & Libraries
• Android Framework & Gradle Kotlin DSL: Represent the Android application as built with Gradle Kotlin DSL files.
• Xposed Framework: Make clear the dependency and integration with the Xposed Framework that performs bytecode manipulation at runtime.
• Java as the main programming language (indicated by the .java files inside the project).
• CI/CD: Illustrate the use of GitHub Actions for Android CI as seen in the .github/workflows directory.
Instructing the Principal Software Engineer
• Incorporate annotations detailing dependencies (e.g., usage of specific Android classes, reliance on Xposed APIs) and any important conditional logic based on Android version.