Skip to content

Commit

Permalink
1. fix accessibility btn
Browse files Browse the repository at this point in the history
2. path FATJS_DIR -> fatjs
  • Loading branch information
jinjintao committed May 31, 2024
1 parent 862dff2 commit 769ba72
Show file tree
Hide file tree
Showing 9 changed files with 22 additions and 17 deletions.
Binary file removed app/libs/XposedBridgeAPI-89.jar
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -580,7 +580,7 @@ private void testMethod() {
// Test 1
TaskBase taskDemo = new TaskBase();
printLogMsg("run script " + checkedFileName, 0);
@SuppressLint("SdCardPath") String script_path = "/sdcard/FATJS_DIR/" + checkedFileName;
@SuppressLint("SdCardPath") String script_path = "/sdcard/fatjs/" + checkedFileName;
// printLogMsg("script_path => " + script_path, 0);
taskDemo.initJavet(script_path);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ public void onOAIDGetComplete(String result) {
Log.i(TAG, "guid: " + _guid);
Log.i(TAG, "supported: " + DeviceID.supportedOAID(context));
Log.i(TAG, "OAID/AAID: " + result);
FATJS_INFO += String.format("\n\npseudoID:\n%s\n\nguid:\n%s\n\nOAID/AAID:\n%s", pseudoID, guid, result);
//FATJS_INFO += String.format("\n\npseudoID:\n%s\n\nguid:\n%s\n\nOAID/AAID:\n%s", pseudoID, guid, result);
}
@Override
public void onOAIDGetError(Exception error) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,8 @@
public class GlobalVariableHolder {
public static boolean DEV_MODE = false; // FATJS 的开发者模式
public static V8Runtime v8Runtime;
public static final String PATH = "/FATJS_DIR/";
public static String FATJS_INFO = "author: 林笙\n\nwx: FATJS_Lin\n\nGitHub: FATJS";
public static String FATJS_INFO_HOME = "\n\n\n\n\n\n\n\n\n\nauthor: 林笙\n\nwx: FATJS_Lin\n\nGitHub: FATJS";
public static final String PATH = "/fatjs/";
public static String FATJS_INFO = "\n\n\n\n\n\n\n\n\n\nauthor: 林笙\n\nwx: FATJS_Lin\n\nGitHub: FATJS";
public static String ANDROID_ID = "";
public static String pseudoID = "";
public static String guid = "";
Expand Down Expand Up @@ -49,7 +48,7 @@ public class GlobalVariableHolder {
public static int float_x = 0;
public static int float_y = 0;

public static String tag = "FATJS_LOG";
public static String tag = "fatjslog";
// 停顿时长
public static final int waitHrefOfSecond = 500;
public static final int waitOneSecond = 1000;
Expand All @@ -72,11 +71,11 @@ public static void saveConfig() {
// 将JsonObject转换为字符串
String configString = jsonObject.toString();
printLogMsg(configString, 0);
FileUtils.writeToTxt("/sdcard/FATJS_DIR/config.json", configString);
FileUtils.writeToTxt("/sdcard/fatjs/config.json", configString);
}

public static void reviewConfig() {
String readFile = FileUtils.readFile("/sdcard/FATJS_DIR/config.json");
String readFile = FileUtils.readFile("/sdcard/fatjs/config.json");
if (StringUtils.isEmpty(readFile)) {
printLogMsg("reviewConfig empty", 0);
saveConfig();
Expand Down
3 changes: 2 additions & 1 deletion app/src/main/java/com/linsheng/FATJS/node/AccUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@

import com.linsheng.FATJS.config.GlobalVariableHolder;
import com.linsheng.FATJS.utils.ExceptionUtil;
import com.linsheng.FATJS.utils.StringUtils;

import java.io.IOException;
import java.io.InputStream;
Expand Down Expand Up @@ -402,7 +403,7 @@ public static Boolean isAccessibilityServiceOn() {
TextUtils.SimpleStringSplitter splitter = new TextUtils.SimpleStringSplitter(':');
if (enabled == 1) {
String settingValue = Settings.Secure.getString(context.getContentResolver(), Settings.Secure.ENABLED_ACCESSIBILITY_SERVICES);
if (settingValue != null) {
if (StringUtils.isNotEmpty(settingValue)) {
splitter.setString(settingValue);
while (splitter.hasNext()) {
String accessibilityService = splitter.next();
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/java/com/linsheng/FATJS/ntptime/NtpService.java
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public static long calibrationTimeTencent() {
index ++;
}
}
if (ntpTimeList.size() == 0) {
if (ntpTimeList.isEmpty()) {
return -1;
}
Log.i(TAG, "calibrationTime: index: " + index);
Expand Down Expand Up @@ -67,7 +67,7 @@ public static long calibrationTimeAli() {
index ++;
}
}
if (ntpTimeList.size() == 0) {
if (ntpTimeList.isEmpty()) {
return -1;
}
Log.i(TAG, "calibrationTime: index: " + index);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ private boolean accessibilityPermission() {
TextUtils.SimpleStringSplitter splitter = new TextUtils.SimpleStringSplitter(':');
if (enabled == 1) {
String settingValue = Settings.Secure.getString(GlobalVariableHolder.context.getContentResolver(), Settings.Secure.ENABLED_ACCESSIBILITY_SERVICES);
if (settingValue != null) {
if (StringUtils.isNotEmpty(settingValue)) {
splitter.setString(settingValue);
while (splitter.hasNext()) {
String accessibilityService = splitter.next();
Expand All @@ -245,10 +245,15 @@ private boolean accessibilityPermission() {
return true;
}
}
}else {
// 系统隐藏了无障碍应用列表
_accessibility = true;
switch_accessibility.setChecked(true);
printLogMsg("系统隐藏了无障碍应用列表,需自己判断无障碍权限是否授予", 0);
return true;
}
}
}catch (Exception ex){
ex.printStackTrace();
}catch (Exception e){
_accessibility = false;
switch_accessibility.setChecked(false);
printLogMsg("无障碍权限未授予", 0);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.linsheng.FATJS.ui.home;

import static com.linsheng.FATJS.config.GlobalVariableHolder.FATJS_INFO_HOME;
import static com.linsheng.FATJS.config.GlobalVariableHolder.FATJS_INFO;

import androidx.lifecycle.LiveData;
import androidx.lifecycle.MutableLiveData;
Expand All @@ -12,7 +12,7 @@ public class HomeViewModel extends ViewModel {

public HomeViewModel() {
mText = new MutableLiveData<>();
mText.setValue(FATJS_INFO_HOME);
mText.setValue(FATJS_INFO);
}

public LiveData<String> getText() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
import java.io.IOException;

public class ImageSaveUtil {
private static final String SD_PATH = Environment.getExternalStorageDirectory().getPath() + "/FATJS_DIR/";
private static final String SD_PATH = Environment.getExternalStorageDirectory().getPath() + "/fatjs/";

public static void saveBitmap2file(Bitmap bmp, Context context, String name) {
String savePath;
Expand Down

0 comments on commit 769ba72

Please sign in to comment.