jeudi 18 février 2021

Android: Access non-sdk(manufacturer-supplied libraries) APIs via reflection in android >=11

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 treated as non-sdk libraries?

  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





Aucun commentaire:

Enregistrer un commentaire