Skip to content

Instantly share code, notes, and snippets.

@CFM880
Last active August 11, 2025 02:01
Show Gist options
  • Save CFM880/b7b58dca976a14d2d9db5956cd490cfa to your computer and use it in GitHub Desktop.
Save CFM880/b7b58dca976a14d2d9db5956cd490cfa to your computer and use it in GitHub Desktop.
AOSP 自定义签名

https://source.android.com/docs/core/ota/sign_builds?hl=zh-cn

生成签名

subject='/C=CN/ST=Beijing/L=Chaoyang/O=CFM880/OU=CFM880/CN=CFM880/[email protected]'
mkdir ~/.android-certs
for x in releasekey platform shared media networkstack; do \
    ./development/tools/make_key ~/.android-certs/$x "$subject"; \
done

vendor.img 出错

https://stackoverflow.com/questions/75201758/android-12-13-signing-images-fails-with-error-in-sign-target-files-apks-due-to-m

https://github.com/PixelExperience/build/commit/8d0487a778a78a37866aa71d4305ebbc97ae8861

生成发布版本

make dist
sign_target_files_apks -o \ # explained in the next section
--default_key_mappings ~/.android-certs out/dist/*-target_files-*.zip \
signed-target_files.zip

提取img

img_from_target_files signed-target_files.zip signed-img.zip

解压signed-img.zip

cd signed-img
export ANDROID_PRODUCT_OUT=`pwd`
adb reboot bootloader
fastboot flashall -w
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment