]> git.lizzy.rs Git - dragonfireclient.git/commitdiff
Update to Android target SDK 30 (#11746)
authorrubenwardy <rw@rubenwardy.com>
Sat, 27 Nov 2021 00:10:13 +0000 (00:10 +0000)
committerGitHub <noreply@github.com>
Sat, 27 Nov 2021 00:10:13 +0000 (00:10 +0000)
android/app/build.gradle
android/app/src/main/AndroidManifest.xml
android/app/src/main/java/net/minetest/minetest/MainActivity.java
android/app/src/main/java/net/minetest/minetest/UnzipService.java
android/native/build.gradle

index 234868f92108f279b446ea381e7f5602ae3d7605..e8ba9572204fe7e04da0eac0993694ef0459cab7 100644 (file)
@@ -1,12 +1,12 @@
 apply plugin: 'com.android.application'
 android {
-       compileSdkVersion 29
+       compileSdkVersion 30
        buildToolsVersion '30.0.3'
        ndkVersion "$ndk_version"
        defaultConfig {
                applicationId 'net.minetest.minetest'
                minSdkVersion 16
-               targetSdkVersion 29
+               targetSdkVersion 30
                versionName "${versionMajor}.${versionMinor}.${versionPatch}"
                versionCode project.versionCode
        }
index fa93e70696fa8bbf8c497809fc7ec942198eaa34..6ea677cb99ab859a0dd62e0e6f04f96067885aa7 100644 (file)
@@ -30,7 +30,8 @@
                        android:configChanges="orientation|keyboardHidden|navigation|screenSize"
                        android:maxAspectRatio="3.0"
                        android:screenOrientation="sensorLandscape"
-                       android:theme="@style/AppTheme">
+                       android:theme="@style/AppTheme"
+                       android:exported="true">
                        <intent-filter>
                                <action android:name="android.intent.action.MAIN" />
                                <category android:name="android.intent.category.LAUNCHER" />
@@ -44,7 +45,8 @@
                        android:launchMode="singleTask"
                        android:maxAspectRatio="3.0"
                        android:screenOrientation="sensorLandscape"
-                       android:theme="@style/AppTheme">
+                       android:theme="@style/AppTheme"
+                       android:exported="true">
                        <intent-filter>
                                <action android:name="android.intent.action.MAIN" />
                        </intent-filter>
index 56615fca7664987db941655516ed312222511174..b6567b4b75845de0f74d900219903fededff44c8 100644 (file)
@@ -101,7 +101,8 @@ public class MainActivity extends AppCompatActivity {
                mTextView = findViewById(R.id.textView);
                sharedPreferences = getSharedPreferences(SETTINGS, Context.MODE_PRIVATE);
 
-               if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M)
+               if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M &&
+                               Build.VERSION.SDK_INT < Build.VERSION_CODES.R)
                        checkPermission();
                else
                        checkAppVersion();
index b513a7fe0090f2113c5a5c15e0914fd4543c92d8..a61a491398422488910d542ff586f63c50659862 100644 (file)
@@ -32,6 +32,7 @@ import android.os.Environment;
 
 import androidx.annotation.NonNull;
 import androidx.annotation.Nullable;
+import androidx.annotation.RequiresApi;
 import androidx.annotation.StringRes;
 
 import java.io.File;
@@ -200,6 +201,10 @@ public class UnzipService extends IntentService {
         * Migrates user data from deprecated external storage to app scoped storage
         */
        private void migrate(Notification.Builder notificationBuilder, File newLocation) throws IOException {
+               if (Build.VERSION.SDK_INT >=  Build.VERSION_CODES.R) {
+                       return;
+               }
+
                File oldLocation = new File(Environment.getExternalStorageDirectory(), "Minetest");
                if (!oldLocation.isDirectory())
                        return;
index e37694f5be3d2935d1d3ab389babf3a33d504add..2ddc77135f7c6b01c33560a0735078adc1db6d34 100644 (file)
@@ -2,12 +2,12 @@ apply plugin: 'com.android.library'
 apply plugin: 'de.undercouch.download'
 
 android {
-       compileSdkVersion 29
+       compileSdkVersion 30
        buildToolsVersion '30.0.3'
        ndkVersion "$ndk_version"
        defaultConfig {
                minSdkVersion 16
-               targetSdkVersion 29
+               targetSdkVersion 30
                externalNativeBuild {
                        ndkBuild {
                                arguments '-j' + Runtime.getRuntime().availableProcessors(),