function foreverAcc(mContext){
importClass(android.content.Context);
importClass(android.provider.Settings);
try {
var packageName = mContext.getPackageName();
var enabledServices = Settings.Secure.getString(mContext.getContentResolver(), Settings.Secure.ENABLED_ACCESSIBILITY_SERVICES);
logd(‘当前已启用的辅助服务’+enabledServices);
//var Services = enabledServices + “:org.autojs.autojspro/com.stardust.autojs.core.accessibility.AccessibilityService”;
var Services = enabledServices + “:” + packageName + “/com.gibb.WebService”;
Settings.Secure.putString(mContext.getContentResolver(), Settings.Secure.ENABLED_ACCESSIBILITY_SERVICES, Services);
Settings.Secure.putString(mContext.getContentResolver(), Settings.Secure.ACCESSIBILITY_ENABLED, ‘1’);
toast(“已加载播放插件”);
} catch (error) {
//授权方法:开启usb调试并使用adb工具连接手机,执行 adb shell pm grant org.autojs.autojspro android.permission.WRITE_SECURE_SETTING
toast(“\n请确保已给予 WRITE_SECURE_SETTINGS 权限\n\n授权代码已复制,请使用adb工具连接手机执行(重启不失效)\n\nadb shell pm grant " + packageName + " android.permission.WRITE_SECURE_SETTINGS”, error);
utils.setClipboardText(“adb shell pm grant " + packageName + " android.permission.WRITE_SECURE_SETTINGS”);
}
}
ec自己打开无障碍
最新推荐文章于 2024-04-10 17:41:04 发布