Created
September 18, 2022 23:28
-
-
Save satheshshiva/c894291c3c1f847e965c564f9fe85ca1 to your computer and use it in GitHub Desktop.
This file contains 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
EXTRACTED_LOCATION=./extracted | |
TMP=tmp | |
TOOLS_LOC=<<Android_SDK_LOC>>/Android/sdk/build-tools/29.0.3 | |
OP_FILE=~/Desktop/tryThis.apks | |
rm -rf $OP_FILE | |
rm -rf $TMP && mkdir $TMP | |
echo Copying everything to $TMP folder.. | |
cp -R $EXTRACTED_LOCATION/* $TMP | |
apktool b --use-aapt2 -o $TMP/base.apk $TMP/base/ | |
# remove the base folder because its huge | |
rm -rf $TMP/base/ | |
#Signing all the apk files found | |
for i in $(ls $TMP/*.apk);do | |
[ -f "$i" ] || break | |
echo signing $i | |
$TOOLS_LOC/zipalign -v -p 4 $i $i.aligned | |
rm -rf $i | |
$TOOLS_LOC/apksigner sign -ks <<Certificate_for_signing>> --out $i --ks-pass pass:<<Password_For_Certificate>> $i.aligned | |
rm -rf $i.aligned | |
$TOOLS_LOC/apksigner verify $i | |
done | |
zip -r $OP_FILE $TMP/* | |
echo "COMPLETED" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment