Exposing hidden APIs android L (SDK 21) in Android Studio

后端 未结 5 2071
粉色の甜心
粉色の甜心 2020-12-20 01:04

I have successfully extracted the class files from an android emulator and replaced them into my android.jar file residing inside my \\platforms\\android-21\\android.jar and

5条回答
  •  独厮守ぢ
    2020-12-20 01:47

    You don`t have to replace \platforms\android-21\android.jar.
    It destroy the SDK and you may not submit those changes onto git.

    Below way may be more easier:

    1. See How do I build the Android SDK with hidden and internal APIs available? and get framework_all.jar

    2. Put framework_all.jar in system_libraries besides app in your projects.

    3. change app/build.gradle like

      dependencies { compile fileTree(dir: 'libs', include: ['.jar']) provided fileTree(dir: '../system_libraries', include: ['.jar']) }

    4. AS will gives a tips like "Gradle files have changed since .... Sync Now", click Sync Now.

    5. Goto Project view and you will see platform_all.jar in External Libraries.

    6. Each time you changed any .jar under system_libraries, you need to do some change in app/build.gradle and re-sync it.

提交回复
热议问题