Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for compatibility API 33 (Android 13) #5

Merged
merged 1 commit into from
May 24, 2023

Conversation

ElJaviLuki
Copy link
Contributor

This pull request introduces several changes to the HookMain class in the tw.idv.palatis.xappdebug.xposed package. The purpose of these changes is to improve compatibility and functionality for debugging applications on different Android versions.

  1. Updated PackageManagerService Class:

    • Added a new constant IS_TIRAMISU_OR_LATER to check if the Android version is TIRAMISU or later.
    • Updated the PM_CLASS constant to use the appropriate PackageManagerService class based on the Android version.
    • This change allows the code to work correctly on both pre-TIRAMISU and TIRAMISU+ versions of Android.
  2. Modified Method Hooking:

    • Replaced the getPackageInfo, getApplicationInfo, and getInstalledApplicationsListInternal method hooks with updated versions.
    • For TIRAMISU or later versions, the method signatures include a new parameter long.class for flags.
    • For pre-TIRAMISU versions, the method signatures remain the same.
    • The new hooks ensure compatibility with the different method signatures used by different Android versions.
  3. Refactored Debuggable Check:

    • Created a new private method checkAndMakeDebuggable to handle the debuggable check and flag setting for an ApplicationInfo object.
    • This method is used to consolidate the logic for setting the FLAG_DEBUGGABLE flag on ApplicationInfo objects.
    • It is called after obtaining the PackageInfo or ApplicationInfo object to perform the debuggable check and flag assignment.
  4. Additional Debugging Check:

    • Added a null check for the ApplicationInfo object before performing the debuggable check in the getPackageInfo and getApplicationInfo hooks.
    • This ensures that the code handles cases where the ApplicationInfo object is null correctly, preventing potential crashes.
  5. Compatibility with Multiple Android Versions:

    • The changes ensure compatibility with both pre-TIRAMISU and TIRAMISU+ Android versions.
    • The appropriate method hooks and debuggable checks are used based on the Android version, allowing the code to work correctly on different platforms.
  6. Code Formatting and Documentation:

    • Made minor formatting adjustments to improve code readability.
    • Updated code comments to reflect the changes and provide additional clarity where needed.

These changes enhance the compatibility and functionality of the HookMain class across different Android versions, ensuring proper debuggable flag assignment and improving the overall robustness of the codebase.

@Palatis Palatis merged commit a1927ea into Palatis:master May 24, 2023
@Palatis
Copy link
Owner

Palatis commented May 25, 2023

Added as a note for my self.

android-13.0.0_r49 ComputeEngine.java

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants