Please install a file manager (#1640)
This commit is contained in:
parent
2787d3e331
commit
20d5a0afd4
|
|
@ -24,6 +24,7 @@ import static android.provider.Settings.ACTION_APPLICATION_DETAILS_SETTINGS;
|
||||||
|
|
||||||
import android.annotation.SuppressLint;
|
import android.annotation.SuppressLint;
|
||||||
import android.app.Activity;
|
import android.app.Activity;
|
||||||
|
import android.content.ActivityNotFoundException;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.content.SharedPreferences;
|
import android.content.SharedPreferences;
|
||||||
import android.content.pm.ApplicationInfo;
|
import android.content.pm.ApplicationInfo;
|
||||||
|
|
@ -254,12 +255,22 @@ public class ScopeAdapter extends EmptyStateRecyclerView.EmptyStateAdapter<Scope
|
||||||
preferences.edit().putBoolean("filter_denylist", item.isChecked()).apply();
|
preferences.edit().putBoolean("filter_denylist", item.isChecked()).apply();
|
||||||
} else if (itemId == R.id.backup) {
|
} else if (itemId == R.id.backup) {
|
||||||
LocalDateTime now = LocalDateTime.now();
|
LocalDateTime now = LocalDateTime.now();
|
||||||
fragment.backupLauncher.launch(String.format(LocaleDelegate.getDefaultLocale(),
|
try {
|
||||||
"%s_%s.lsp", module.getAppName(), now.toString()));
|
fragment.backupLauncher.launch(String.format(LocaleDelegate.getDefaultLocale(),
|
||||||
return true;
|
"%s_%s.lsp", module.getAppName(), now.toString()));
|
||||||
|
return true;
|
||||||
|
} catch (ActivityNotFoundException e) {
|
||||||
|
fragment.showHint(R.string.enable_documentui, true);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
} else if (itemId == R.id.restore) {
|
} else if (itemId == R.id.restore) {
|
||||||
fragment.restoreLauncher.launch(new String[]{"*/*"});
|
try {
|
||||||
return true;
|
fragment.restoreLauncher.launch(new String[]{"*/*"});
|
||||||
|
return true;
|
||||||
|
} catch (ActivityNotFoundException e) {
|
||||||
|
fragment.showHint(R.string.enable_documentui, true);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
} else if (!AppHelper.onOptionsItemSelected(item, preferences)) {
|
} else if (!AppHelper.onOptionsItemSelected(item, preferences)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -20,6 +20,7 @@
|
||||||
package org.lsposed.manager.ui.fragment;
|
package org.lsposed.manager.ui.fragment;
|
||||||
|
|
||||||
import android.annotation.SuppressLint;
|
import android.annotation.SuppressLint;
|
||||||
|
import android.content.ActivityNotFoundException;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.os.Handler;
|
import android.os.Handler;
|
||||||
import android.os.Looper;
|
import android.os.Looper;
|
||||||
|
|
@ -162,7 +163,11 @@ public class LogsFragment extends BaseFragment {
|
||||||
private void save() {
|
private void save() {
|
||||||
LocalDateTime now = LocalDateTime.now();
|
LocalDateTime now = LocalDateTime.now();
|
||||||
String filename = String.format(LocaleDelegate.getDefaultLocale(), "LSPosed_%s.zip", now.toString());
|
String filename = String.format(LocaleDelegate.getDefaultLocale(), "LSPosed_%s.zip", now.toString());
|
||||||
saveLogsLauncher.launch(filename);
|
try {
|
||||||
|
saveLogsLauncher.launch(filename);
|
||||||
|
} catch (ActivityNotFoundException e) {
|
||||||
|
showHint(R.string.enable_documentui, true);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
@ -200,7 +205,7 @@ public class LogsFragment extends BaseFragment {
|
||||||
|
|
||||||
@SuppressLint("NotifyDataSetChanged")
|
@SuppressLint("NotifyDataSetChanged")
|
||||||
void refresh(List<CharSequence> log) {
|
void refresh(List<CharSequence> log) {
|
||||||
runOnUiThread(() ->{
|
runOnUiThread(() -> {
|
||||||
isLoaded = true;
|
isLoaded = true;
|
||||||
this.log = log;
|
this.log = log;
|
||||||
notifyDataSetChanged();
|
notifyDataSetChanged();
|
||||||
|
|
|
||||||
|
|
@ -19,6 +19,7 @@
|
||||||
|
|
||||||
package org.lsposed.manager.ui.fragment;
|
package org.lsposed.manager.ui.fragment;
|
||||||
|
|
||||||
|
import android.content.ActivityNotFoundException;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.os.Build;
|
import android.os.Build;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
|
|
@ -176,9 +177,14 @@ public class SettingsFragment extends BaseFragment {
|
||||||
backup.setEnabled(installed);
|
backup.setEnabled(installed);
|
||||||
backup.setOnPreferenceClickListener(preference -> {
|
backup.setOnPreferenceClickListener(preference -> {
|
||||||
LocalDateTime now = LocalDateTime.now();
|
LocalDateTime now = LocalDateTime.now();
|
||||||
backupLauncher.launch(String.format(LocaleDelegate.getDefaultLocale(),
|
try {
|
||||||
"LSPosed_%s.lsp", now.toString()));
|
backupLauncher.launch(String.format(LocaleDelegate.getDefaultLocale(),
|
||||||
return true;
|
"LSPosed_%s.lsp", now.toString()));
|
||||||
|
return true;
|
||||||
|
} catch (ActivityNotFoundException e) {
|
||||||
|
parentFragment.showHint(R.string.enable_documentui, true);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -186,8 +192,13 @@ public class SettingsFragment extends BaseFragment {
|
||||||
if (restore != null) {
|
if (restore != null) {
|
||||||
restore.setEnabled(installed);
|
restore.setEnabled(installed);
|
||||||
restore.setOnPreferenceClickListener(preference -> {
|
restore.setOnPreferenceClickListener(preference -> {
|
||||||
restoreLauncher.launch(new String[]{"*/*"});
|
try {
|
||||||
return true;
|
restoreLauncher.launch(new String[]{"*/*"});
|
||||||
|
return true;
|
||||||
|
} catch (ActivityNotFoundException e) {
|
||||||
|
parentFragment.showHint(R.string.enable_documentui, true);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -229,4 +229,5 @@
|
||||||
<string name="sort_upgradable_first">Upgradable first</string>
|
<string name="sort_upgradable_first">Upgradable first</string>
|
||||||
<string name="overview">Overview</string>
|
<string name="overview">Overview</string>
|
||||||
<string name="create_shortcut_summary">Manually create parasitic manager shortcut</string>
|
<string name="create_shortcut_summary">Manually create parasitic manager shortcut</string>
|
||||||
|
<string name="enable_documentui">Please enable DocumentUI</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue