[February 2023] Android P and above hidden API (non-SDK interface) reflection restriction solution

For relevant restrictions, please refer to: Restrictions for non-SDK interfaces

FreeReflection github

  • Java layer double reflection (Android P)
  • ClassLoader empty (Android P+) ( will be fixed )
  • The native layer obtains the key structure through the offset and then modifies the check Flag (Android P+)

RestrictionBypass github

  • Java layer double reflection (Android P)
  • Native double reflection (hide unknown callers via AttachCurrentThread) (Android Q+) ( will be fixed )

AndroidHiddenApiBypass github

  • Rewrite reflection code with Unsafe (Android P+)

Summarize

At present, I only use FreeReflection, but it has been deprecated due to frequent reports of crashes in the native layer (guess it is caused by the empty ClassLoader scheme, double reflection should only take effect in Android P, and the native layer modification Flag is not used), others are not yet available Use, no evaluation, but in theory, I am more optimistic about AndroidHiddenApiBypass, pure Java, compatibility is definitely the best, because Unsafe involves native layer access, I am afraid it is not easy to seal, restricting access to some memory areas? Or directly restrict access to reflection-related structures? The double reflection of the native layer of RestrictionBypass should also be easily detected and repaired

Guess you like

Origin blog.csdn.net/qq_26914291/article/details/128872307