Skip to content

Commit

Permalink
android test
Browse files Browse the repository at this point in the history
  • Loading branch information
UnknownShadow200 committed Nov 27, 2024
1 parent a7f8cdc commit 9fd1307
Showing 1 changed file with 25 additions and 12 deletions.
37 changes: 25 additions & 12 deletions .github/workflows/build_android2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
container:
image: ghcr.io/saschpe/android-ndk:34-jdk17.0.8_7-ndk25.2.9519653-cmake3.22.1
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Compile android builds
shell: bash
Expand All @@ -38,22 +38,26 @@ jobs:
chmod +x build-tools/aapt
chmod +x build-tools/dx
chmod +x build-tools/zipalign
echo "Searching.."
find $PWD | grep apksigner
find /opt/android-sdk-linux/ | grep apksigner
cd $ROOT_DIR/src
$NDK_ROOT/armv7a-linux-androideabi19-clang *.c $DROID_FLAGS -march=armv5 $DROID_LIBS $LATEST_FLAG -o cc-droid-arm_16
$NDK_ROOT/armv7a-linux-androideabi19-clang *.c $DROID_FLAGS $DROID_LIBS $LATEST_FLAG -o cc-droid-arm_32
$NDK_ROOT/aarch64-linux-android21-clang *.c $DROID_FLAGS $DROID_LIBS $LATEST_FLAG -o cc-droid-arm_64
$NDK_ROOT/i686-linux-android21-clang *.c $DROID_FLAGS $DROID_LIBS $LATEST_FLAG -o cc-droid-x86_32
$NDK_ROOT/x86_64-linux-android21-clang *.c $DROID_FLAGS $DROID_LIBS $LATEST_FLAG -o cc-droid-x86_64
#$NDK_ROOT/armv7a-linux-androideabi19-clang *.c $DROID_FLAGS $DROID_LIBS $LATEST_FLAG -o cc-droid-arm_32
#$NDK_ROOT/aarch64-linux-android21-clang *.c $DROID_FLAGS $DROID_LIBS $LATEST_FLAG -o cc-droid-arm_64
#$NDK_ROOT/i686-linux-android21-clang *.c $DROID_FLAGS $DROID_LIBS $LATEST_FLAG -o cc-droid-x86_32
#$NDK_ROOT/x86_64-linux-android21-clang *.c $DROID_FLAGS $DROID_LIBS $LATEST_FLAG -o cc-droid-x86_64
cd $ROOT_DIR/android/app/src/main
# copy required native libraries
mkdir lib lib/armeabi lib/armeabi-v7a lib/arm64-v8a lib/x86 lib/x86_64
cp $ROOT_DIR/src/cc-droid-arm_16 lib/armeabi/libclassicube.so
cp $ROOT_DIR/src/cc-droid-arm_32 lib/armeabi-v7a/libclassicube.so
cp $ROOT_DIR/src/cc-droid-arm_64 lib/arm64-v8a/libclassicube.so
cp $ROOT_DIR/src/cc-droid-x86_32 lib/x86/libclassicube.so
cp $ROOT_DIR/src/cc-droid-x86_64 lib/x86_64/libclassicube.so
#cp $ROOT_DIR/src/cc-droid-arm_32 lib/armeabi-v7a/libclassicube.so
#cp $ROOT_DIR/src/cc-droid-arm_64 lib/arm64-v8a/libclassicube.so
#cp $ROOT_DIR/src/cc-droid-x86_32 lib/x86/libclassicube.so
#cp $ROOT_DIR/src/cc-droid-x86_64 lib/x86_64/libclassicube.so
# The following commands are for manually building an .apk, see
# https://spin.atomicobject.com/2011/08/22/building-android-application-bundles-apks-by-hand/
Expand All @@ -76,10 +80,12 @@ jobs:
$TOOLS_ROOT/aapt package -f -M AndroidManifest.xml -S res -F obj/cc-unsigned.apk -I $SDK_ROOT/android.jar
# and add all the required files
cp obj/classes.dex classes.dex
$TOOLS_ROOT/aapt add -f obj/cc-unsigned.apk classes.dex lib/armeabi/libclassicube.so lib/armeabi-v7a/libclassicube.so lib/arm64-v8a/libclassicube.so lib/x86/libclassicube.so lib/x86_64/libclassicube.so
#$TOOLS_ROOT/aapt add -f obj/cc-unsigned.apk classes.dex lib/armeabi/libclassicube.so lib/armeabi-v7a/libclassicube.so lib/arm64-v8a/libclassicube.so lib/x86/libclassicube.so lib/x86_64/libclassicube.so
$TOOLS_ROOT/aapt add -f obj/cc-unsigned.apk classes.dex lib/armeabi/libclassicube.so
# sign the apk with debug key (https://stackoverflow.com/questions/16711233/)
cp obj/cc-unsigned.apk obj/cc-signed.apk
jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore debug.keystore -storepass android -keypass android obj/cc-signed.apk androiddebugkey
#jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore debug.keystore -storepass android -keypass android obj/cc-signed.apk androiddebugkey
$TOOLS_ROOT/apksigner sign --ks debug.keystore --ks-pass pass:android obj/cc-signed.apk
# jarsigner -verbose
# create aligned .apk file
$TOOLS_ROOT/zipalign -f 4 obj/cc-signed.apk $ROOT_DIR/src/cc.apk
Expand All @@ -96,4 +102,11 @@ jobs:
if: ${{ always() && steps.compile.outcome == 'success' }}
with:
SOURCE_FILE: 'src/cc.apk'
DEST_NAME: 'ClassiCube.apk'
DEST_NAME: 'cc.apk'


- uses: ./.github/actions/notify_success
if: ${{ always() && steps.compile.outcome == 'success' }}
with:
DESTINATION_URL: '${{ secrets.NOTIFY_URL }}'
WORKFLOW_NAME: 'android'

0 comments on commit 9fd1307

Please sign in to comment.