Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# ApkGolf
This repository hosts the smallest Android APK in the world. The current size of the APK is *1295 bytes*.
This repository hosts the smallest Android APK in the world. The current size of the APK is *922 bytes*.

To learn more about how this was achieved, please read the [blog post](https://fractalwrench.co.uk/posts/playing-apk-golf-how-low-can-an-android-app-go/).

Expand Down
Binary file added app-unsigned.apk
Binary file not shown.
Binary file removed app/keystore.jks
Binary file not shown.
11 changes: 8 additions & 3 deletions build.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
#!/usr/bin/env bash

set -e

rm -rf build
mkdir -p build/apk

set -x
: ${ANDROID_HOME:?"Need to set ANDROID_HOME"}

# Use zopfli compression if available
recompress() {
Expand All @@ -14,7 +16,10 @@ recompress() {
fi
}

#TODO ensure that ANDROID_HOME is set
set -x

echo "Creating keystore"
keytool -genkeypair -keyalg EC -keysize 256 -v -keystore build/keystore.jks -storepass android -dname 'C=' -alias android -keypass android

echo "Creating base AndroidManifest.xml"
$ANDROID_HOME/build-tools/26.0.2/aapt p -M app/AndroidManifest.xml -S app/res -I $ANDROID_HOME/platforms/android-26/android.jar -f -F build/base.apk
Expand All @@ -35,7 +40,7 @@ zip -j -r build/app-unsigned.apk build/apk
recompress build/app-unsigned.apk

echo "Signing archive"
KEYSTORE_PASS=android $ANDROID_HOME/build-tools/26.0.2/apksigner sign --v1-signing-enabled false --ks app/keystore.jks --out build/signed-release.apk --ks-pass env:KEYSTORE_PASS --ks-key-alias android --min-sdk-version 24 build/app-unsigned.apk
$ANDROID_HOME/build-tools/26.0.2/apksigner sign --v1-signing-enabled false --ks build/keystore.jks --out build/signed-release.apk --ks-pass pass:android --ks-key-alias android --min-sdk-version 24 build/app-unsigned.apk

set +x

Expand Down
Binary file added keystore.jks
Binary file not shown.
Binary file modified signed-release.apk
Binary file not shown.