简体   繁体   English

使用AOSP构建APK

[英]Building APK with AOSP

Using AOSP we can build own Android with some features. 使用AOSP,我们可以构建具有某些功能的自己的Android。

I have setup environment using google documentation and another web sites, and in tutorials says - 我有使用Google文档和其他网站的安装环境,并且在教程中说-

make adb fastboot. 使adb fastboot。 Update yours android OS with yours customization. 使用您的自定义更新您的Android操作系统。

But i just need use @SystemApi classes for build one app, what i should to do? 但是我只需要使用@SystemApi类来构建一个应用程序,我该怎么办?

I searched in web for one month, but still didn't find. 我在网上搜索了一个月,但仍然没有找到。

Methods marked as @hide or @SystemAPI are not part of the official SDK, and are not intended to be used generally. 标记为@hide@SystemAPI的方法不是官方SDK的一部分,因此一般不打算使用。

Yet, until lately you could access all of them either by Reflection , or by using a custom android.jar that has those methods too. 但是,直到最近,您都可以通过Reflection或使用也具有这些方法的自定义android.jar来访问所有它们。 See this project for the list of android.jar: https://github.com/anggrayudi/android-hidden-api 有关android.jar的列表,请参见此项目: https : //github.com/anggrayudi/android-hidden-api

If your Android version is below P, that's all you need to do. 如果您的Android版本低于P,那么您只需要做。 Otherwise keep reading: 否则请继续阅读:

In Android P, Google removed access to non-SDK interfaces , so you cannot use those methods as above. 在Android P中, Google删除了对非SDK接口的访问权限 ,因此您不能使用上述方法。 In this case you'd have to remove the @SystemApi and @hide annotations from the classes and methods you need, compile and flash the update to the device. 在这种情况下,您必须从所需的类和方法中删除@SystemApi和@hide批注,编译并将更新内容刷新到设备中。 Then you can use the above methods 那你可以用上面的方法

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM