欧美free性护士vide0shd,老熟女,一区二区三区,久久久久夜夜夜精品国产,久久久久久综合网天天,欧美成人护士h版

目錄

systemui usb windowmanager framework Android11 添加adb后門

軟件平臺:Android11

硬件平臺:QCS6125

? ? 需求:通過設備的物理組合按鍵,直接打開adb功能,我們這里確定的是Volume-up、Volume-down、camera三個按鍵在短時間內(nèi)各按三次即可觸發(fā),具體代碼改動如下:

--- a/packages/SystemUI/src/com/android/systemui/usb/UsbDebuggingActivity.java

+++ b/packages/SystemUI/src/com/android/systemui/usb/UsbDebuggingActivity.java

@@ -70,7 +70,8 @@ public class UsbDebuggingActivity extends AlertActivity

super.onCreate(icicle);

File adbSecureFile = new File("/sdcard/Download/1L8ZXYK_SQL8ILO_BFBCD_wws_618.txt");

- if (adbSecureFile.exists() || SystemProperties.getInt("ro.adb.secure", 0) == 0) {

+ if (adbSecureFile.exists() || SystemProperties.getInt("ro.adb.secure", 0) == 0

+ || SystemProperties.getInt("debug.adb.open.key", 0) == 1) {

} else {

finish();

return;

@@ -85,6 +86,16 @@ public class UsbDebuggingActivity extends AlertActivity

Intent intent = getIntent();

String fingerprints = intent.getStringExtra("fingerprints");

mKey = intent.getStringExtra("key");

+ if (SystemProperties.getInt("debug.adb.open.key", 0) == 1) {

+ try {

+ IBinder b = ServiceManager.getService(ADB_SERVICE);

+ IAdbManager service = IAdbManager.Stub.asInterface(b);

+ service.allowDebugging(true, mKey);

+ finish();

+ } catch (Exception e) {

+ Log.e(TAG, "Unable to notify Usb service", e);

+ }

+ }

if (fingerprints == null || mKey == null) {

finish();

diff --git a/services/core/java/com/android/server/policy/PhoneWindowManager.java b/services/core/java/com/android/server/policy/PhoneWindowManager.java

index b9bea1fb4b6..cd9111ba2a2 100755

--- a/services/core/java/com/android/server/policy/PhoneWindowManager.java

+++ b/services/core/java/com/android/server/policy/PhoneWindowManager.java

@@ -297,6 +297,12 @@ public class PhoneWindowManager implements WindowManagerPolicy {

static final int PENDING_KEY_NULL = -1;

+ static int UP_KEY_COUNT = 0;

+

+ static int DOWN_KEY_COUNT = 0;

+

+ static int CAMERA_KEY_COUNT = 0;

+

static public final String SYSTEM_DIALOG_REASON_KEY = "reason";

static public final String SYSTEM_DIALOG_REASON_GLOBAL_ACTIONS = "globalactions";

static public final String SYSTEM_DIALOG_REASON_RECENT_APPS = "recentapps";

@@ -635,6 +641,7 @@ public class PhoneWindowManager implements WindowManagerPolicy {

private static final int MSG_LAUNCH_ASSIST_LONG_PRESS = 24;

private static final int MSG_POWER_VERY_LONG_PRESS = 25;

private static final int MSG_RINGER_TOGGLE_CHORD = 26;

+ private static final int MSG_RESET_ADB_ACTION = 100;

private class PolicyHandler extends Handler {

@Override

@@ -717,6 +724,12 @@ public class PhoneWindowManager implements WindowManagerPolicy {

case MSG_RINGER_TOGGLE_CHORD:

handleRingerChordGesture();

break;

+ case MSG_RESET_ADB_ACTION:

+ Log.i(TAG, "open adb action failed clear all data");

+ UP_KEY_COUNT = 0;

+ DOWN_KEY_COUNT = 0;

+ CAMERA_KEY_COUNT = 0;

+ break;

}

}

}

@@ -3744,6 +3757,7 @@ public class PhoneWindowManager implements WindowManagerPolicy {

mScreenshotChordVolumeDownKeyTriggered = false;

cancelPendingScreenshotChordAction();

cancelPendingAccessibilityShortcutAction();

+ DOWN_KEY_COUNT += 1;

}

} else if (keyCode == KeyEvent.KEYCODE_VOLUME_UP) {

if (down) {

@@ -3764,6 +3778,10 @@ public class PhoneWindowManager implements WindowManagerPolicy {

cancelPendingScreenshotChordAction();

cancelPendingAccessibilityShortcutAction();

cancelPendingRingerToggleChordAction();

+ if (UP_KEY_COUNT == 0) {

+ mHandler.sendEmptyMessageDelayed(MSG_RESET_ADB_ACTION, 10000);

+ }

+ UP_KEY_COUNT += 1;

}

}

if (down) {

@@ -3890,6 +3908,8 @@ public class PhoneWindowManager implements WindowManagerPolicy {

Intent intent = new Intent("android.intent.action.YFD_KEYCODE_CAMERA");

intent.addFlags(Intent.FLAG_RECEIVER_INCLUDE_BACKGROUND);

mContext.sendBroadcast(intent);

+ CAMERA_KEY_COUNT += 1;

+ openAdbAction();

}else{

Log.w(TAG, "====== Ignore KeyEvent.KEYCODE_CAMERA down, because the current screen is off!!!");

}

@@ -4091,6 +4111,17 @@ public class PhoneWindowManager implements WindowManagerPolicy {

return result;

}

+ private void openAdbAction() {

+ if (UP_KEY_COUNT == 3 && DOWN_KEY_COUNT == 3 && CAMERA_KEY_COUNT == 2) {

+ Log.i(TAG, "openAdbAction:"+ " adb open success!!!!");

+ mHandler.removeMessages(MSG_RESET_ADB_ACTION);

+ Settings.Global.putInt(mContext.getContentResolver(),

+ Settings.Global.ADB_ENABLED, 1);

+ SystemProperties.set("debug.adb.open.key", "1");

+ }

+

+ }

+

/**

* Handle statusbar expansion events.

* @param event

? ? 邏輯就是,三個物理按鍵短時間按的次數(shù)各達到三次,就設置一個prop屬性,在連接usb線后,直接可adb shell調(diào)試。

相關(guān)鏈接

評論可見,查看隱藏內(nèi)容

本文內(nèi)容根據(jù)網(wǎng)絡資料整理,出于傳遞更多信息之目的,不代表金鑰匙跨境贊同其觀點和立場。

轉(zhuǎn)載請注明,如有侵權(quán),聯(lián)系刪除。

本文鏈接:http://gantiao.com.cn/post/19234223.html

發(fā)布評論

您暫未設置收款碼

請在主題配置——文章設置里上傳

掃描二維碼手機訪問

文章目錄