Forwarded from 𝓗𝓮
com.android.internal.telephony.ITelephony.Stub.asInterface(android.os.ServiceManager.getService("phone")).getDataNetworkType("android", "") == 20;
// 判断当前SIM卡网络类型是否为5G#MVEL表达式 #Javascript
Forwarded from 𝓗𝓮
android.os.ServiceManager.getService("sensor_privacy").supportsSensorToggle(1, 2);
// 设备是否支持摄像头硬件开关
/*
(1, 传感器类型1/2)
1 - 麦克风使用权限
2 - 摄像头使用权限
*/#MVEL表达式 #Javascript
Forwarded from 𝓗𝓮
android.os.ServiceManager.getService("sensor_privacy").isToggleSensorPrivacyEnabled(1, 2);
// 获取摄像头传感器是否禁用
/*
(1, 传感器类型1/2)
1 - 麦克风使用权限
2 - 摄像头使用权限
*/#MVEL表达式 #Javascript
Forwarded from 𝓗𝓮
android.os.ServiceManager.getService("sensor_privacy").showSensorUseDialog(2);
/*
在关闭对应传感器的前提,手动弹一次“解锁传感器开关”的确认对话框
1 - 麦克风使用权限
2 - 摄像头使用权限
*/#MVEL表达式 #Javascript
Forwarded from 𝓗𝓮
android.os.ServiceManager.getService("sensor_privacy").isSensorPrivacyEnabled();
// 全局传感器隐私是否开启,ShortX 已存在该条件#MVEL表达式 #Javascript
Forwarded from 𝓗𝓮
android.os.ServiceManager.getService("sensor_privacy").setSensorPrivacy(true);
// 设置禁用全局传感器 true=关闭传感器,false=开启所有
// ShortX已存在该动作 #MVEL表达式 #Javascript
Forwarded from 𝓗𝓮
android.os.ServiceManager.getService("sensor_privacy").setToggleSensorPrivacy(0, 0, 1, true);
// 设置指定用户麦克风传感器使用权限
/*
(userId, source, sensor, true);
* userId:一般为 0
* source:来源,填0即可
* sensor:1=麦克风、2=摄像头
* enable:true=启用隐私保护,关闭传感器
* false = 开启传感器
*/#MVEL表达式 #Javascript
Forwarded from 𝓗𝓮
context.getSystemService("sensor_privacy").suppressSensorPrivacyReminders(1, true, 0)
// 设置指定用户麦克风隐私状态提示禁用弹窗
/*
(int sensor, boolean suppress, int userId)
sensor:1=麦克风、2=摄像头
suppress:true=屏蔽弹窗
*/#MVEL表达式 #Javascript
Forwarded from 𝓗𝓮
𝓗𝓮
android.os.ServiceManager.getService("sensor_privacy").isToggleSensorPrivacyEnabled(1, 2); // 获取摄像头传感器是否禁用 /* (1, 传感器类型1/2) 1 - 麦克风使用权限 2 - 摄像头使用权限 */ #MVEL表达式 #Javascript
android.os.ServiceManager.getService("sensor_privacy").isCombinedToggleSensorPrivacyEnabled(2);
/*
第二种方法
获取摄像头权限开关是否关闭
1 - 麦克风使用权限
2 - 摄像头使用权限
*/#MVEL表达式 #Javascript
Forwarded from 𝓗𝓮
/*
指定用户指定应用传感器管理
支持禁用、解除、查看,重置
*/
ServiceManager = android.os.ServiceManager;
ParcelFileDescriptor = android.os.ParcelFileDescriptor;
function runSensorCmd(args, userId) {
svc = ServiceManager.getService("sensorservice");
pin = ParcelFileDescriptor.createPipe();
pout = ParcelFileDescriptor.createPipe();
perr = ParcelFileDescriptor.createPipe();
pin[1].close();
// 如果有指定用户,添加 --user 参数
if (userId != undefined && userId != null) {
args.push("--user");
args.push(String(userId));
}
svc.shellCommand(
pin[0].getFileDescriptor(),
pout[1].getFileDescriptor(),
perr[1].getFileDescriptor(),
args,
null,
new android.os.ResultReceiver(null)
);
pout[1].close();
perr[1].close();
function read(p){
s = new android.os.ParcelFileDescriptor.AutoCloseInputStream(p[0]);
r = "";
b = java.lang.reflect.Array.newInstance(java.lang.Byte.TYPE, 1024);
n ="";
while((n = s.read(b)) > 0){
r += new java.lang.String(b, 0, n, "UTF-8");
}
return r;
}
result = read(pout) + read(perr);
result = result.trim();
if (args[0] == "get-uid-state") {
if (result.includes("idle")) return true;
if (result.includes("active")) return false;
return false;
}
return result;
}
// 1) 禁用(设置为 idle,相当于限制传感器)
// runSensorCmd(["set-uid-state", "包名", "idle"], 0);
// 2) 恢复 active(取消限制)
// runSensorCmd(["set-uid-state", "com.liuzh.deviceinfo", "active"], 0);
// 3) 查看状态
// true 已禁用 false 未禁用
runSensorCmd(["get-uid-state", "com.liuzh.deviceinfo"], 0);
// 4) 恢复默认(清除 override)
// runSensorCmd(["reset-uid-state", "包名"], 0);
// 该接口不会禁用摄像头和麦克风,下载类似设备信息APP测试效果
// Android 11-16已测试成功,其他版本未知
#Javascript
Forwarded from 𝓗𝓮
android.os.ServiceManager.getService("lock_settings").getPassword();
// 获取 Color 系统的锁屏密码,
/*
设置新密码后,需锁屏输入一次密码
Color16 不可用
*/#MVEL表达式 #Javascript
Forwarded from 𝓗𝓮
Intent = android.content.Intent;
ComponentName = android.content.ComponentName;
bgStreamIntent = new Intent();
bgStreamIntent.setComponent(new ComponentName("com.oplus.exsystemservice", "com.oplus.backgroundstream.RouteForegroundService"));
bgStreamIntent.setAction("oplus.intent.action.BACKGROUND_STREAM_SERVICE");
context.startService(bgStreamIntent);
// Color系统的听剧模式 | 后台挂机
// Color16 不可用
#MVEL表达式 #Javascript
Forwarded from 𝓗𝓮
Intent = android.content.Intent;
UserHandle = android.os.UserHandle;
lat = 39.909187;
// lat - 纬度
lon = 116.397463;
// lon - 经度
myIntent = Intent.parseUri('amapuri://openFeature?featureName=OnFootNavi&sourceApplication=null&lat=' + lat +'&lon=' + lon, 0);
myIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
// 指定用户启动
userHandle = UserHandle.of(0);
context.startActivityAsUser(myIntent, userHandle);
// 坐标拾取器 https://lbs.amap.com/tools/picker
// 指定用户高德地图 步行导航
#MVEL表达式 #Javascript
Forwarded from 𝓗𝓮
Intent = android.content.Intent;
UserHandle = android.os.UserHandle;
// ShortX自带高德地图骑行导航无法细分自行车或电动车,该接口可以
lat = 39.909187;
// lat - 纬度
lon = 116.397463;
// lon - 经度
rideType = "bike";
// 骑行类型,elebike 为电动车,bike 或留空为自行车。
myIntent = Intent.parseUri('amapuri://openFeature?featureName=OnRideNavi&rideType=' + rideType + '&sourceApplication=null&lat=' + lat +'&lon=' + lon, 0);
myIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
// 指定用户启动
userHandle = UserHandle.of(0);
context.startActivityAsUser(myIntent, userHandle);
// 坐标拾取器 https://lbs.amap.com/tools/picker
// 指定用户高德地图 自行车导航
#MVEL表达式 #Javascript
Forwarded from 𝓗𝓮
Intent = android.content.Intent;
UserHandle = android.os.UserHandle;
lat = 39.915119;
// lat - 纬度
lon = 116.403963;
// lon - 经度
coord_type = "bd09ll";
/*
坐标类型
bd09ll(百度经纬度坐标) //用百度坐标拾取器,可避免误差
bd09mc(百度墨卡托坐标)
gcj02(经国测局加密的坐标)
wgs84(gps获取的原始坐标)
*/
// 步行导航
myIntent = Intent.parseUri('baidumap://map/walknavi?destination=' + lat + ',' + lon + '&coord_type=' + coord_type + '&src=andr.baidu.openAPIdemo', 0);
myIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
// 指定用户启动
userHandle = UserHandle.of(0);
context.startActivityAsUser(myIntent, userHandle);
// 坐标拾取器 https://lbs.baidu.com/maptool/getpoint
// 指定用户百度地图 步行导航
#MVEL表达式 #Javascript
Forwarded from 𝓗𝓮
Intent = android.content.Intent;
UserHandle = android.os.UserHandle;
// ShortX自带的百度地图骑行导航无法正常使用,该接口可以
lat = 39.915119;
// lat - 纬度
lon = 116.403963;
// lon - 经度
coord_type = "bd09ll";
/*
坐标类型
bd09ll(百度经纬度坐标) //用百度坐标拾取器,可避免误差
bd09mc(百度墨卡托坐标)
gcj02(经国测局加密的坐标)
wgs84(gps获取的原始坐标)
*/
// 电动车导航
myIntent = Intent.parseUri('baidumap://map/bikenavi?destination=' + lat + ',' + lon + '&coord_type=' + coord_type + '&src=andr.baidu.openAPIdemo', 0);
myIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
// 指定用户启动
userHandle = UserHandle.of(0);
context.startActivityAsUser(myIntent, userHandle);
// 坐标拾取器 https://lbs.baidu.com/maptool/getpoint
// 指定用户百度地图 电动车导航
#MVEL表达式 #Javascript
Forwarded from 𝓗𝓮
function createTimestamp(year, month, day, hour, minute, second) {
Calendar = java.util.Calendar;
cal = Calendar.getInstance();
cal.set(year, month - 1, day, hour, minute, second);
cal.set(Calendar.MILLISECOND, 0);
return cal.getTimeInMillis();
}
// 示例为2023年12月25日 14点30分30秒
timestamp = createTimestamp(2023, 12, 25, 14, 30, 30);
android.os.ServiceManager.getService("alarm").setTime(timestamp);
// 设置系统时间#MVEL表达式 #Javascript
Forwarded from 𝓗𝓮
Settings = android.provider.Settings;
Settings.Global.putString(context.getContentResolver(), 'auto_time', 0);
Settings.Global.putString(context.getContentResolver(), 'auto_time', 1);
// 设置恢复系统时间
#MVEL表达式 #Javascript
Forwarded from 𝓗𝓮
next = android.os.ServiceManager.getService("alarm").getNextWakeFromIdleTime();
if (next >= 9000000000) {
"当前没有任何会唤醒设备的闹钟";
} else {
real = java.lang.System.currentTimeMillis() + next - android.os.SystemClock.elapsedRealtime();
new java.text.SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new java.util.Date(real));
}
// 获取下一次从Doze/空闲模式唤醒的时间#MVEL表达式 #Javascript
Forwarded from 𝓗𝓮
audioManager = context.getSystemService("audio");
// 获取指定音量类型的音量值并返回
function getVolumeInfo(context, streamType) {
volume = android.os.ServiceManager.getService("audio").getStreamVolume(streamType);
return volume;
}
getVolumeInfo(context, audioManager.STREAM_RING);
// 获取当前铃声音量
// 获取指定音量类型当前音量#MVEL表达式 #Javascript