From 7ddf7163be0c145132edc25dadfce685e0e07be3 Mon Sep 17 00:00:00 2001 From: DeaDDooMER Date: Sun, 19 Dec 2021 22:30:10 +0300 Subject: [PATCH] android: update build instructions --- android/README | 104 ++++++++++++++++++++++++++++--------------------- 1 file changed, 60 insertions(+), 44 deletions(-) diff --git a/android/README b/android/README index 3b76d72..f766dab 100644 --- a/android/README +++ b/android/README @@ -1,20 +1,35 @@ D2DF-SDL for ANDROID -------------------- -Doom 2D Forever ported to Android 4.1+. +Doom 2D Forever port for Android 4.0+ Building -------- -Requirements: -* Android SDK build-tools >= 19.1.0; -* Android SDK platforms >= android-16; -* Android NDK >= r16b; -* Open JDK >= 8; -* FPC >= 3.0.4; -* SDL == 2.0.7; -* SDL_mixer >= 2.0; -* libenet >= 1.3.13. +Tools, files and libraries used for official builds: +* Android Platform Tools r21 (adb) +* Android Build Tools r21 (dx, aapt) +* Android Platform 19 (android.jar) +* OpenJDK 8 (javac, jarsigner) +* Crystax NDK 10.3.2 +* FPC 3.2.2 +* SDL 2.0.7 +* SDL_mixer 2.0.4 +* libenet 1.3.17 +* libminiupnpc 2.2.3 + +Official packages builded for following Android ABIs (fpc options): +* armeabi (-CpARMV5TE -CfSOFT -CaEABI -O2) [1] +* armeabi-v7a (-CpARMV7A -CfVFPV3_D16 -CaEABI -O2) [1] +* arm64-v8a (-CpARMV8 -CfVFP -O2) [2] +* mips (-CpMIPS32 -CfMIPS3 -O2) [1][3][not tested] +* x86 (-CpPENTIUM4 -CfSSSE3 -O-) [1][4][5] +* x86_64 (-CpCOREI -CfSSE42 -O-) [2][4][5][not tested] + +[1] 32-bit builds linked with Android Platform 14 shared libraries +[2] 64-bit builds linked with Android Platform 21 shared libraries +[3] FPU instruction set can be incorrect for generic builds +[4] CPU instruction set can be incorrect for generic builds Build all shared libraries using NDK toolchain and put into directory ./ass/lib/armeabi-v7a/. Also you need to build FPC crosscompiler ( http://wiki.freepascal.org/Android ). @@ -22,37 +37,35 @@ Also you need to build FPC crosscompiler ( http://wiki.freepascal.org/Android ). If you want to pack game resources into APK, add it into directory "resources". If you want to play MIDI music, add instruments and timidity.cfg into directory "resources" (you can grab it from https://www.libsdl.org/projects/SDL_mixer/timidity/timidity.tar.gz). -Generate keys: +Generate your personal keys (only onece): ``` keytool -genkey -validity 10000 \ - -dname "CN=AndroidDebug, O=Android, C=US" \ - -keystore d2df.keystore \ - -storepass android \ - -keypass android \ - -alias androiddebugkey \ - -keyalg RSA \ - -keysize 2048 \ - -v + -dname "CN=AndroidDebug, O=Android, C=US" \ + -keystore d2df.keystore \ + -storepass android \ + -keypass android \ + -alias androiddebugkey \ + -keyalg RSA \ + -keysize 2048 \ + -v ``` -Build D2DF: +Build D2DF for android armeabi-v7a: ``` rm -rf tmp mkdir -p tmp cd ../src/game -ppcrossarm \ - -g -gl -dUSE_SDLMIXER -dUSE_GLES1 -O3 \ - -Tandroid \ - -Cparmv7a \ - -Cfvfpv3 \ - -FU../../android/tmp \ - -FE../../android/ass/lib/armeabi-v7a \ - -Fl../../android/ass/lib/armeabi-v7a \ - -olibDoom2DF.so \ - Doom2DF.lpr +ppcrossarm -g -gl -O2 \ + -Tandroid -CpARMV7A -CfVFPV3_D16 -CaEABI \ + -dUSE_SDL2 -dUSE_SDLMIXER -dUSE_GLES1 -dUSE_MINIUPNPC -O2 \ + -FU../../android/tmp \ + -FE../../android/ass/lib/armeabi-v7a \ + -Fl../../android/ass/lib/armeabi-v7a \ + -olibDoom2DF.so \ + Doom2DF.lpr ``` -Build APK and sign it: +Build APK and sign it (${ANDROID_JAR} are path to android.jar): ``` rm -rf bin obj gen mkdir -p bin obj gen resources @@ -60,19 +73,22 @@ aapt package -f -m -S res -J gen -M AndroidManifest.xml -I ${ANDROID_JAR} javac -source 1.6 -target 1.6 -d obj -bootclasspath ${ANDROID_JAR} -sourcepath src `find src -name '*.java'` dx --dex --output=bin/classes.dex obj aapt package -f \ - -M AndroidManifest.xml \ - -S res \ - -J gen \ - -I ${ANDROID_JAR} \ - -F bin/d2df.unsigned.apk \ - -A resources - bin ass + -M AndroidManifest.xml \ + -S res \ + -J gen \ + -I ${ANDROID_JAR} \ + -F bin/d2df.unsigned.apk \ + -A resources + bin ass jarsigner -sigalg SHA1withRSA -digestalg SHA1 \ - -keystore d2df.keystore \ - -storepass android \ - -keypass android \ - -signedjar bin/d2df.signed.apk \ - bin/d2df.unsigned.apk androiddebugkey + -keystore d2df.keystore \ + -storepass android \ + -keypass android \ + -signedjar bin/d2df.signed.apk \ + bin/d2df.unsigned.apk androiddebugkey ``` -Where ${ANDROID_JAR} is path to android.jar file. Typically placed in ~/Android/android-sdk/platforms/android-16/android.jar. +Install APK on your device via adb: +``` +adb install -r bin/d2df.signed.apk +``` -- 2.29.2