Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build fixed and GitHub actions #592

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

andrewleech
Copy link
Contributor

@andrewleech andrewleech commented Dec 9, 2022

Hi, thanks for building this awesome open source editor for Android!

I ran into some issues building it from a clean git clone which I've addressed in the first couple I of commits here, do they look right to you?

I also added a yarn/npm target for a shortcut to reset the git repo to a clean state; this just deletes all the ignored files (build state / artifacts) to make it easier to test if the build is working reliably.

I then got GitHub actions set up to try to make the build more repeatable long term. The run from this branch can be seen here: https://github.com/andrewleech/Acode/actions/runs/3660345162

@andrewleech
Copy link
Contributor Author

In case it's of any interest to anyone, I was using the following script to build this project locally. The bulk of it is done in a docker environment to ensure tool version control.

docker run -t --rm -v $(pwd):/Acode -w /Acode hamdifourati/cordova-android-builder:cordova-11 bash -c '\
yes | sdkmanager --licenses ;\
chown -R root . ;\
npm add -g yarn ;\
yarn setup ;\
cordova telemetry on ;\
yarn clean ;\
npm run build android paid prod ;\
npm run build android paid d ;\
chown -R 1000 . ;\
'

## convert aab bundle to APK

# grab tool for conversion
if [  ! -f bundletool-all-1.13.1.jar ]; then
  wget https://github.com/google/bundletool/releases/download/1.13.1/bundletool-all-1.13.1.jar
fi

# generate signature
if [  ! -f acode.keystore ]; then
keytool -genkey -v -keystore acode.keystore -alias acode -keyalg RSA -keysize 2048 -validity 10000
fi

# cleanup if needed
rm -rf *.apks  toc.pb

# convert to apk
for aab in *.aab; do
java -jar "bundletool-all-1.13.1.jar" build-apks --bundle=$aab --mode=universal --output="${aab%.*}.apks" --ks=acode.keystore --ks-pass=pass:acode1 --ks-key-alias=acode --key-pass=pass:acode1

# extract apk
unzip ${aab%.*}.apks
mv -v universal.apk ${aab%.*}.apk
done

@deadlyjack
Copy link
Owner

Hi thanks for the script, but there is not to build free version of the app. Please change the script to only build APK of pro version.

@deadlyjack
Copy link
Owner

Thanks for updating the script. I noticed it's building .aab file but I'm not supporting it yet. It needs to build .apk for production also.

@RaSan147
Copy link

RaSan147 commented Jan 9, 2023

any update?? can't build it anyway :(
your app is really great but the ad on keyboard led me here to build myself and spent hours trying to build this

@andrewleech
Copy link
Contributor Author

Thanks for updating the script. I noticed it's building .aab file but I'm not supporting it yet. It needs to build .apk for production also.

aab files are what Cordova always makes now for production builds, are you building with an older version?

.aab are designed to be submitted to play store where they're signed in then cloud.

I wrote above how I was converting the aab to APK locally for testing, but it needs signing as part of the process. I could copy that process into the github actions but for it to be compatible with your official builds it'd need your signatures store added in a protected way.

I kind of assumed you probably wouldn't want the paid / prod version of the APK too easily available here anyway :-D

@Sohil876
Copy link

Thanks for updating the script. I noticed it's building .aab file but I'm not supporting it yet. It needs to build .apk for production also.

aab files are what Cordova always makes now for production builds, are you building with an older version?

.aab are designed to be submitted to play store where they're signed in then cloud.

I wrote above how I was converting the aab to APK locally for testing, but it needs signing as part of the process. I could copy that process into the github actions but for it to be compatible with your official builds it'd need your signatures store added in a protected way.

I kind of assumed you probably wouldn't want the paid / prod version of the APK too easily available here anyway :-D

You dont need to do that, just set packageType to apk for your build type in build.json and it'll build apk instead of aab.

Copy link
Contributor

@sebastianjnuwu sebastianjnuwu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Git.....

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants