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

Update Android build #6103

Open
wants to merge 43 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 36 commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
09b5ee8
update android builds to SDK 29, use Java 11
kevlahnota Sep 8, 2024
3e5b239
Merge branch 'master' into master2
kevlahnota Sep 8, 2024
a8f6842
update some dependency
kevlahnota Sep 8, 2024
af89e52
update target sdk and build tools to 33
kevlahnota Sep 9, 2024
21b6e15
update
kevlahnota Sep 9, 2024
7ea3e6b
Merge branch 'master' into master2
kevlahnota Sep 9, 2024
c40edf8
revert to sdk 29 (Android 10) until the v2 signing works on android 1…
kevlahnota Sep 9, 2024
b790455
Merge branch 'master' into master2
kevlahnota Sep 9, 2024
822676d
Merge branch 'master' into master2
kevlahnota Sep 10, 2024
bfca199
Merge branch 'master' into master2
kevlahnota Sep 10, 2024
e623e02
update network check
kevlahnota Sep 10, 2024
d7c106b
Merge branch 'master' into master2
kevlahnota Sep 10, 2024
78f3d3d
update more dependency
kevlahnota Sep 10, 2024
d6b9ad5
Merge branch 'master' into master2
kevlahnota Sep 10, 2024
b683f2d
Merge branch 'master' into master2
kevlahnota Sep 11, 2024
83b653a
Merge branch 'master' into master2
kevlahnota Sep 11, 2024
f442189
update SplashScreen
kevlahnota Sep 12, 2024
b9a36bd
Merge branch 'master' into master2
kevlahnota Sep 13, 2024
368ef9d
Merge branch 'master' into master2
kevlahnota Sep 13, 2024
1918770
update to sdk 33, update v2 signer-modded
kevlahnota Sep 13, 2024
ca9f2da
update manifest, add uber-apk-signer
kevlahnota Sep 13, 2024
edc3af5
Merge branch 'master' into master2
kevlahnota Sep 14, 2024
74eebf4
move signer to tools
kevlahnota Sep 14, 2024
b6a0540
Merge branch 'master' into master2
kevlahnota Sep 14, 2024
372c3cf
Merge branch 'master' into master2
kevlahnota Sep 15, 2024
dd11d04
Merge branch 'master' into master2
kevlahnota Sep 15, 2024
99c235e
Merge branch 'master' into master2
kevlahnota Sep 15, 2024
ef6716c
update exec-plugin
kevlahnota Sep 15, 2024
116720a
update compiler release
kevlahnota Sep 16, 2024
9fc9384
Merge branch 'master' into master2
kevlahnota Sep 16, 2024
c04055f
Merge branch 'master' into master2
kevlahnota Sep 16, 2024
2154066
Merge branch 'master' into master2
kevlahnota Sep 16, 2024
0c248d7
Merge branch 'master' into master2
kevlahnota Sep 17, 2024
de9823a
Merge branch 'master' into master2
kevlahnota Sep 17, 2024
bbc3d56
update maven, dependency plugins
kevlahnota Sep 17, 2024
5099d0f
set landscape sensor from android 11 onwards
kevlahnota Sep 17, 2024
fd7da13
Merge branch 'master' into master2
kevlahnota Sep 17, 2024
0dde987
update jaxb-api -> fix illegal access warning
kevlahnota Sep 18, 2024
fd4ba13
Merge branch 'master' into master2
kevlahnota Sep 18, 2024
f53bc65
Merge branch 'master' into master2
kevlahnota Sep 19, 2024
25435c8
update sign tool
kevlahnota Sep 19, 2024
c1f9c76
Merge branch 'master' into master2
kevlahnota Sep 20, 2024
ca2110c
Merge branch 'master' into master2
kevlahnota Sep 21, 2024
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
10 changes: 5 additions & 5 deletions .github/workflows/publish-android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ jobs:

