Cat /dev/Nulo 1 year ago
commit a05dc22a5f

1
.gitignore vendored

@ -0,0 +1 @@
my-release-key.keystore

Binary file not shown.

@ -0,0 +1,22 @@
#!/bin/sh
dir="$(mktemp -d)"
echo "=> $dir"
if test ! -f my-release-key.keystore; then
keytool -genkey -v -keystore my-release-key.keystore -alias alias_name -keyalg RSA -keysize 2048 -validity 10000
fi
# force-all because $dir already exists
apktool decode "$1" --force-all --output "$dir" || exit 1
# https://stackoverflow.com/questions/50461881/java-lang-noclassdeffounderrorfailed-resolution-of-lorg-apache-http-protocolve#50779232
sed -i "s/<\/application>/<uses-library android:name=\"org.apache.http.legacy\" android:required=\"false\" \/><\/application>/" "$dir/AndroidManifest.xml" || exit 1
apktool build "$dir" || exit 1
mv "$dir"/dist/* "$dir/dist/output.apk"
jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore my-release-key.keystore "$dir/dist/output.apk" alias_name || exit 1
cp "$dir/dist/output.apk" . || exit 1
rm -rf "$dir"
Loading…
Cancel
Save