Building a Custom Game APK for stand alone games, Old Methods - Work in progress - please read warning

oldyz

Well-known member
This account is temporarily muted.
Greeting friends, i am documenting the process on my machines, so far these methods have worked well using an older set of files & i think that it is important for now to have it documented.
thanks to @msmalik681, @Kratus & @bWWd for their input

ATTENTION:
these methods need the 'android' folder to be made from scratch - if you have experimented in the past the 'old' android folder needs to be renamed or deleted

Windows 7 32 bit: (needs testing)
 
Last edited:
Windows 7 64 bit

Oldyz workflow 64 bit components , windows 7 64 bit, Kratus files
ATTENTION:
these methods need the 'android' folder to be made from scratch - if you have experimented in the past the 'old' android folder needs to be renamed or deleted


Downloaded Java JDK 15.02
jdk-15.0.2_windows-x64_bin.exe



Downloaded the Android SDK, "command line tools only" package for windows

commandlinetools-win-6858069_latest.zip

extracted the compressd contents of 'cmdline-tools' folder to
C:\android\sdk\cmdline-tools\version
######### NOTE sdk-setup.bat will ask for this path later ##################
you will end up with a path structure like this:
C:\android\sdk\cmdline-tools\version\bin\sdkmanager.bat

Downloaded android-ndk-r21e-windows-x86_64.zip
extracted all contents inside the compressed folder android-ndk-r21 folder to:
C:\android\ndk
you will end up with a path structure like this:
C:\android\ndk\ -- 11 folders & 9 files


setup the environment variables, used the search bar to search for "advanced system settings"
that window will have a button at the bottom for "Environment Variables" now select "New" under "user variable":

######## DO NOT USE QUOTES #########


"ANDROID_HOME" = "C:\android\sdk"
ANDROID_NDK_HOME = C:\android\ndk


Now setup a new System Variable

##### oldyz note, value equals path ######

"C:\Program Files\Java\jdk-15.0.2\bin"

value C:\Program Files\Java\jdk-15.0.2\bin


NEXT edit System variable -> Path check for these:

### NOTE: make sure you have this on your 'path' variable: ####

%SystemRoot%;%SystemRoot%\system32;

edit System variable -> Path add these to value (after the last ; ) :
C:\Program Files\Java\jdk-15.0.2\bin;

##### building 'Master build' APK ######

Downloaded the master branch here
click on code, menu pops down, & 'download zip'

next - extract the zip file to your C drive

go to this directory:
C:\openbor-master\engine\android

#### NOTE - there is no need to patch 'script.bat' #####

Run the file "sdk-setup.bat" (found in root of openbor android folder)

things download to 100%

after that
execute build.bat

success

########### WEIRD #############

you can skip sdk-setup.bat, & still compile well w master ?????
HACK?

- created a 'latest' folder inside
C:\android\sdk\cmdline-tools\version, pasted all the contents of cmdline-tools inside latest, and ran this command to accept
the licences: sdkmanager --licenses usig a command window.

after that ran build.bat (skipped sdk-setup.bat completely and the build went well for master build)

################## End of weird ####################

############## 6391 compile ##############################

Downloaded the master branch here
as zip file
Download older build (6391 for this exmaple)

after you extract them to C:

go to this master build directoty:

C:\openbor-master\engine

copy the android folder

go to the 6391 (or older build) directory:

C:\openbor-6391\engine

delete Android folder

paste the new android folder



########### Video.c patch ###########

go to this master build directory:
C:\openbor-master\engine\sdl

open video.c

copy this line:
#include "android/app/jni/openbor/video.c"

go the older build directoy:
C:\openbor-6391\engine\sdl

edit video.c

replace this line:
#include "android/jni/openbor/video.c"
with
#include "android/app/jni/openbor/video.c"

##### packfile.c for older build ########

go to this master build directory:
C:\openbor-master\engine\source\gamelib
copy packfile.c

go this older build directory:
C:\openbor-6391\engine\source\gamelib
paste packfile.c

Finally go to this directory:
C:\openbor-6391\engine\android
& run build.bat
 
Last edited:
Windows 10 64 bit

Oldyz workflow 64 bit components , windows 10 64 bit, Kratus files

ATTENTION:
these methods need the 'android' folder to be made from scratch - if you have experimented in the past the 'old' android folder needs to be renamed or deleted


Downloaded 32bit Java JDK 15.02
jdk-15.0.2_windows-x64_bin.exe



Downloaded the Android SDK, "command line tools only" package for windows

commandlinetools-win-6858069_latest.zip

extracted the compressd contents of 'cmdline-tools' folder to
C:\android\sdk\cmdline-tools\version
######### NOTE sdk-setup.bat will ask for this path later ##################
you will end up with a path structure like this:
C:\android\sdk\cmdline-tools\version\bin\sdkmanager.bat

Downloaded android-ndk-r21e-windows-x86_64.zip
extracted all contents inside the compressed folder android-ndk-r21 folder to:
C:\android\ndk
you will end up with a path structure like this:
C:\android\ndk\ -- 11 folders & 9 files


setup the environment variables, used the search bar to search for "advanced system settings"
that window will have a button at the bottom for "Environment Variables" now select "New" under "user variable":

################# DO NOT USE QUOTES #########


"ANDROID_HOME" = "C:\android\sdk"
ANDROID_NDK_HOME = C:\android\ndk

##### oldyz note, value equals path ######

Now setup System Variables -> Path add these lines:

"C:\Program Files\Java\jdk-15.0.2\bin"

value C:\Program Files\Java\jdk-15.0.2\bin



Downloaded the master branch here
click on code, menu pops down, & 'download zip'

next - extract the zip file to your C drive

