授予 Android 应用程序 (.apk) 文件根访问权限
Give Android applciation (.apk) file root access
我开发的应用程序在其中执行需要 root 权限的命令。
我也使用了 java 进程来执行命令,但它也不起作用。
为此,我使用 c api 使用 JNI ( NDK ),但它也没有 root 访问权限。因为它与应用程序具有相同的权限。
我的设备作为 root 访问权限,这就是它在 adb shell 中执行命令的原因。但不是
来自申请。
有什么办法可以给应用程序 root 权限吗?
请给出解决方案...
谈到 root 访问权限,您必须在清单文件中提供权限 link,然后在您的 root phone 中安装应用程序后,su 应用程序将请求 root 访问权限
用于授予应用程序系统权限。
您需要使用平台签名对应用程序进行签名。您需要使用位于 <root-of-android-source-tree>/build/target/product/security/
中的键并在 AndroidManifest.xml 文件中添加 android:sharedUserId="android.uid.system"
。
步骤:
sign application with the platform certificate
and run it with the system sharedUserId. These are the steps:
- Build and flash to your Dream your own Android using http://source.android.com/documentation/building-for-dream. Use the
mkkey.sh script on
http://pdk.android.com/online-pdk/guide/release_keys.html to create
new certificates, including x509 certificates before you do 'make'.
- In the
AndroidManifest.xml
of your application: under the <manifest>
element, add the attribute android:sharedUserId="android.uid.system"
.
- Export an unsigned version of your Android application using Eclipse: right-click on the project >> Android Tools >> Export
Unsigned Application Package.
Use <root-of-android-source-tree>/out/host/<your-host>/framework/signapk.jar
to sign your app using platform.x509.pem
and platform.pk8
in <root-of-android-source-tree>/build/target/product/security
generated earlier:
java -jar signapk.jar platform.x509.pem platform.pk8 YourApp-unsigned.apk YourApp-signed.apk.
Install the app to your device:
adb install YourApp-signed.apk
- Run your app
- Use
adb shell ps
to confirm that your app is running as system.
我开发的应用程序在其中执行需要 root 权限的命令。
我也使用了 java 进程来执行命令,但它也不起作用。
为此,我使用 c api 使用 JNI ( NDK ),但它也没有 root 访问权限。因为它与应用程序具有相同的权限。
我的设备作为 root 访问权限,这就是它在 adb shell 中执行命令的原因。但不是 来自申请。
有什么办法可以给应用程序 root 权限吗?
请给出解决方案...
谈到 root 访问权限,您必须在清单文件中提供权限 link,然后在您的 root phone 中安装应用程序后,su 应用程序将请求 root 访问权限
用于授予应用程序系统权限。
您需要使用平台签名对应用程序进行签名。您需要使用位于 <root-of-android-source-tree>/build/target/product/security/
中的键并在 AndroidManifest.xml 文件中添加 android:sharedUserId="android.uid.system"
。
步骤:
sign application with the platform certificate and run it with the system sharedUserId. These are the steps:
- Build and flash to your Dream your own Android using http://source.android.com/documentation/building-for-dream. Use the mkkey.sh script on http://pdk.android.com/online-pdk/guide/release_keys.html to create new certificates, including x509 certificates before you do 'make'.
- In the
AndroidManifest.xml
of your application: under the<manifest>
element, add the attributeandroid:sharedUserId="android.uid.system"
.- Export an unsigned version of your Android application using Eclipse: right-click on the project >> Android Tools >> Export Unsigned Application Package.
Use
<root-of-android-source-tree>/out/host/<your-host>/framework/signapk.jar
to sign your app usingplatform.x509.pem
andplatform.pk8
in<root-of-android-source-tree>/build/target/product/security
generated earlier:java -jar signapk.jar platform.x509.pem platform.pk8 YourApp-unsigned.apk YourApp-signed.apk.
Install the app to your device:
adb install YourApp-signed.apk
- Run your app
- Use
adb shell ps
to confirm that your app is running as system.