steps:
- uses: actions/checkout@v3
- name: Set up JDK 8
- name: Set up JDK 11
uses: actions/setup-java@v3
with:
java-version: '8'
java-version: '11'
distribution: 'temurin'
cache: 'maven'
server-id: cardforge-repo
Expand All @@ -43,8 +43,8 @@ jobs:
uses: maxim-lobanov/setup-android-tools@v1
with:
packages: |
platforms;android-26
build-tools;30.0.3
platforms;android-33
build-tools;33.0.2

- name: Install virtual framebuffer (if not available) to allow running GUI on a headless server
run: |
Expand Down Expand Up @@ -83,7 +83,7 @@ jobs:
- name: Build/Install/Publish to GitHub Packages Apache Maven
run: |
export _JAVA_OPTIONS="-Xmx2g"
mvn -U -B -P android-release-build,android-release-sign,android-release-upload install -e -Dsign.keystore=forge.keystore -Dsign.alias=Forge -Dsign.storepass=${{ secrets.SIGN_STORE_PASS }} -Dsign.keypass=${{ secrets.SIGN_STORE_PASS }} -Dcardforge-repo.username=${{ secrets.FTP_USERNAME }} -Dcardforge-repo.password=${{ secrets.FTP_PASSWORD }} -Dandroid.sdk.path=/usr/local/lib/android/sdk -Dandroid.buildToolsVersion=30.0.3 -Dmaven.test.skip=true
mvn -U -B -P android-release-build,android-release-upload install -e -Dcardforge-repo.username=${{ secrets.FTP_USERNAME }} -Dcardforge-repo.password=${{ secrets.FTP_PASSWORD }} -Dandroid.sdk.path=/usr/local/lib/android/sdk -Dandroid.buildToolsVersion=33.0.2 -Dmaven.test.skip=true
env:
GITHUB_TOKEN: ${{ github.token }}

10 changes: 5 additions & 5 deletions .github/workflows/snapshots-android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ jobs:

steps:
- uses: actions/checkout@v3
- name: Set up JDK 8
- name: Set up JDK 11
uses: actions/setup-java@v3
with:
java-version: '8'
java-version: '11'
distribution: 'temurin'
cache: 'maven'
server-id: cardforge-repo
Expand All @@ -46,8 +46,8 @@ jobs:
- name: Set Up Android tools
run: |
JAVA_HOME=${JAVA_HOME_11_X64} ${ANDROID_SDK_ROOT}/cmdline-tools/latest/bin/sdkmanager --sdk_root=$ANDROID_SDK_ROOT "platform-tools"
JAVA_HOME=${JAVA_HOME_11_X64} ${ANDROID_SDK_ROOT}/cmdline-tools/latest/bin/sdkmanager --sdk_root=$ANDROID_SDK_ROOT --install "platforms;android-26"
JAVA_HOME=${JAVA_HOME_11_X64} ${ANDROID_SDK_ROOT}/cmdline-tools/latest/bin/sdkmanager --sdk_root=$ANDROID_SDK_ROOT --install "build-tools;30.0.3"
JAVA_HOME=${JAVA_HOME_11_X64} ${ANDROID_SDK_ROOT}/cmdline-tools/latest/bin/sdkmanager --sdk_root=$ANDROID_SDK_ROOT --install "platforms;android-33"
JAVA_HOME=${JAVA_HOME_11_X64} ${ANDROID_SDK_ROOT}/cmdline-tools/latest/bin/sdkmanager --sdk_root=$ANDROID_SDK_ROOT --install "build-tools;33.0.2"

