Fix crash on Android R Beta 2

This commit is contained in:
NekoInverter 2020-07-17 17:21:23 +08:00
parent 48a35b0eac
commit abf4c9b546
No known key found for this signature in database
GPG Key ID: 280D6CCCF95715F9
4 changed files with 18 additions and 11 deletions

View File

@ -27,15 +27,15 @@ android {
disable 'MissingTranslation' disable 'MissingTranslation'
disable 'ExtraTranslation' disable 'ExtraTranslation'
} }
compileSdkVersion 29 compileSdkVersion 30
buildToolsVersion "29.0.3" buildToolsVersion "30.0.1"
defaultConfig { defaultConfig {
applicationId "org.meowcat.edxposed.manager" applicationId "org.meowcat.edxposed.manager"
minSdkVersion 26 minSdkVersion 26
//noinspection OldTargetApi //noinspection OldTargetApi
targetSdkVersion 27 targetSdkVersion 27
versionCode 457050 versionCode 457060
versionName "4.5.7.5" versionName "4.5.7.6"
signingConfig signingConfigs.release signingConfig signingConfigs.release
} }
buildTypes { buildTypes {
@ -66,13 +66,13 @@ dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar']) implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'androidx.appcompat:appcompat:1.3.0-alpha01' implementation 'androidx.appcompat:appcompat:1.3.0-alpha01'
implementation 'androidx.browser:browser:1.2.0' implementation 'androidx.browser:browser:1.2.0'
implementation 'androidx.constraintlayout:constraintlayout:2.0.0-beta6' implementation 'androidx.constraintlayout:constraintlayout:2.0.0-beta8'
implementation "androidx.recyclerview:recyclerview:1.2.0-alpha03" implementation "androidx.recyclerview:recyclerview:1.2.0-alpha04"
implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.1.0-rc01' implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.1.0'
implementation 'com.github.bumptech.glide:glide:4.11.0' implementation 'com.github.bumptech.glide:glide:4.11.0'
implementation "com.github.topjohnwu.libsu:core:2.5.1" implementation "com.github.topjohnwu.libsu:core:2.5.1"
implementation 'com.google.android.gms:play-services-oss-licenses:17.0.0' implementation 'com.google.android.gms:play-services-oss-licenses:17.0.0'
implementation 'com.google.android.material:material:1.2.0-beta01' implementation 'com.google.android.material:material:1.3.0-alpha01'
implementation 'com.google.code.gson:gson:2.8.6' implementation 'com.google.code.gson:gson:2.8.6'
implementation 'com.takisoft.preferencex:preferencex:1.1.0' implementation 'com.takisoft.preferencex:preferencex:1.1.0'
implementation 'com.takisoft.preferencex:preferencex-colorpicker:1.1.0' implementation 'com.takisoft.preferencex:preferencex-colorpicker:1.1.0'

View File

@ -119,7 +119,7 @@ public class BaseActivity extends AppCompatActivity {
@Override @Override
public void onCreate(@Nullable Bundle savedInstanceState) { public void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
AppCompatDelegate.setDefaultNightMode(XposedApp.getPreferences().getInt("theme", 0)); AppCompatDelegate.setDefaultNightMode(XposedApp.getPreferences().getInt("theme", -1));
theme = getTheme(this) + getCustomTheme() + XposedApp.getPreferences().getBoolean("md2", false); theme = getTheme(this) + getCustomTheme() + XposedApp.getPreferences().getBoolean("md2", false);
} }

View File

@ -47,7 +47,14 @@ public class DownloadsUtil {
request.setTitle(b.title); request.setTitle(b.title);
request.setMimeType(b.mimeType.toString()); request.setMimeType(b.mimeType.toString());
request.setNotificationVisibility(Request.VISIBILITY_VISIBLE); request.setNotificationVisibility(Request.VISIBILITY_VISIBLE);
File destination = new File(context.getExternalCacheDir(), "/downloads/" + b.title + b.mimeType.getExtension()); File path = new File(context.getExternalCacheDir(), "downloads");
try {
if (!path.mkdirs()) return null;
}catch (Exception e) {
e.printStackTrace();
return null;
}
File destination = new File(path, b.title + b.mimeType.getExtension());
removeAllForLocalFile(context, destination); removeAllForLocalFile(context, destination);
request.setDestinationUri(Uri.fromFile(destination)); request.setDestinationUri(Uri.fromFile(destination));
DownloadManager dm = (DownloadManager) context.getSystemService(Context.DOWNLOAD_SERVICE); DownloadManager dm = (DownloadManager) context.getSystemService(Context.DOWNLOAD_SERVICE);

View File

@ -7,7 +7,7 @@ buildscript {
} }
dependencies { dependencies {
classpath 'com.android.tools.build:gradle:4.0.0' classpath 'com.android.tools.build:gradle:4.0.1'
classpath 'com.google.android.gms:oss-licenses-plugin:0.10.2' classpath 'com.google.android.gms:oss-licenses-plugin:0.10.2'
// NOTE: Do not place your application dependencies here; they belong // NOTE: Do not place your application dependencies here; they belong