Build custom SDK with AOSP changes

2020-03-31 07:33发布

I am trying to build my app (uses many hidden api and properties) in android studio. I have modified the AOSP code to expose these hidden apis. In order to make the build successful I have added the classes.jar as the external lib to my project. But that doesn't resolve the issue. It was still showing errors :

error: cannot find symbol method getService()   
error: cannot find symbol variable userSetLocale    
error: cannot find symbol method getInstance()  
error: cannot find symbol variable INJECT_INPUT_EVENT_MODE_WAIT_FOR_FINISH  
error: cannot find symbol variable INJECT_INPUT_EVENT_MODE_ASYNC    

Now I am trying to make the custom SDK with this modified AOSP code.

Note : Already tried and failed with the following solutions

Can anyone help to build custom SDK based on the modified AOSP code

2条回答
一夜七次
2楼-- · 2020-03-31 08:03

I solved the issue by changing the orderEntry of sdk in app.iml and giving the absolute path of framework.jar in modules build.gradle

查看更多
▲ chillily
3楼-- · 2020-03-31 08:16

Add the following in you root project's build.gradle. ${rootDir}/libs/framework.jar is the jar build from you aosp code.

subprojects {
gradle.projectsEvaluated {
    tasks.withType(JavaCompile) {
        options.compilerArgs.add("-Xbootclasspath/p:${rootDir}/libs/framework.jar")
    }
 }
}

There are red errors in the editor. But it can be build successful. Demo project:https://github.com/auxor/AppWithModifiedFramework/

查看更多
登录 后发表回答