- name: Install virtual framebuffer (if not available) to allow running GUI on a headless server
run: |
Expand Down Expand Up @@ -89,7 +89,7 @@ jobs:
d=$(date +%m-%d)
# Replace date in forge-gui-mobile/src/forge/Forge.java
sed -i -e "s/-SNAPSHOT/-SNAPSHOT-${d}/g" forge-gui-mobile/src/forge/Forge.java
mvn -U -B -P android-release-build,android-release-sign install -e -Dsign.keystore=forge.keystore -Dsign.alias=Forge -Dsign.storepass=${{ secrets.SIGN_STORE_PASS }} -Dsign.keypass=${{ secrets.SIGN_STORE_PASS }} -Dcardforge-repo.username=${{ secrets.FTP_USERNAME }} -Dcardforge-repo.password=${{ secrets.FTP_PASSWORD }} -Dandroid.sdk.path=/usr/local/lib/android/sdk -Dandroid.buildToolsVersion=30.0.3 -Dmaven.test.skip=true
mvn -U -B -P android-release-build install -e -Dcardforge-repo.username=${{ secrets.FTP_USERNAME }} -Dcardforge-repo.password=${{ secrets.FTP_PASSWORD }} -Dandroid.sdk.path=/usr/local/lib/android/sdk -Dandroid.buildToolsVersion=33.0.2 -Dmaven.test.skip=true
Copy link
Contributor

Choose a reason for hiding this comment

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

Signing isn't needed anymore?

Copy link
Contributor Author

@kevlahnota kevlahnota Sep 17, 2024

Choose a reason for hiding this comment

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

It's included on the android pom file, it will sign with v2, v3 on install phase using the modded signer

<plugin>
	<artifactId>exec-maven-plugin</artifactId>
	<version>3.4.1</version>
	<groupId>org.codehaus.mojo</groupId>
	<executions>
		<execution>
			<id>SignV2</id>
			<phase>install</phase>
			<goals>
				<goal>exec</goal>
			</goals>
		</execution>
	</executions>
	<configuration>
		<workingDirectory>${pom.basedir}</workingDirectory>
		<executable>java</executable>
		<arguments>
			<argument>-jar</argument>
			<argument>${pom.basedir}/tools/uber-apk-signer.jar</argument>
			<argument>-a</argument>
			<argument>${pom.basedir}/target/</argument>
			<argument>--ks</argument>
			<argument>forge.keystore</argument>
			<argument>--ksAlias</argument>
			<argument>Forge</argument>
			<argument>--ksKeyPass</argument>
			<argument>forge72</argument>
			<argument>--ksPass</argument>
			<argument>forge72</argument>
			<argument>--debug</argument>
		</arguments>
	</configuration>
</plugin>

Copy link
Contributor

Choose a reason for hiding this comment

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

Are those keystore passwords just placeholders for testing?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

check publish.bat in android module.

Copy link
Contributor

Choose a reason for hiding this comment

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

Knowing that the keystore credentials have already been in a publicly visible file for the last 9 years isn't doing much to mitigate my concern... Someone would still need the keystore itself to do anything malicious but if those are the actual passwords then that's a layer of security that isn't doing anything.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If the github actions template works on the pom file, feel free to update it since I don't know how those variable interact from github to maven via pom file

Copy link
Contributor

Choose a reason for hiding this comment

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

I'll admit I don't know much about that either, and the credentials would need to be changed by someone with more access than me anyway. I could open an issue for it but I'm hesitant to give security problems more visibility than necessary. It's probably not a huge problem in the short term though.

