1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-08-01 17:38:41 +00:00

Android SDK 34 (#14892)

This commit is contained in:
rubenwardy 2024-08-01 23:13:13 +01:00 committed by GitHub
parent 26deb26f17
commit d566b0e280
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 30 additions and 13 deletions

View file

@ -1,17 +1,20 @@
apply plugin: 'com.android.application'
android {
compileSdkVersion 33
buildToolsVersion '33.0.2'
ndkVersion "$ndk_version"
defaultConfig {
applicationId 'net.minetest.minetest'
minSdkVersion 21
targetSdkVersion 33
compileSdk 34
targetSdkVersion 34
versionName "${versionMajor}.${versionMinor}.${versionPatch}"
versionCode project.versionCode
}
buildFeatures {
buildConfig true
}
// load properties
Properties props = new Properties()
def propfile = file('../local.properties')
@ -49,6 +52,7 @@ android {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
namespace 'net.minetest.minetest'
}
task prepareAssets() {

View file

@ -1,8 +1,7 @@
<?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="net.minetest.minetest"
android:installLocation="auto">
android:installLocation="auto">
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />

View file

@ -20,6 +20,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
package net.minetest.minetest;
import android.annotation.SuppressLint;
import android.app.NotificationChannel;
import android.app.NotificationManager;
import android.content.BroadcastReceiver;
@ -83,13 +84,18 @@ public class MainActivity extends AppCompatActivity {
}
};
@SuppressLint("UnspecifiedRegisterReceiverFlag")
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
IntentFilter filter = new IntentFilter(ACTION_UPDATE);
registerReceiver(myReceiver, filter);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
registerReceiver(myReceiver, filter, RECEIVER_NOT_EXPORTED);
} else {
registerReceiver(myReceiver, filter);
}
mProgressBar = findViewById(R.id.progressBar);
mTextView = findViewById(R.id.textView);

View file

@ -186,6 +186,7 @@ public class UnzipService extends IntentService {
private void publishProgress(@Nullable Notification.Builder notificationBuilder, @StringRes int message, int progress) {
Intent intentUpdate = new Intent(ACTION_UPDATE);
intentUpdate.setPackage(getPackageName());
intentUpdate.putExtra(ACTION_PROGRESS, progress);
intentUpdate.putExtra(ACTION_PROGRESS_MESSAGE, message);
if (!isSuccess)