function ff_拨号(telNum) {
let id = 0;// 0=卡1 | 1=卡2
importClass(android.content.Intent);
importClass(android.net.Uri);
importClass(android.content.Context);
importClass(android.telecom.TelecomManager);
let telecomManager = context.getSystemService(Context.TELECOM_SERVICE);
if (telecomManager != null) {
let phoneAccountHandleList = telecomManager.getCallCapablePhoneAccounts();
let intent = new Intent();
intent.setAction(Intent.ACTION_CALL);
intent.setData(Uri.parse("tel:" + telNum));
intent.putExtra(TelecomManager.EXTRA_PHONE_ACCOUNT_HANDLE, phoneAccountHandleList.get(id));
app.startActivity(intent);
}
}
function ff_读短信() {
let body = ''
try {
var uri = android.net.Uri.parse("content://sms/inbox"); // 短信内容的 URI
var cursor = context.getContentResolver().query(uri, null, null, null, null); // 获取短信的游标
if (cursor != null && cursor.moveToFirst()) {
var bodyIndex = cursor.getColumnIndex("body"); // 短信内容在游标中的索引
body = cursor.getString(bodyIndex); // 获取短信内容
}
cursor.close(); gg_sms = true
} catch (error) { toastLog('短信权限|未开启'); gg_sms = false; }
return body;
}