Created
April 12, 2016 00:53
-
-
Save houtianze/7ec02de9c8c5f5966ecd2ddbdaa0fb73 to your computer and use it in GitHub Desktop.
A simple Windows batch file to build apk from a smali directory
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
:: you need to have apktool in your path | |
if not x%1==x goto doit | |
:usage | |
echo %~n0 ^<smali dir^> | |
goto end | |
:doit | |
set EXTRA_SIGN_AGS= | |
if not x%KEYPASS%==x set EXTRA_SIGN_AGS=-storepass %KEYPASS% -keypass %KEYPASS% | |
set UNSIGNED_APK=%1-unsigned.apk | |
set UNALIGNED_APK=%1-unaligned.apk | |
cmd /c apktool -f b %1 -o %UNSIGNED_APK% | |
if errorlevel 1 goto end | |
jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore apk.keystore %EXTRA_SIGN_AGS% -signedjar %UNALIGNED_APK% %UNSIGNED_APK% apk.hacking | |
zipalign -f -v 4 %UNALIGNED_APK% %1.apk | |
goto end | |
:end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment