mirror of
https://github.com/love2d/love-android.git
synced 2026-08-15 15:51:20 +02:00
Compare commits
47 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 4c65fff4f8 | |||
| fe15119efc | |||
| ceae396832 | |||
| 5d8800f138 | |||
| 3fb8ead63d | |||
| dd6a211cdc | |||
| 007d258cb4 | |||
| b375d142fd | |||
| 871ceb314d | |||
| 4290c0b614 | |||
| 39bdc40087 | |||
| 9bdd400b00 | |||
| 12430bf8a7 | |||
| bb2e250575 | |||
| d0f7ff7085 | |||
| 85ac733fa4 | |||
| 3ad966dbe7 | |||
| fa88c64ceb | |||
| 9b340ae150 | |||
| b0420d94ca | |||
| 18d3e8e7cb | |||
| dcd27223bf | |||
| f585f05839 | |||
| e8e3eb3d1a | |||
| 44b0650f14 | |||
| d99f8ce8a5 | |||
| 5ba547b0cc | |||
| ba5dad82ba | |||
| d442728e01 | |||
| b09380d98b | |||
| b128cb6067 | |||
| 0a81d4e4ea | |||
| 9bcd419d92 | |||
| 46583c9fce | |||
| cf9a5311c7 | |||
| 30a2dafd69 | |||
| 7a5c5eb507 | |||
| 50192f4e4a | |||
| 7efdfefe74 | |||
| ce70a64606 | |||
| abfd0a7021 | |||
| 28f7c4a8db | |||
| c73f7fec23 | |||
| 7fd649271a | |||
| 8b72016703 | |||
| aab23aded7 | |||
| 590f733790 |
@@ -8,6 +8,8 @@ jobs:
|
|||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
build_type: [Debug, Release]
|
build_type: [Debug, Release]
|
||||||
|
env:
|
||||||
|
GRADLE_OPTS: "-Dorg.gradle.jvmargs='-Xmx4G'"
|
||||||
steps:
|
steps:
|
||||||
- name: Prepare Environment
|
- name: Prepare Environment
|
||||||
run: sudo apt-get update && curl -Lo kitware-archive.sh https://apt.kitware.com/kitware-archive.sh && sudo bash ./kitware-archive.sh
|
run: sudo apt-get update && curl -Lo kitware-archive.sh https://apt.kitware.com/kitware-archive.sh && sudo bash ./kitware-archive.sh
|
||||||
@@ -62,4 +64,4 @@ jobs:
|
|||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: love-android-unstripped-debugsyms-${{ matrix.build_type }}
|
name: love-android-unstripped-debugsyms-${{ matrix.build_type }}
|
||||||
path: love/build/intermediates/library_jni
|
path: app/build/intermediates/cxx
|
||||||
|
|||||||
+2
-2
@@ -1,8 +1,8 @@
|
|||||||
[submodule "app/src/main/cpp/love"]
|
[submodule "app/src/main/cpp/love"]
|
||||||
path = app/src/main/cpp/love
|
path = app/src/main/cpp/love
|
||||||
url = https://github.com/love2d/love
|
url = https://github.com/love2d/love
|
||||||
branch = 12.0-development
|
branch = main
|
||||||
[submodule "app/src/main/cpp/megasource"]
|
[submodule "app/src/main/cpp/megasource"]
|
||||||
path = app/src/main/cpp/megasource
|
path = app/src/main/cpp/megasource
|
||||||
url = https://github.com/love2d/megasource
|
url = https://github.com/love2d/megasource
|
||||||
branch = 12.x
|
branch = main
|
||||||
|
|||||||
+20
-14
@@ -6,28 +6,34 @@ plugins {
|
|||||||
|
|
||||||
android {
|
android {
|
||||||
namespace "org.love2d.android"
|
namespace "org.love2d.android"
|
||||||
ndkVersion "26.1.10909125"
|
ndkVersion '27.3.13750724'
|
||||||
|
|
||||||
defaultConfig {
|
defaultConfig {
|
||||||
applicationId project.properties["app.application_id"]
|
applicationId project.properties["app.application_id"]
|
||||||
versionCode project.properties["app.version_code"].toInteger()
|
versionCode project.properties["app.version_code"].toInteger()
|
||||||
versionName project.properties["app.version_name"]
|
versionName project.properties["app.version_name"]
|
||||||
minSdk 23
|
minSdk 23
|
||||||
compileSdk 34
|
compileSdk = 35
|
||||||
targetSdk 34
|
targetSdk 35
|
||||||
|
|
||||||
externalNativeBuild {
|
externalNativeBuild {
|
||||||
cmake {
|
cmake {
|
||||||
arguments "-DANDROID_STL=c++_shared"
|
arguments "-DANDROID_STL=c++_shared", "-DANDROID_SUPPORT_FLEXIBLE_PAGE_SIZES=1", "-DCMAKE_POLICY_VERSION_MINIMUM=3.5", "-DCMAKE_DISABLE_PRECOMPILE_HEADERS=ON", "-DCMAKE_BUILD_TYPE=RelWithDebInfo"
|
||||||
// https://issuetracker.google.com/issues/274493986
|
// https://issuetracker.google.com/issues/274493986
|
||||||
// Transitive shared library that's added through `add_dependencies` is not taken into
|
// Transitive shared library that's added through `add_dependencies` is not taken into
|
||||||
// account. This result in liboboe.so and libluajit.so not get included into the final
|
// account. This result in liboboe.so and libluajit.so not get included into the final
|
||||||
// APK. "love" target depends on LuaJIT, and OpenAL that depends on oboe::oboe. So,
|
// APK. "love" target depends on LuaJIT, and "OpenAL" target depends on oboe::oboe
|
||||||
// add "OpenAL" and "love" target.
|
// (which provides liboboe.so). So, add "OpenAL" and "love" target.
|
||||||
targets "love_android", "OpenAL", "love"
|
targets "love_android", "OpenAL", "love"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ndk {
|
||||||
|
//noinspection ChromeOsAbiSupport
|
||||||
|
abiFilters 'armeabi-v7a', 'arm64-v8a', 'x86_64'
|
||||||
|
debugSymbolLevel 'full'
|
||||||
|
}
|
||||||
|
|
||||||
def getAppName = {
|
def getAppName = {
|
||||||
def nameArray = project.properties["app.name_byte_array"]
|
def nameArray = project.properties["app.name_byte_array"]
|
||||||
def name = project.properties["app.name"]
|
def name = project.properties["app.name"]
|
||||||
@@ -118,7 +124,7 @@ android {
|
|||||||
sourceSets {
|
sourceSets {
|
||||||
main {
|
main {
|
||||||
java {
|
java {
|
||||||
srcDir 'src/main/cpp/megasource/libs/SDL2/android-project/app/src/main/java'
|
srcDir 'src/main/cpp/megasource/libs/SDL3/android-project/app/src/main/java'
|
||||||
srcDir 'src/main/java'
|
srcDir 'src/main/java'
|
||||||
srcDir 'src/main/cpp/love/src/libraries/luahttps/src/android/java'
|
srcDir 'src/main/cpp/love/src/libraries/luahttps/src/android/java'
|
||||||
srcDirs += retrieveAll3pModules()
|
srcDirs += retrieveAll3pModules()
|
||||||
@@ -162,14 +168,14 @@ android {
|
|||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
implementation 'androidx.appcompat:appcompat:1.6.1'
|
implementation 'androidx.appcompat:appcompat:1.7.0'
|
||||||
implementation 'com.google.android.material:material:1.9.0'
|
implementation 'com.google.android.material:material:1.12.0'
|
||||||
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
|
implementation 'androidx.constraintlayout:constraintlayout:2.2.0'
|
||||||
implementation 'androidx.navigation:navigation-fragment:2.7.3'
|
implementation 'androidx.navigation:navigation-fragment:2.8.5'
|
||||||
implementation 'androidx.navigation:navigation-ui:2.7.3'
|
implementation 'androidx.navigation:navigation-ui:2.8.5'
|
||||||
implementation 'androidx.recyclerview:recyclerview:1.3.1'
|
implementation 'androidx.recyclerview:recyclerview:1.3.2'
|
||||||
implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.1.0'
|
implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.1.0'
|
||||||
implementation 'com.google.oboe:oboe:1.7.0'
|
implementation 'com.google.oboe:oboe:1.9.3'
|
||||||
}
|
}
|
||||||
|
|
||||||
// We don't even use Kotlin. Why we have to care about it?
|
// We don't even use Kotlin. Why we have to care about it?
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<manifest
|
<manifest xmlns:tools="http://schemas.android.com/tools"
|
||||||
xmlns:android="http://schemas.android.com/apk/res/android">
|
xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
|
||||||
<uses-permission android:name="android.permission.INTERNET" />
|
<uses-permission android:name="android.permission.INTERNET" />
|
||||||
@@ -7,8 +7,10 @@
|
|||||||
<uses-permission android:name="android.permission.BLUETOOTH" />
|
<uses-permission android:name="android.permission.BLUETOOTH" />
|
||||||
<uses-permission android:name="android.permission.RECORD_AUDIO" />
|
<uses-permission android:name="android.permission.RECORD_AUDIO" />
|
||||||
|
|
||||||
<!-- OpenGL ES 2.0 -->
|
<!-- OpenGL ES 3.0 -->
|
||||||
<uses-feature android:glEsVersion="0x00020000" />
|
<uses-feature android:glEsVersion="0x00030000" />
|
||||||
|
<!-- Vulkan 1.1 -->
|
||||||
|
<uses-feature android:name="android.hardware.vulkan.version" android:version="0x401000" android:required="false" tools:targetApi="n" />
|
||||||
<!-- Touchscreen support -->
|
<!-- Touchscreen support -->
|
||||||
<uses-feature android:name="android.hardware.touchscreen" android:required="false" />
|
<uses-feature android:name="android.hardware.touchscreen" android:required="false" />
|
||||||
<!-- Game controller support -->
|
<!-- Game controller support -->
|
||||||
@@ -21,6 +23,7 @@
|
|||||||
<uses-feature android:name="android.hardware.audio.low_latency" android:required="false" />
|
<uses-feature android:name="android.hardware.audio.low_latency" android:required="false" />
|
||||||
<uses-feature android:name="android.hardware.audio.pro" android:required="false" />
|
<uses-feature android:name="android.hardware.audio.pro" android:required="false" />
|
||||||
|
|
||||||
|
|
||||||
<application
|
<application
|
||||||
android:allowBackup="true"
|
android:allowBackup="true"
|
||||||
android:icon="@drawable/love"
|
android:icon="@drawable/love"
|
||||||
@@ -33,6 +36,8 @@
|
|||||||
android:configChanges="orientation|screenSize|smallestScreenSize|screenLayout|keyboard|keyboardHidden|navigation"
|
android:configChanges="orientation|screenSize|smallestScreenSize|screenLayout|keyboard|keyboardHidden|navigation"
|
||||||
android:launchMode="singleInstance"
|
android:launchMode="singleInstance"
|
||||||
android:screenOrientation="${ORIENTATION}">
|
android:screenOrientation="${ORIENTATION}">
|
||||||
|
<!-- Allow app activity re-created -->
|
||||||
|
<meta-data android:name="SDL_ENV.SDL_ANDROID_ALLOW_RECREATE_ACTIVITY" android:value="1" />
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
<action android:name="android.intent.action.MAIN" />
|
<action android:name="android.intent.action.MAIN" />
|
||||||
<category android:name="android.intent.category.LAUNCHER" />
|
<category android:name="android.intent.category.LAUNCHER" />
|
||||||
|
|||||||
+1
-1
Submodule app/src/main/cpp/love updated: 1bdb5ded50...792690b73d
Submodule app/src/main/cpp/megasource updated: 2071a685a1...5118c13ca1
@@ -30,7 +30,6 @@ import android.graphics.Rect;
|
|||||||
import android.media.AudioManager;
|
import android.media.AudioManager;
|
||||||
import android.net.Uri;
|
import android.net.Uri;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.os.ParcelFileDescriptor;
|
|
||||||
import android.os.VibrationEffect;
|
import android.os.VibrationEffect;
|
||||||
import android.os.Vibrator;
|
import android.os.Vibrator;
|
||||||
import android.util.DisplayMetrics;
|
import android.util.DisplayMetrics;
|
||||||
@@ -77,10 +76,11 @@ public class GameActivity extends SDLActivity {
|
|||||||
protected String[] getLibraries() {
|
protected String[] getLibraries() {
|
||||||
return new String[]{
|
return new String[]{
|
||||||
"c++_shared",
|
"c++_shared",
|
||||||
"SDL2",
|
"SDL3",
|
||||||
"oboe",
|
"oboe",
|
||||||
"openal",
|
"openal",
|
||||||
"luajit",
|
"luajit",
|
||||||
|
"liblove",
|
||||||
"love",
|
"love",
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@@ -101,9 +101,9 @@ public class GameActivity extends SDLActivity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Intent intent = getIntent();
|
Intent intent = getIntent();
|
||||||
// Prevent SDL sending filedropped event. Let us do that instead.
|
|
||||||
setIntent(null);
|
|
||||||
handleIntent(intent, true);
|
handleIntent(intent, true);
|
||||||
|
// Prevent SDL sending filedropped event. Let us do that instead.
|
||||||
|
intent.setData(null);
|
||||||
|
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
|
|
||||||
@@ -214,12 +214,6 @@ public class GameActivity extends SDLActivity {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Keep
|
|
||||||
public boolean openURLFromLOVE(String url) {
|
|
||||||
Log.d(TAG, "opening url = " + url);
|
|
||||||
return openURL(url) == 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Keep
|
@Keep
|
||||||
public boolean hasBackgroundMusic() {
|
public boolean hasBackgroundMusic() {
|
||||||
AudioManager audioManager = (AudioManager) getSystemService(Context.AUDIO_SERVICE);
|
AudioManager audioManager = (AudioManager) getSystemService(Context.AUDIO_SERVICE);
|
||||||
@@ -329,11 +323,6 @@ public class GameActivity extends SDLActivity {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Keep
|
|
||||||
public int convertToFileDescriptor(String uri) {
|
|
||||||
return convertToFileDescriptor(Uri.parse(uri));
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getAudioSMP() {
|
public int getAudioSMP() {
|
||||||
int smp = 256;
|
int smp = 256;
|
||||||
AudioManager a = (AudioManager) getSystemService(Context.AUDIO_SERVICE);
|
AudioManager a = (AudioManager) getSystemService(Context.AUDIO_SERVICE);
|
||||||
@@ -359,12 +348,8 @@ public class GameActivity extends SDLActivity {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public boolean isNativeLibsExtracted() {
|
public boolean isNativeLibsExtracted() {
|
||||||
if (android.os.Build.VERSION.SDK_INT >= 23) {
|
ApplicationInfo appInfo = getApplicationInfo();
|
||||||
ApplicationInfo appInfo = getApplicationInfo();
|
return (appInfo.flags & ApplicationInfo.FLAG_EXTRACT_NATIVE_LIBS) != 0;
|
||||||
return (appInfo.flags & ApplicationInfo.FLAG_EXTRACT_NATIVE_LIBS) != 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void sendUriAsDroppedFile(Uri uri) {
|
public void sendUriAsDroppedFile(Uri uri) {
|
||||||
@@ -431,32 +416,14 @@ public class GameActivity extends SDLActivity {
|
|||||||
return map;
|
return map;
|
||||||
}
|
}
|
||||||
|
|
||||||
private int convertToFileDescriptor(Uri uri) {
|
|
||||||
int fd = -1;
|
|
||||||
|
|
||||||
try {
|
|
||||||
ParcelFileDescriptor pfd = getContentResolver().openFileDescriptor(uri, "r");
|
|
||||||
if (pfd == null) {
|
|
||||||
throw new RuntimeException("pfd is null");
|
|
||||||
}
|
|
||||||
|
|
||||||
fd = pfd.dup().detachFd();
|
|
||||||
pfd.close();
|
|
||||||
} catch (Exception e) {
|
|
||||||
Log.e(TAG, "Failed attempt to convert " + uri.toString() + " to file descriptor", e);
|
|
||||||
}
|
|
||||||
|
|
||||||
return fd;
|
|
||||||
}
|
|
||||||
|
|
||||||
private void processOpenGame(Uri game) {
|
private void processOpenGame(Uri game) {
|
||||||
String scheme = game.getScheme();
|
String scheme = game.getScheme();
|
||||||
String path = game.getPath();
|
String path = game.getPath();
|
||||||
|
|
||||||
if (scheme != null) {
|
if (scheme != null) {
|
||||||
if (scheme.equals("content")) {
|
if (scheme.equals("content")) {
|
||||||
// Convert the URI to file descriptor.
|
// Pass content URI as-is.
|
||||||
args = new String[]{"/love2d://fd/" + convertToFileDescriptor(game)};
|
args = new String[]{game.toString()};
|
||||||
} else if (scheme.equals("file")) {
|
} else if (scheme.equals("file")) {
|
||||||
// Regular file, pass as-is.
|
// Regular file, pass as-is.
|
||||||
args = new String[]{path};
|
args = new String[]{path};
|
||||||
|
|||||||
+1
-5
@@ -5,13 +5,9 @@ buildscript {
|
|||||||
mavenCentral()
|
mavenCentral()
|
||||||
}
|
}
|
||||||
dependencies {
|
dependencies {
|
||||||
classpath 'com.android.tools.build:gradle:8.1.1'
|
classpath 'com.android.tools.build:gradle:9.3.1'
|
||||||
|
|
||||||
// NOTE: Do not place your application dependencies here; they belong
|
// NOTE: Do not place your application dependencies here; they belong
|
||||||
// in the individual module build.gradle files
|
// in the individual module build.gradle files
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
task clean(type: Delete) {
|
|
||||||
delete rootProject.buildDir
|
|
||||||
}
|
|
||||||
+1
-1
@@ -14,6 +14,6 @@ app.version_name=12.0
|
|||||||
# No need to modify anything past this line!
|
# No need to modify anything past this line!
|
||||||
android.enableJetifier=false
|
android.enableJetifier=false
|
||||||
android.useAndroidX=true
|
android.useAndroidX=true
|
||||||
android.defaults.buildfeatures.buildconfig=true
|
|
||||||
android.nonTransitiveRClass=true
|
android.nonTransitiveRClass=true
|
||||||
android.nonFinalResIds=true
|
android.nonFinalResIds=true
|
||||||
|
android.dependency.useConstraints=true
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
distributionBase=GRADLE_USER_HOME
|
distributionBase=GRADLE_USER_HOME
|
||||||
distributionPath=wrapper/dists
|
distributionPath=wrapper/dists
|
||||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.1-bin.zip
|
distributionUrl=https\://services.gradle.org/distributions/gradle-9.5.0-bin.zip
|
||||||
networkTimeout=10000
|
networkTimeout=10000
|
||||||
zipStoreBase=GRADLE_USER_HOME
|
zipStoreBase=GRADLE_USER_HOME
|
||||||
zipStorePath=wrapper/dists
|
zipStorePath=wrapper/dists
|
||||||
|
|||||||
@@ -3,7 +3,6 @@ dependencyResolutionManagement {
|
|||||||
repositories {
|
repositories {
|
||||||
google()
|
google()
|
||||||
mavenCentral()
|
mavenCentral()
|
||||||
jcenter() // Warning: this repository is going to shut down soon
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
rootProject.name = "LÖVE for Android"
|
rootProject.name = "LÖVE for Android"
|
||||||
|
|||||||
Reference in New Issue
Block a user