mkdir -p forge-gui-android/target/upload
mv forge-gui-android/target/*-signed-aligned.apk forge-gui-android/target/upload/
mv forge-gui-android/target/assets.zip forge-gui-android/target/upload/
Expand Down
58 changes: 6 additions & 52 deletions forge-adventure/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -46,65 +46,19 @@
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.8</source>
<target>1.8</target>
<source>11</source>
<target>11</target>
</configuration>
</plugin>

<plugin>
<groupId>com.akathist.maven.plugins.launch4j</groupId>
<artifactId>launch4j-maven-plugin</artifactId>
<version>1.7.25</version>
<version>2.1.2</version>
<executions>
<execution>
<id>l4j-adv</id>
<phase>package</phase>
<goals>
<goal>launch4j</goal>
</goals>
<configuration>
<headerType>gui</headerType>
<outfile>${project.build.directory}/forge-adventure-editor-java8.exe</outfile>
<jar>${project.build.finalName}-jar-with-dependencies.jar</jar>
<dontWrapJar>true</dontWrapJar>
<errTitle>forge</errTitle>
<icon>src/main/config/forge-adventure-editor.ico</icon>
<classPath>
<mainClass>forge.adventure.Main</mainClass>
<addDependencies>false</addDependencies>
<preCp>anything</preCp>
</classPath>
<jre>
<minVersion>1.8.0</minVersion>
<maxHeapSize>4096</maxHeapSize>
<opts>
<opt>-Dfile.encoding=UTF-8</opt>
</opts>
</jre>
<versionInfo>
<fileVersion>
1.0.0.0
</fileVersion>
<txtFileVersion>
1.0.0.0
</txtFileVersion>
<fileDescription>Forge</fileDescription>
<copyright>Forge</copyright>
<productVersion>
1.0.0.0
</productVersion>
<txtProductVersion>
1.0.0.0
</txtProductVersion>
<productName>forge-adventure-editor</productName>
<internalName>forge-adventure-editor</internalName>
<originalFilename>forge-adventure-editor-java8.exe</originalFilename>
</versionInfo>
</configuration>
</execution>
<!--extra-->
<execution>
<id>l4j-adv2</id>
<id>l4j-adv</id>
<phase>package</phase>
<goals>
<goal>launch4j</goal>
Expand Down Expand Up @@ -132,7 +86,7 @@
<opt>--add-opens java.base/java.math=ALL-UNNAMED</opt>
<opt>--add-opens java.base/jdk.internal.misc=ALL-UNNAMED</opt>
<opt>--add-opens java.base/java.nio=ALL-UNNAMED</opt>
<opt>--add-opens=java.base/sun.nio.ch=ALL-UNNAMED</opt>
<opt>--add-opens java.base/sun.nio.ch=ALL-UNNAMED</opt>
<opt>--add-opens java.base/java.util=ALL-UNNAMED</opt>
<opt>--add-opens java.base/java.lang.reflect=ALL-UNNAMED</opt>
<opt>--add-opens java.base/java.text=ALL-UNNAMED</opt>
Expand Down Expand Up @@ -285,7 +239,7 @@
<dependency>
<groupId>org.jetbrains</groupId>
<artifactId>annotations</artifactId>
<version>22.0.0</version>
<version>24.1.0</version>
<scope>compile</scope>
</dependency>
<dependency>
Expand Down
4 changes: 2 additions & 2 deletions forge-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>33.2.1-android</version>
<version>33.3.0-android</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.12.0</version>
<version>3.17.0</version>
</dependency>
</dependencies>

Expand Down
33 changes: 19 additions & 14 deletions forge-gui-android/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="forge.app"
android:versionCode="106650000"
android:versionName="1.6.65" > <!-- versionName should be updated and it's used for Sentry releases tag -->

<uses-sdk
android:minSdkVersion="26"
android:targetSdkVersion="28" />
android:targetSdkVersion="33" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/> <!-- This one needs Android Runtime Permission for Android 6+ -->
<uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE"/>
<uses-permission android:name="android.permission.USE_FULL_SCREEN_INTENT" tools:node="remove" />
<uses-permission android:name="android.permission.VIBRATE"/>
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
Expand All @@ -23,20 +26,22 @@
android:icon="@mipmap/ic_launcher"
android:roundIcon="@mipmap/ic_launcher_round"
android:label="@string/app_name"
android:largeHeap="true">
android:largeHeap="true"
android:resizeableActivity="false">
<activity
android:name=".Launcher"
android:configChanges="density|fontScale|keyboard|keyboardHidden|layoutDirection|locale|mcc|mnc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|touchscreen|uiMode"
android:theme="@style/Theme.Transparent">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.SEND" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="text/plain" />
</intent-filter>
android:name=".Launcher"
android:configChanges="density|fontScale|keyboard|keyboardHidden|layoutDirection|locale|mcc|mnc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|touchscreen|uiMode"
android:theme="@style/Theme.Transparent"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.SEND" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="text/plain" />
</intent-filter>
</activity>
<activity
android:name=".Main"
Expand Down
Binary file added forge-gui-android/libs/sun-misc.jar
Binary file not shown.
Loading
Loading