android包加固重签名

apk打包后需要重新手动签名

使用android apksigner签名

https://developer.android.google.cn/studio/command-line/apksigner

 

 使用的时候需要注意密码不是直接的密码而是要加pass:前缀 否则就会说密码错误[狗头]   Keystore was tampered with or password was incorrect

 

 这里直接写了一个bat脚本,可以用

 

 

@echo off
echo run as adminer

::路径设置
set keystorePath=D:\workspace\xxxxxxxxxxxxxxxxxxxxxxxxx.keystore
set ksKeyAlias=yyyyyyyyyyyyyyyy
set ksPass=zzzzzzzzzzzzzzzzzz
set keyPass=aaaaaaaaaaaaaaaaaaaaaaaaaaaaa
set apksignerPath=C:\ProgramData\Microsoft\AndroidSDK\25\build-tools\25.0.3\apksigner.bat

echo.
echo use keystorePath %keystorePath%
echo.
echo use ksKeyAlias %ksKeyAlias%
echo.
echo use apksignerPath %apksignerPath%
echo.

pause

::获取输入
set /p apkToSignPath=please input the path of apk to sign: 

::换行
echo.

echo %apkToSignPath%

::获取输入
set /p apkToSavePath=please input the file path to save  signed apk: 

::换行
echo.

echo %apkToSavePath%

pause

%apksignerPath% sign --ks %keystorePath% --ks-key-alias %ksKeyAlias% --ks-pass pass:%ksPass%  --key-pass pass:%keyPass% --out %apkToSavePath% %apkToSignPath%

pause

 

posted @ 2023-01-10 19:50  timseng  阅读(219)  评论(0编辑  收藏  举报