go to this directory:
C:\openbor-master\engine\android

#### NOTE - there is no need to patch 'script.bat' #####

Run the file "sdk-setup.bat" (found in root of openbor android folder)
it downloads everything needed...

then run build.bat

success

########### WEIRD #############

you can skip sdk-setup.bat, & still compile well w master ?????
HACK?

- created a 'latest' folder inside
C:\android\sdk\cmdline-tools\version, pasted all the contents of cmdline-tools inside latest, and ran this command to accept
the licences: sdkmanager --licenses usig a command window.

after that ran build.bat (skipped sdk-setup.bat completely and the build went well for master build)

################## End of weird ####################

############## 6391 compile ##############################
Downloaded the master branch here
as zip file
Download older build (6391 for this exmaple)

after you extract them to C:

go to this master build directoty:

C:\openbor-master\engine

copy the android folder

go to the 6391 (or older build) directory:

C:\openbor-6391\engine

delete Android folder

paste the new android folder



########### Video.c patch ###########

go to this master build directory:
C:\openbor-master\engine\sdl

open video.c

copy this line:
#include "android/app/jni/openbor/video.c"

go the older build directoy:
C:\openbor-6391\engine\sdl

edit video.c

replace this line:
#include "android/jni/openbor/video.c"
with
#include "android/app/jni/openbor/video.c"

##### packfile.c for older build ########

go to this master build directory:
C:\openbor-master\engine\source\gamelib
copy packfile.c

go this older build directory:
C:\openbor-6391\engine\source\gamelib
paste packfile.c

Finally go to this directory:
C:\openbor-6391\engine\android
& run build.bat

#### Custom Game APK ######
for this example, the work continues using the 6391 engine that has already been patched using some Master build files in earlier steps

go to C:\openbor-6391\engine\android

edit make-my-key.bat

replace 'alias_name' with the alias you want

example:
keytool -genkey -v -keystore my-key.jks -alias user -keyalg RSA -keysize 2048 -validity 10000

after that, execute it and follow directions, a 'my-key.jks' file will be generated.

##### note , master build's make-my-key.bat does not work in my windows 10, but kratus's build did, master's might need editing ######

inside 'C:\openbor-6391\engine\android'
create a 'keystore.properties' file, edit it and paste this template:

storePassword=password
keyPassword=password
keyAlias=alias_name
storeFile=../my-key.jks

edit the fields to match your "my-key.jks" file and save. ---- Example

storePassword=123456
keyPassword=123456
keyAlias=user
storeFile=../my-key.jks


inside 'C:\openbor-6391\engine\android' now edit the "build.bat" file
and make sure it is set to " cmd /k "gradlew.bat clean & gradlew.bat assembleRelease" "
ignoring the outer quotes I used here & save it as build custom.bat

go to 'C:\openbor-6391\engine\android\app'
edit build.gradle
- example:
//////////// MODFY FOR CUSTOM APK /////////////////
applicationId "org.openbor.engine"
versionCode 1
versionName "1.0.0"
resValue "string", "app_name", "Openbor"
///////////////////////////////////////////////////

Edited
//////////// MODFY FOR CUSTOM APK /////////////////
applicationId "org.demodemo.engine"
versionCode 2
versionName "2.3.0"
resValue "string", "app_name", "Demo"
///////////////////////////////////////////////////

Copy your pak file to the folder "C:\openbor-6391\engine\android\app\src\main\assets\bor.pak" and it should be less then
100mb if you want to publish to play store.

for custom android icons go to
C:\openbor-6391\engine\android\app\src\main\res\drawable-hdpi
C:\openbor-6391\engine\android\app\src\main\res\drawable-ldpi
C:\openbor-6391\engine\android\app\src\main\res\drawable-mdpi
and edit or replace the icon.png files

for custom dragon splash screen go to:
'C:\openbor-6391\engine\resources\'
& find a way to edit or create all
OpenBOR_Logo_320x240...... .h
OpenBOR_Logo_320x240_..... .h
OpenBOR_Logo_480x272...... .h
OpenBOR_Logo_480x272_..... .h
files

for custom openbor selection menus go to:
'C:\openbor-6391\engine\resources\'
& find a way to edit or create all
'OpenBOR_Menu_' '.h' files

Custom button image go to 'C:\openbor-6391\engine\android\app\jni\openbor'
and find a way to edit or create a 'button_png_800x480.h' file

after all the edits are done go back to 'C:\openbor-master\engine\android'
and run "build custom.bat"
 
Last edited:
Just wanted to let you know that these methods didnt work for me on win10 64bit so im not sure about recommending these to others , you just would have to wait and see how others are struggling , what worked for me was maliks method where you dont have to set any paths and its handled like windows env, single bat file and all is done .
IMO this creates confusion , also its important to mention that you have to erase .android and .gradle in user directory
 
I have added a warning on the first post

Just wanted to let you know that these methods didnt work for me on win10 64bit so im not sure about recommending these to others , you just would have to wait and see how others are struggling , what worked for me was maliks method where you dont have to set any paths and its handled like windows env, single bat file and all is done .
IMO this creates confusion , also its important to mention that you have to erase .android and .gradle in user directory
Thanks, i forgot to add that these instructions can only work with a freshly made 'android' folder.
you need to erase the old ones & create a new one.
I am experimenting to see if copy pasting will work, to see if a big 8gb package can be made, but that will have to wait a few more days unitl i can test it across machines.
 
Also, i have not forgoten about the msmalik681's new method, but since i wan to compare results i might as well document everything
 
  • Like
Reactions: ABK
updated the windows 10 procedures i used during the weekend.
directories have been corrected
 
Back
Top Bottom