简体   繁体   English

使用 android:sharedUserId="android.uid.system" 属性获取 SystemProperties.java 类

[英]Getting SystemProperties.java class using android:sharedUserId="android.uid.system" attributes

I know that the SystemProperties class won't be exported as part of the public SDK because of the @hide annotation.我知道SystemProperties类不会因为@hide注释而作为公共 SDK 的一部分导出。

What I've done:我所做的:

  1. Added the android:sharedUserId="android.uid.system" attributes on the AndroidManifest.xml fileAndroidManifest.xml文件中添加了android:sharedUserId="android.uid.system"属性

    显现

  2. The application is signed with platform key应用程序使用平台密钥签名

    .mk 文件

and still get a compiling error...并且仍然出现编译错误...

note : I've already checked out the where is os systemproperties question .注意:我已经检查了os systemproperties问题哪里

But this solution doesn't work for me.但是这个解决方案对我不起作用。

I've just added the below line on my Android.mk file, and it works我刚刚在我的 Android.mk 文件中添加了以下行,它可以工作

# Can only use LOCAL_PRIVATE_PLATFORM_APIS on Android 9+
ifneq (0, $(shell expr $(PLATFORM_VERSION) \>= 9))
LOCAL_PRIVATE_PLATFORM_APIS := true
endif

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

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