shortx命令
1 subscriber
1 photo
1 file
5 links
Download Telegram
Forwarded from 𝓗𝓮
import android.app.ActivityManager;
import android.content.Context;
import android.app.ActivityManager.MemoryInfo;
import java.text.DecimalFormat;

// 创建DecimalFormat对象,指定格式
DecimalFormat df = new DecimalFormat("#.00");

// 获取ActivityManager服务
ActivityManager activityManager = (ActivityManager) context.getSystemService(Context.ACTIVITY_SERVICE);

MemoryInfo memoryInfo = new MemoryInfo();
activityManager.getMemoryInfo(memoryInfo);

// 获取可用内存大小
long availableMemory = memoryInfo.availMem;

// 将可用内存大小从字节转换为GB,并保留两位小数
String availableMemoryGB = df.format(availableMemory / (double) (1024 * 1024 * 1024));

// 输出可用内存大小(GB)
(availableMemoryGB + " GB");
Forwarded from 𝓗𝓮
import android.content.pm.ApplicationInfo;
import android.content.pm.PackageManager;
import java.util.ArrayList;
import java.util.List;

// 获取PackageManager实例,用于管理应用程序
PackageManager packageManager = context.getPackageManager();

String appName = "OwnDroid"; // 要查找的应用名称
List matchingPackageNames = new ArrayList();

List packages = packageManager.getInstalledApplications(PackageManager.GET_META_DATA);
// 获取所有已安装的应用程序信息列表

for (ApplicationInfo packageInfo : packages) {
String currentAppName = (String) packageManager.getApplicationLabel(packageInfo);
// 获取当前迭代的应用程序的标签名称

if (currentAppName != null && currentAppName.equals(appName)) {
matchingPackageNames.add(packageInfo.packageName); // 如果找到匹配的应用名称,则存储其包名
}
Thread.sleep(1); // 线程休眠1毫秒
}


// 使用StringBuilder来统一输出所有找到的包名
StringBuilder output = new StringBuilder();

for (String packageName : matchingPackageNames) {
output.append(packageName).append("\n");
}
// 在这里输出output
output;
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 𝓗𝓮
importClass(android.app.admin.DevicePolicyManager);
importClass(android.content.Context);

var dpm = context.getSystemService(Context.DEVICE_POLICY_SERVICE);

// 获取输错次数
var attempts = dpm.getCurrentFailedPasswordAttempts();
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
允许窗口内容延伸到屏幕的短边刘海区域(包括状态栏)
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 𝓗𝓮
android.os.ServiceManager.getService("batterystats").isCharging();
// 判断是否充电

#MVEL表达式 #Javascript
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