Forwarded from 𝓗𝓮
import android.content.Context;
import android.net.wifi.ScanResult;
import android.net.wifi.WifiManager;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
// 获取WifiManager实例
WifiManager wifiManager = (WifiManager) context.getSystemService(Context.WIFI_SERVICE);
// 获取扫描结果列表
List scanResults = wifiManager.getScanResults();
Set uniqueSSIDs = new HashSet();
// 使用Set来保证唯一性
for (ScanResult result : scanResults) {
String ssid = result.SSID;
if (ssid == null || ssid.isEmpty()) {
ssid = result.BSSID;
}
// 将SSID添加到Set中
uniqueSSIDs.add(ssid);
}
// 构建输出结果
StringBuilder wifiInfoBuilder = new StringBuilder();
for (String ssid : uniqueSSIDs) {
wifiInfoBuilder.append(ssid).append("\n");
}
String wifiInfo = wifiInfoBuilder.toString();
// 一次性输出结果
wifiInfo;
Forwarded from 𝓗𝓮
ShortX-广播宝典_丰富你的触发器.txt
196.8 KB
众所不周知,广播可以作为 ShortX 触发器之一,同时也支持获取传递的数据,用好了可以丰富 ShortX 触发器。
广播数据是从 Android 16类原生中提取,适用度比国产定制化系统要高,广播介绍均为AI翻译。
TRANSACTION_snoozeNotificationUntilFromListener → snoozeNotificationUntilFromListener(android.service.notification.INotificationListener, java.lang.String, long): void
TRANSACTION_unsnoozeNotificationFromSystemListener → unsnoozeNotificationFromSystemListener(android.service.notification.INotificationListener, java.lang.String): void
TRANSACTION_getSnoozedNotificationsFromListener → getSnoozedNotificationsFromListener(android.service.notification.INotificationListener, int): android.content.pm.ParceledListSlice
#通知隐藏
android.os.ServiceManager.getService("usb").isFunctionEnabled("adb");
/*
rndis → USB共享网络
none → 仅充电
mtp → 文件传输
ptp → 图片传输
adb → 设备调试
*/
// 检查USB功能是否启用(如adb、mtp)#MVEL表达式 #Javascript
🎯 核心发现
在澎湃OS(HyperOS)上,覆盖状态栏的唯一必需配置是:
if (android.os.Build.VERSION.SDK_INT >= 28) {
lp.layoutInDisplayCutoutMode = 1; // LAYOUT_IN_DISPLAY_CUTOUT_MODE_SHORT_EDGES
}
这个属性的作用:
Android 9 (API 28) 引入,用于处理刘海屏/挖孔屏
layoutInDisplayCutoutMode = 1 表示 LAYOUT_IN_DISPLAY_CUTOUT_MODE_SHORT_EDGES
允许窗口内容延伸到屏幕的短边刘海区域(包括状态栏)
在澎湃OS(HyperOS)上,覆盖状态栏的唯一必需配置是:
if (android.os.Build.VERSION.SDK_INT >= 28) {
lp.layoutInDisplayCutoutMode = 1; // LAYOUT_IN_DISPLAY_CUTOUT_MODE_SHORT_EDGES
}
这个属性的作用:
Android 9 (API 28) 引入,用于处理刘海屏/挖孔屏
layoutInDisplayCutoutMode = 1 表示 LAYOUT_IN_DISPLAY_CUTOUT_MODE_SHORT_EDGES
允许窗口内容延伸到屏幕的短边刘海区域(包括状态栏)
lp.layoutInDisplayCutoutMode = WindowManager.LayoutParams.LAYOUT_IN_DISPLAY_CUTOUT_MODE_SHORT_EDGES;
Forwarded from 𝓗𝓮
android.os.ServiceManager.getService("batterystats").setBatteryLevel(250, true);
// 伪装指定电量,强制更新#MVEL表达式 #Javascript
Forwarded from 𝓗𝓮
android.os.ServiceManager.getService("batterystats").unplugBattery(true);
//伪装成未充电#MVEL表达式 #Javascript
Forwarded from 𝓗𝓮
android.os.ServiceManager.getService("batterystats").resetBattery(true);
// 一键恢复伪装#MVEL表达式 #Javascript
Forwarded from 𝓗𝓮
Forwarded from 𝓗𝓮
android.os.ServiceManager.getService("statusbar").onClearAllNotifications(0);
// 清除指定用户的所有通知#MVEL表达式 #Javascript
Forwarded from 𝓗𝓮
android.os.ServiceManager.getService("location").isLocationEnabledForUser(0);
// 判断指定用户定位是否开启#MVEL表达式 #Javascript
Forwarded from 𝓗𝓮
android.os.ServiceManager.getService("bluetooth_manager").getState() == 12;
// 判断蓝牙是否开启#MVEL表达式 #Javascript
Forwarded from 𝓗𝓮
android.os.ServiceManager.getService("device_policy").setScreenCaptureDisabled(null, "android", true, false);
// 禁用屏幕截图#MVEL表达式 #Javascript
Forwarded from 𝓗𝓮
android.os.ServiceManager.getService("device_policy").setScreenCaptureDisabled(null, "android", false, false);
// 启用屏幕截图#MVEL表达式 #Javascript
Forwarded from 𝓗𝓮
android.os.ServiceManager.getService("device_policy").getScreenCaptureDisabled(null, 0, false);
// 判断屏幕截图是否禁用#MVEL表达式 #Javascript
Forwarded from 𝓗𝓮
Service = android.os.ServiceManager.getService("device_policy");
if (android.os.Build.VERSION.SDK_INT > 33) {
Service.getCurrentFailedPasswordAttempts("android", 0, true);
} else {
Service.getCurrentFailedPasswordAttempts(0, true);
}
// 获取锁屏密码错误次数#MVEL表达式 #Javascript
Forwarded from 𝓗𝓮
android.os.ServiceManager.getService("statusbar").getLastSystemKey();
// 获取最近按键事件的按键码#MVEL表达式 #Javascript
Forwarded from 𝓗𝓮
android.os.ServiceManager.getService("package").setBlockUninstallForUser("tornaco.apps.shortx", true, 0)
// 阻止指定用户指定包名的卸载#MVEL表达式 #Javascript
Forwarded from 𝓗𝓮
android.os.ServiceManager.getService("package").deleteApplicationCacheFilesAsUser("包名", 0, null)
// 清除指定用户的指定包名的缓存数据#MVEL表达式 #Javascript