Move /sdcard/lovegame directory.

See love2d/love-android#194

This also mean that external storage permission is only requested only when running Marshmallow or earlier.
This commit is contained in:
Miku AuahDark
2020-10-02 21:17:22 +08:00
parent be561b9f3e
commit 98c2df2f52
6 changed files with 19 additions and 27 deletions
+3 -3
View File
@@ -5,9 +5,9 @@ android {
buildToolsVersion '30.0.2'
ndkVersion '21.3.6528147'
defaultConfig {
applicationId "org.love2d.android"
applicationId 'org.love2d.android'
versionCode 29
versionName "11.3a"
versionName '11.3a'
minSdkVersion 14
targetSdkVersion 30
}
@@ -27,7 +27,7 @@ android {
}
embed {
dimension 'mode'
applicationIdSuffix "embed"
applicationIdSuffix '.embed'
}
}
lintOptions {
+1 -5
View File
@@ -16,8 +16,4 @@
# public *;
#}
-keep class br.com.tapps.love.LoveActivity { *; }
-keepclassmembers class br.com.tapps.love.LoveActivity {
public com.naef.jnlua.LuaState createLuaState();
}
-keep class org.love2d.android.GameActivity { *; }
+1 -1
View File
@@ -4,7 +4,7 @@
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.VIBRATE"/>
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" android:maxSdkVersion="23" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" android:maxSdkVersion="28" />
<!-- OpenGL ES 2.0 -->
+6 -5
View File
@@ -1,5 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.6.1-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
#Thu Oct 01 16:43:18 SGT 2020
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.6.1-all.zip
+3 -3
View File
@@ -14,7 +14,7 @@ android {
compileSdkVersion 30
buildToolsVersion "30.0.2"
minSdkVersion 14
resValue "bool", "embed", "false"
resValue 'bool', 'embed', 'false'
externalNativeBuild {
ndkBuild {
arguments "-j4"
@@ -43,7 +43,7 @@ android {
}
embed {
dimension 'mode'
resValue "bool", "embed", "true"
resValue 'bool', 'embed', 'true'
}
}
sourceSets {
@@ -61,7 +61,7 @@ android {
}
externalNativeBuild {
ndkBuild {
path "src/jni/Android.mk"
path 'src/jni/Android.mk'
}
}
lintOptions {
@@ -229,17 +229,13 @@ public class GameActivity extends SDLActivity {
}
protected void checkLovegameFolder() {
// If no game.love was found fall back to the game in <external storage>/lovegame
// if using normal or playstore build
// If no game.love was found and embed flavor is not used, fall back to the game in
// <external storage>/Android/data/<package name>/games/lovegame
if (!embed) {
Log.d("GameActivity", "fallback to lovegame folder");
if (hasExternalStoragePermission()) {
File ext = Environment.getExternalStorageDirectory();
if ((new File(ext, "/lovegame/main.lua")).exists()) {
gamePath = ext.getPath() + "/lovegame/";
}
} else {
Log.d("GameActivity", "Cannot load game from /sdcard/lovegame: permission not granted");
File ext = getExternalFilesDir("games");
if ((new File(ext, "/lovegame/main.lua")).exists()) {
gamePath = ext.getPath() + "/lovegame/";
}
}
}
@@ -295,7 +291,6 @@ public class GameActivity extends SDLActivity {
} else {
Log.d("GameActivity", "cannot open game " + gamePath + ": no external storage permission given!");
}
} else {
self.checkLovegameFolder();
if (gamePath.length() > 0)