gpt4 book ai didi

android - 如何使用系统签名对 Android 应用进行签名?

转载 作者:IT老高 更新时间:2023-10-28 13:16:01 24 4
gpt4 key购买 nike

我已经为我的 HTC 手机下载并编译了带有 signed-google_ion-ota-14721.zip 图像的 Android 2.1 版本。编译成功完成,系统镜像闪烁。如何使用系统签名为自己的 Android 应用程序签名?

有人可以描述使用系统签名对用户应用程序进行签名的整个过程,因为我对签名过程完全陌生。

最佳答案

最后,我设法找到了一种使用平台签名对我的应用程序进行签名的方法。您需要使用位于 <root-of-android-source-tree>/build/target/product/security/ 中的 key 并添加 android:sharedUserId="android.uid.system"在您的 AndroidManifest.xml 文件中。

来自 this google groups thread 的详细信息:

On top of signing Android 1.6 for Dream with certificates generated by myself, I've also managed to sign my app with the platform certificate and run it with the system sharedUserId. These are the steps I took:

  • Build and flash to your Dream your own Android using https://web.archive.org/web/20081211205758/http://source.android.com:80/documentation/building-for-dream. Use the mkkey.sh script on https://web.archive.org/web/20091213215940/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.

关于android - 如何使用系统签名对 Android 应用进行签名?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3635101/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com