6.1.1 - 新增应用更新功能 修复编辑器页面/安卓10存储权限 异常消息资源化

This commit is contained in:
SuperMonster003
2022-05-31 21:23:36 +08:00
parent f68ad1c993
commit 069932c8d3
93 changed files with 2094 additions and 680 deletions

View File

@@ -58,6 +58,8 @@ dependencies {
// AppCompat
api 'androidx.appcompat:appcompat:1.4.1'
api 'org.kohsuke:github-api:1.306'
// AppCompat for legacy views (such as JsTextViewLegacy)
api project(':libs:androidx.appcompat-1.0.2')

View File

@@ -22,11 +22,16 @@ public class GlobalAppContext {
}
public static Context get() {
if (sApplicationContext == null)
if (sApplicationContext == null) {
throw new IllegalStateException("Call GlobalAppContext.set() to set a application context");
}
return sApplicationContext;
}
public static String getString(int resId, Object... formatArgs) {
return get().getString(resId, formatArgs);
}
public static String getString(int resId) {
return get().getString(resId);
}

View File

@@ -295,7 +295,7 @@ public class PFiles {
list = manager.list(assetsDir);
}
if (list == null)
throw new IOException("not a directory: " + assetsDir);
throw new IOException("Not a directory: " + assetsDir);
for (String file : list) {
if (TextUtils.isEmpty(file)) {
continue;
@@ -398,7 +398,7 @@ public class PFiles {
public static boolean deleteFilesOfDir(File dir) {
if (!dir.isDirectory())
throw new IllegalArgumentException("not a directory: " + dir);
throw new IllegalArgumentException("Not a directory: " + dir);
File[] children = dir.listFiles();
if (children != null) {
for (File child : children) {

View File

@@ -1,18 +0,0 @@
package com.stardust.util;
public class ObjectHelper {
public static void requireNonNull(Object obj, String name){
if(obj == null){
throw new NullPointerException(name + " should not be null");
}
}
public static void requireNonNull(Object obj){
if(obj == null){
throw new NullPointerException();
}
}
}

View File

@@ -45,4 +45,5 @@
<string name="text_script_running">Script running</string>
<string name="text_stable_mode">Stable mode</string>
<string name="text_use_volume_to_stop_running">Use volume up key to stop all running scripts</string>
<string name="error_illegal_argument">Illegal argument %s: %s</string>
</resources>

View File

@@ -46,4 +46,5 @@
<string name="text_script_running">脚本运行</string>
<string name="text_stable_mode">稳定模式</string>
<string name="text_use_volume_to_stop_running">使用 \"音量加\" 键停止所有运行的脚本</string>
<string name="error_illegal_argument">不合法的参数 %s: %s</string>
</resources>

View File

@@ -30,6 +30,7 @@
<string name="key_enable_a11y_service_with_secure_settings" translatable="false">key_enable_a11y_service_with_secure_settings</string>
<string name="key_stable_mode" translatable="false">key_stable_mode</string>
<string name="key_use_volume_control_running" translatable="false">key_use_volume_control_running</string>
<string name="key_auto_check_for_updates" translatable="false">key_auto_check_for_updates</string>
<string name="summary_enable_a11y_service_with_root_access">Enable accessibility service with root access automatically when needed</string>
<string name="summary_enable_a11y_service_with_secure_settings">Enable accessibility service with secure settings automatically when needed</string>
<string name="summary_stable_mode">More stable layout analysis but worse code compatibility (a11y service restarting needed)</string>
@@ -51,4 +52,5 @@
<string name="text_script_running">Script running</string>
<string name="text_stable_mode">Stable mode</string>
<string name="text_use_volume_to_stop_running">Use volume up key to stop all running scripts</string>
<string name="error_illegal_argument">Illegal argument %s: %s</string>
</resources>