6

Starting Android 11 the Reflection based non-sdk(Private) api calls are blocked. Android system checks the caller of the reflection method and if its non-system app it rejects with error as blocklist/blacklist. 

"Accessing hidden method Lcom/example/com;->getSomeMethod()Lcom/example/com; (blacklist, reflection, denied)"

More details in links below.

https://developer.android.com/guide/app-compatibility/restrictions-non-sdk-interfaces#results-of-keeping-non-sdk

https://www.xda-developers.com/android-11-harden-hidden-api-restriction-meta-reflection/

https://androidreverse.wordpress.com/2020/05/02/android-api-restriction-bypass-for-all-android-versions/

one way to bypass is as below. https://github.com/ChickenHook/RestrictionBypass

Queries:

"The hidden API blacklist only applies to non-whitelisted user applications. System applications, applications signed with the platform signature, and applications specified in a configuration file are all exempt from the blacklist"

1)All Above quote still hold good for Android 11? what are the ways OEMs can whitelist a app to use Reflection like before?

2)Is the manufacturer-supplied libraries apis treated as non-sdk apis?

  1. How is the Reflection worked in android 10(Target 29) for the same manufacturer-supplied libraries even when META REFLECTION not used?

https://www.xda-developers.com/android-development-bypass-hidden-api-restrictions/

Thanks

NitZRobotKoder
  • 1,046
  • 8
  • 44
  • 74

1 Answers1

0

Old question, but I've run into this issue recently, and apparently the reflection restrictions can be bypassed easily, using a method called "double reflection", outlined here.

Dmitry Brant
  • 7,612
  • 2
  • 29
  • 47