Compare commits

...

14 Commits

Author SHA1 Message Date
Miku AuahDark 07088eee88 Bump Minimum SDK to API 18 (KitKat)
Support for Jelly Bean has been gone the moment we update NDK toolchain version. See #279 for the rational on this change.
2024-10-12 09:51:23 +08:00
Miku AuahDark 3d1503f917 Respect user orientation lock setting for resizable window.
Cherry-picked from libsdl-org/SDL@3373667.
2024-06-18 11:03:15 +08:00
Miku AuahDark 65c4223d0a Update actions/checkout and actions/upload-artifact to v4. 2024-02-16 10:54:19 +08:00
Miku AuahDark 1975903d2e Separate debug and release APK build to reduce CI build times. 2024-02-16 10:54:14 +08:00
Miku AuahDark 860c109861 Update coypright year. 2024-02-13 10:18:48 +08:00
Miku AuahDark e74a9ef791 Update LOVE 11.x submodule. 2024-02-13 10:18:17 +08:00
Miku AuahDark 55feb38fa1 Release 11.5 hotfix 1. 2023-12-29 13:51:37 +08:00
Miku AuahDark 6811eca7d2 Artifact unstripped .so files. 2023-12-29 13:32:16 +08:00
Miku AuahDark d1f74df686 Don't set the intent to null, only set the intent data to null.
Issue #260.
2023-12-25 12:23:18 +08:00
Miku AuahDark c3ed3b454b Sanitize destination filename from content URI.
Fixes #257.
2023-12-23 13:08:00 +08:00
Miku AuahDark 8a3d635cdb LOVE Loader: Add missing FLAG_GRANT_READ_URI_PERMISSION flag. 2023-12-23 12:58:55 +08:00
Miku AuahDark a81931be2c Merge pull request #259 from marclurr/fix-embedding
Fix embedding
2023-12-10 17:57:26 +08:00
Mark 7a0068535b Remove unreachable code 2023-12-09 14:52:26 +00:00
Mark 034a6d6361 initialise needToCopyGameInArchive inside onCreate based on the value
of embed
2023-12-09 12:29:23 +00:00
12 changed files with 49 additions and 31 deletions
+25 -9
View File
@@ -5,41 +5,57 @@ on: [push, pull_request]
jobs:
build-android:
runs-on: ubuntu-latest
strategy:
matrix:
build_type: [Debug, Release]
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
submodules: true
- name: Setup Java 17
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
distribution: adopt-hotspot
java-version: 17
cache: gradle
- name: Build
run: bash ./gradlew assembleNormalRecord assembleEmbedRelease bundleNormalNoRecordRelease bundleEmbedRecordRelease bundleEmbedNoRecordRelease
- name: Build Normal Flavor
run: bash ./gradlew assembleNormalRecord${{ matrix.build_type }}
- name: Build Release-specific Binaries
if: ${{ matrix.build_type == 'Release' }}
run: bash ./gradlew assembleEmbedRelease bundleNormalNoRecordRelease bundleEmbedRecordRelease bundleEmbedNoRecordRelease
- name: Artifact (Normal debug APK)
uses: actions/upload-artifact@v3
if: ${{ matrix.build_type == 'Debug' }}
uses: actions/upload-artifact@v4
with:
name: love-android-debug.apk
path: app/build/outputs/apk/normalRecord/debug/app-normal-record-debug.apk
- name: Artifact (Normal unsigned APK)
uses: actions/upload-artifact@v3
if: ${{ matrix.build_type == 'Release' }}
uses: actions/upload-artifact@v4
with:
name: love-android.apk
path: app/build/outputs/apk/normalRecord/release/app-normal-record-release-unsigned.apk
- name: Artifact (Normal AAB w/o recording)
uses: actions/upload-artifact@v3
if: ${{ matrix.build_type == 'Release' }}
uses: actions/upload-artifact@v4
with:
name: love-android-ps.aab
path: app/build/outputs/bundle/normalNoRecordRelease/app-normal-noRecord-release.aab
- name: Artifact (Embed AAB)
uses: actions/upload-artifact@v3
if: ${{ matrix.build_type == 'Release' }}
uses: actions/upload-artifact@v4
with:
name: love-android-embed-record.aab
path: app/build/outputs/bundle/embedRecordRelease/app-embed-record-release.aab
- name: Artifact (Embed AAB w/o recording)
uses: actions/upload-artifact@v3
if: ${{ matrix.build_type == 'Release' }}
uses: actions/upload-artifact@v4
with:
name: love-android-embed.aab
path: app/build/outputs/bundle/embedNoRecordRelease/app-embed-noRecord-release.aab
- name: Artifact (Debug symbols)
uses: actions/upload-artifact@v4
with:
name: love-android-unstripped-debugsyms-${{ matrix.build_type }}
path: love/build/intermediates/library_jni
+1 -1
View File
@@ -1,5 +1,5 @@
Android Port of LÖVE, an awesome 2D game engine for Lua (http://love2d.org)
Copyright (c) 2006-2023 LOVE Development Team
Copyright (c) 2006-2024 LOVE Development Team
![Build Status](https://github.com/love2d/love-android/workflows/build/badge.svg)
+1 -1
View File
@@ -10,7 +10,7 @@ android {
applicationId project.properties["app.application_id"]
versionCode project.properties["app.version_code"].toInteger()
versionName project.properties["app.version_name"]
minSdk 16
minSdk 18
compileSdk 34
targetSdk 34
+2 -2
View File
@@ -8,8 +8,8 @@ app.name_byte_array=76,195,150,86,69,32,102,111,114,32,65,110,100,114,111,105,10
app.application_id=org.love2d.android
app.orientation=landscape
app.version_code=31
app.version_name=11.5
app.version_code=32
app.version_name=11.5a
# No need to modify anything past this line!
android.enableJetifier=false
+1 -1
View File
@@ -6,7 +6,7 @@ This distribution contains code from the following projects (full license text b
- LOVE
Website: https://love2d.org/
License: zlib
Copyright (c) 2006-2023 LOVE Development Team
Copyright (c) 2006-2024 LOVE Development Team
- ENet
Website: http://enet.bespin.org/index.html
+1 -1
View File
@@ -10,7 +10,7 @@ android {
ndkVersion '25.2.9519653'
defaultConfig {
minSdk 16
minSdk 18
compileSdk 34
targetSdk 34
externalNativeBuild {
@@ -1023,8 +1023,8 @@ public class SDLActivity extends Activity implements View.OnSystemUiVisibilityCh
/* No valid hint, nothing is explicitly allowed */
if (!is_portrait_allowed && !is_landscape_allowed) {
if (resizable) {
/* All orientations are allowed */
req = ActivityInfo.SCREEN_ORIENTATION_FULL_SENSOR;
/* All orientations are allowed, respecting user orientation lock setting */
req = ActivityInfo.SCREEN_ORIENTATION_FULL_USER;
} else {
/* Fixed window and nothing specified. Get orientation from w/h of created window */
req = (w > h ? ActivityInfo.SCREEN_ORIENTATION_SENSOR_LANDSCAPE : ActivityInfo.SCREEN_ORIENTATION_SENSOR_PORTRAIT);
@@ -1033,8 +1033,8 @@ public class SDLActivity extends Activity implements View.OnSystemUiVisibilityCh
/* At least one orientation is allowed */
if (resizable) {
if (is_portrait_allowed && is_landscape_allowed) {
/* hint allows both landscape and portrait, promote to full sensor */
req = ActivityInfo.SCREEN_ORIENTATION_FULL_SENSOR;
/* hint allows both landscape and portrait, promote to full user */
req = ActivityInfo.SCREEN_ORIENTATION_FULL_USER;
} else {
/* Use the only one allowed "orientation" */
req = (is_landscape_allowed ? orientation_landscape : orientation_portrait);
@@ -1,5 +1,5 @@
/**
* Copyright (c) 2006-2023 LOVE Development Team
* Copyright (c) 2006-2024 LOVE Development Team
*
* This software is provided 'as-is', without any express or implied
* warranty. In no event will the authors be held liable for any damages
@@ -114,10 +114,12 @@ public class GameActivity extends SDLActivity {
gamePath = "";
storagePermissionUnnecessary = false;
embed = getResources().getBoolean(R.bool.embed);
needToCopyGameInArchive = embed;
if (!embed) {
handleIntent(getIntent());
setIntent(null);
Intent intent = getIntent();
handleIntent(intent);
intent.setData(null);
}
super.onCreate(savedInstanceState);
@@ -171,6 +173,9 @@ public class GameActivity extends SDLActivity {
filename = pathSegments[pathSegments.length - 1];
}
// Sanitize filename to prevent PhysFS complaining later.
filename = filename.replaceAll("[^a-zA-Z0-9_\\\\-\\\\.]", "_");
String destination_file = this.getCacheDir().getPath() + "/" + filename;
InputStream data = getContentResolver().openInputStream(game);
@@ -200,11 +205,6 @@ public class GameActivity extends SDLActivity {
alert_dialog.setCancelable(false);
alert_dialog.create().show();
}
} else {
// No game specified via the intent data or embed build is used.
// Load game archive only when needed.
needToCopyGameInArchive = embed;
gamePath = "";
}
Log.d("GameActivity", "new gamePath: " + gamePath);
@@ -1,5 +1,5 @@
/**
* Copyright (c) 2006-2023 LOVE Development Team
* Copyright (c) 2006-2024 LOVE Development Team
*
* This software is provided 'as-is', without any express or implied
* warranty. In no event will the authors be held liable for any damages
@@ -1,5 +1,5 @@
/**
* Copyright (c) 2006-2023 LOVE Development Team
* Copyright (c) 2006-2024 LOVE Development Team
*
* This software is provided 'as-is', without any express or implied
* warranty. In no event will the authors be held liable for any damages
@@ -1,5 +1,5 @@
/**
* Copyright (c) 2006-2023 LOVE Development Team
* Copyright (c) 2006-2024 LOVE Development Team
*
* This software is provided 'as-is', without any express or implied
* warranty. In no event will the authors be held liable for any damages
@@ -48,8 +48,10 @@ public class SelectorActivity extends AppCompatActivity {
new ActivityResultContracts.OpenDocument(),
(Uri result) -> {
if (result != null) {
Intent intent = new Intent(SelectorActivity.this, GameActivity.class);
intent.setData(result);
intent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
startActivity(intent);
}