מדריך | מדריך | הוספת החלפת פרופילים ע"י לחיצה על סולמית ב -f21 pro - עם שורות קוד בלבד!
-
בס"ד
קודם כל, אם אתם לא יודעים איך לבצע את השינויים להלן, אז אל!
וכמובן על אחריותכם וכו'.אחרי הוספת הקוד, יהיה ניתן להחליף פרופילים (רגיל->רטט->שקט) במסך הבית ומסך הנעילה. אם מישהו רוצה רק למסך הנעילה שיכתוב בתגובות.
בmt manager:
system/system_ext-/priv-app/MtkSystemUI/MtkSystemUI.apk
בDEX EDITOR PLUS:
בCLASS:
com/android/systemui/statusbar/phone/NotificationShadeWindowViewController$2
להחליף את הMETHOD:
dispatchKeyEvent
עם זה:.method public dispatchKeyEvent(Landroid/view/KeyEvent;)Z .registers 12 # Changed from 11 to 12 registers .param p1, "event" # Landroid/view/KeyEvent; .line 346 invoke-virtual {p1}, Landroid/view/KeyEvent;->getAction()I move-result v0 const/4 v1, 0x0 const/4 v2, 0x1 if-nez v0, :cond_a move v0, v2 goto :goto_b :cond_a move v0, v1 .line 347 .local v0, "isDown":Z :goto_b invoke-virtual {p1}, Landroid/view/KeyEvent;->getKeyCode()I move-result v3 .line 349 .local v3, "keyCode":I const/16 v4, 0x12 if-ne v3, v4, :cond_8c # Changed to :cond_8c if-nez v0, :cond_8c # Changed to :cond_8c iget-object v4, p0, Lcom/android/systemui/statusbar/phone/NotificationShadeWindowViewController$2;->this$0:Lcom/android/systemui/statusbar/phone/NotificationShadeWindowViewController; invoke-static {v4}, Lcom/android/systemui/statusbar/phone/NotificationShadeWindowViewController;->access$300(Lcom/android/systemui/statusbar/phone/NotificationShadeWindowViewController;)Lcom/android/systemui/statusbar/phone/StatusBar; move-result-object v4 invoke-virtual {v4}, Lcom/android/systemui/statusbar/phone/StatusBar;->isDeviceInteractive()Z move-result v4 if-eqz v4, :cond_8c # Changed to :cond_8c # New keyguard check added here iget-object v4, p0, Lcom/android/systemui/statusbar/phone/NotificationShadeWindowViewController$2;->this$0:Lcom/android/systemui/statusbar/phone/NotificationShadeWindowViewController; invoke-static {v4}, Lcom/android/systemui/statusbar/phone/NotificationShadeWindowViewController;->access$300(Lcom/android/systemui/statusbar/phone/NotificationShadeWindowViewController;)Lcom/android/systemui/statusbar/phone/StatusBar; move-result-object v4 invoke-virtual {v4}, Lcom/android/systemui/statusbar/phone/StatusBar;->isKeyguardShowing()Z move-result v4 if-nez v4, :cond_2d goto/16 :goto_8c # Skip if not on keyguard .line 350 :cond_2d iget-object v4, p0, Lcom/android/systemui/statusbar/phone/NotificationShadeWindowViewController$2;->this$0:Lcom/android/systemui/statusbar/phone/NotificationShadeWindowViewController; invoke-static {v4}, Lcom/android/systemui/statusbar/phone/NotificationShadeWindowViewController;->access$200(Lcom/android/systemui/statusbar/phone/NotificationShadeWindowViewController;)Lcom/android/systemui/statusbar/phone/NotificationShadeWindowView; move-result-object v4 invoke-virtual {v4}, Landroid/widget/FrameLayout;->getContext()Landroid/content/Context; move-result-object v4 .line 351 .local v4, "context":Landroid/content/Context; const-string v5, "audio" invoke-virtual {v4, v5}, Landroid/content/Context;->getSystemService(Ljava/lang/String;)Ljava/lang/Object; move-result-object v5 check-cast v5, Landroid/media/AudioManager; .line 352 .local v5, "audioManager":Landroid/media/AudioManager; invoke-virtual {v5}, Landroid/media/AudioManager;->getRingerMode()I move-result v6 .line 354 .local v6, "currentMode":I const/4 v7, 0x2 if-ne v6, v7, :cond_4a .line 355 invoke-virtual {v5, v2}, Landroid/media/AudioManager;->setRingerMode(I)V goto/16 :goto_8b :cond_4a if-ne v6, v2, :cond_87 .line 359 invoke-virtual {v5, v7}, Landroid/media/AudioManager;->setRingerMode(I)V .line 360 invoke-virtual {v5, v1}, Landroid/media/AudioManager;->setRingerMode(I)V .line 362 const-string v8, "notification" invoke-virtual {v4, v8}, Landroid/content/Context;->getSystemService(Ljava/lang/String;)Ljava/lang/Object; move-result-object v8 check-cast v8, Landroid/app/NotificationManager; .line 364 .local v8, "notificationManager":Landroid/app/NotificationManager; invoke-virtual {v8, v2}, Landroid/app/NotificationManager;->setInterruptionFilter(I)V .line 366 const-wide/16 p0, 0x64 :try_start_5f invoke-static {p0, p1}, Ljava/lang/Thread;->sleep(J)V :try_end_62 .catch Ljava/lang/InterruptedException; {:try_start_5f .. :try_end_62} :catch_63 .line 368 goto :goto_64 .line 367 :catch_63 move-exception p0 .line 370 :goto_64 invoke-virtual {v5}, Landroid/media/AudioManager;->getRingerMode()I move-result p0 .line 371 .local p0, "newMode":I if-eqz p0, :cond_8b if-ne p0, v2, :cond_6f if-ne p0, v7, :cond_7c goto :goto_8b :cond_6f new-instance v0, Landroid/content/Intent; const-string v8, "com.custom.ringer.TOGGLE_RINGER" invoke-direct {v0, v8}, Landroid/content/Intent;-><init>(Ljava/lang/String;)V invoke-virtual {v4, v0}, Landroid/content/Context;->sendBroadcast(Landroid/content/Intent;)V new-instance v0, Landroid/content/Intent; const-string v8, "com.custom.ringer.TOGGLE_RINGER" invoke-direct {v0, v8}, Landroid/content/Intent;-><init>(Ljava/lang/String;)V invoke-virtual {v4, v0}, Landroid/content/Context;->sendBroadcast(Landroid/content/Intent;)V goto :goto_8b :cond_7c new-instance v0, Landroid/content/Intent; const-string v8, "com.custom.ringer.TOGGLE_RINGER" invoke-direct {v0, v8}, Landroid/content/Intent;-><init>(Ljava/lang/String;)V invoke-virtual {v4, v0}, Landroid/content/Context;->sendBroadcast(Landroid/content/Intent;)V .line 375 .end local v8 # "notificationManager":Landroid/app/NotificationManager; .end local p0 # "newMode":I .end local p1 # "event":Landroid/view/KeyEvent; goto :goto_8b .line 380 :cond_87 invoke-virtual {v5, v7}, Landroid/media/AudioManager;->setRingerMode(I)V goto :goto_8b .line 389 .end local v4 # "context":Landroid/content/Context; .end local v5 # "audioManager":Landroid/media/AudioManager; .end local v6 # "currentMode":I :cond_8b :goto_8b return v2 .line 389 :cond_8c # New label for skipped cases :goto_8c const/4 v4, 0x4 if-eq v3, v4, :cond_db const/16 v4, 0x3e if-eq v3, v4, :cond_cd const/16 v4, 0x52 if-eq v3, v4, :cond_c0 const/16 v0, 0x18 if-eq v3, v0, :cond_a0 const/16 v0, 0x19 if-eq v3, v0, :cond_a0 goto :goto_da .line 365 :cond_a0 iget-object v0, p0, Lcom/android/systemui/statusbar/phone/NotificationShadeWindowViewController$2;->this$0:Lcom/android/systemui/statusbar/phone/NotificationShadeWindowViewController; invoke-static {v0}, Lcom/android/systemui/statusbar/phone/NotificationShadeWindowViewController;->access$1400(Lcom/android/systemui/statusbar/phone/NotificationShadeWindowViewController;)Lcom/android/systemui/statusbar/SysuiStatusBarStateController; move-result-object v0 invoke-interface {v0}, Lcom/android/systemui/plugins/statusbar/StatusBarStateController;->isDozing()Z move-result v0 if-eqz v0, :cond_da .line 366 iget-object p0, p0, Lcom/android/systemui/statusbar/phone/NotificationShadeWindowViewController$2;->this$0:Lcom/android/systemui/statusbar/phone/NotificationShadeWindowViewController; invoke-static {p0}, Lcom/android/systemui/statusbar/phone/NotificationShadeWindowViewController;->access$200(Lcom/android/systemui/statusbar/phone/NotificationShadeWindowViewController;)Lcom/android/systemui/statusbar/phone/NotificationShadeWindowView; move-result-object p0 invoke-virtual {p0}, Landroid/widget/FrameLayout;->getContext()Landroid/content/Context; move-result-object p0 invoke-static {p0}, Landroid/media/session/MediaSessionLegacyHelper;->getHelper(Landroid/content/Context;)Landroid/media/session/MediaSessionLegacyHelper; move-result-object p0 const/high16 v0, -0x80000000 .line 367 invoke-virtual {p0, p1, v0, v2}, Landroid/media/session/MediaSessionLegacyHelper;->sendVolumeKeyEvent(Landroid/view/KeyEvent;IZ)V return v2 :cond_c0 if-nez v0, :cond_da .line 355 iget-object p0, p0, Lcom/android/systemui/statusbar/phone/NotificationShadeWindowViewController$2;->this$0:Lcom/android/systemui/statusbar/phone/NotificationShadeWindowViewController; invoke-static {p0}, Lcom/android/systemui/statusbar/phone/NotificationShadeWindowViewController;->access$300(Lcom/android/systemui/statusbar/phone/NotificationShadeWindowViewController;)Lcom/android/systemui/statusbar/phone/StatusBar; move-result-object p0 invoke-virtual {p0}, Lcom/android/systemui/statusbar/phone/StatusBar;->onMenuPressed()Z move-result p0 return p0 :cond_cd if-nez v0, :cond_da .line 360 iget-object p0, p0, Lcom/android/systemui/statusbar/phone/NotificationShadeWindowViewController$2;->this$0:Lcom/android/systemui/statusbar/phone/NotificationShadeWindowViewController; invoke-static {p0}, Lcom/android/systemui/statusbar/phone/NotificationShadeWindowViewController;->access$300(Lcom/android/systemui/statusbar/phone/NotificationShadeWindowViewController;)Lcom/android/systemui/statusbar/phone/StatusBar; move-result-object p0 invoke-virtual {p0}, Lcom/android/systemui/statusbar/phone/StatusBar;->onSpacePressed()Z move-result p0 return p0 :cond_da :goto_da return v1 :cond_db if-nez v0, :cond_e6 .line 350 iget-object p0, p0, Lcom/android/systemui/statusbar/phone/NotificationShadeWindowViewController$2;->this$0:Lcom/android/systemui/statusbar/phone/NotificationShadeWindowViewController; invoke-static {p0}, Lcom/android/systemui/statusbar/phone/NotificationShadeWindowViewController;->access$300(Lcom/android/systemui/statusbar/phone/NotificationShadeWindowViewController;)Lcom/android/systemui/statusbar/phone/StatusBar; move-result-object p0 invoke-virtual {p0}, Lcom/android/systemui/statusbar/phone/StatusBar;->onBackPressed()Z :cond_e6 return v2 .end method
בCLASS:
com/android/systemui/statusbar/phone/qs/tiles/RingerModeTile
בתוך הMETHOD:
handleSetListening
להוסיף לפני line 92. את השורה:.line 90 new-instance p1, Landroid/content/IntentFilter; invoke-direct {p1}, Landroid/content/IntentFilter;-><init>()V const-string v0, "android.media.RINGER_MODE_CHANGED" .line 91 invoke-virtual {p1, v0}, Landroid/content/IntentFilter;->addAction(Ljava/lang/String;)V # להוסיף את השורה הזו const-string v0, "com.custom.ringer.TOGGLE_RINGER" invoke-virtual {p1, v0}, Landroid/content/IntentFilter;->addAction(Ljava/lang/String;)V # עד כאן .line 92 invoke-virtual {p0}, Lcom/android/systemui/qs/tileimpl/QSTileImpl;->getHost()Lcom/android/systemui/qs/QSHost;
בCLASS:
com/android/systemui/statusbar/phone/qs/tiles/RingerModeTile$1
להחליף את הMETHOD:
onReceive
עם זה:.method public onReceive(Landroid/content/Context;Landroid/content/Intent;)V .registers 5 .line 101 invoke-virtual {p2}, Landroid/content/Intent;->getAction()Ljava/lang/String; move-result-object p1 const-string v0, "com.custom.ringer.TOGGLE_RINGER" invoke-virtual {v0, p1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z move-result v0 if-eqz v0, :cond_15 .line 102 iget-object p0, p0, Lcom/android/systemui/qs/tiles/RingerModeTile$1;->this$0:Lcom/android/systemui/qs/tiles/RingerModeTile; invoke-virtual {p0}, Lcom/android/systemui/qs/tiles/RingerModeTile;->handleClick()V return-void :cond_15 const-string v0, "android.media.RINGER_MODE_CHANGED" invoke-virtual {v0, p1}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z move-result p1 if-eqz p1, :cond_23 .line 106 iget-object p0, p0, Lcom/android/systemui/qs/tiles/RingerModeTile$1;->this$0:Lcom/android/systemui/qs/tiles/RingerModeTile; invoke-virtual {p0}, Lcom/android/systemui/qs/tileimpl/QSTileImpl;->refreshState()V :cond_23 return-void .end method
לשמור (בלי לחתום כמובן).
system/system_ext-/priv-app/Launcher3QuickStep/Launcher3QuickStep.apk
בDEX EDITOR PLUS:
בCLASS:
com/android/launcher3/util/KeyCodeEventUtil
בתוך הMETHOD:
longPressKeyEventForMainActivity
להוסיף מתחת לשורות:.line 179 :pswitch_f #0x12
את זה:
const-string v1, "audio" invoke-virtual {p0, v1}, Landroid/content/Context;->getSystemService(Ljava/lang/String;)Ljava/lang/Object; move-result-object v1 check-cast v1, Landroid/media/AudioManager; invoke-virtual {v1}, Landroid/media/AudioManager;->getRingerMode()I move-result v2 const/4 v3, 0x2 const/4 v4, 0x1 const/4 v5, 0x0 if-ne v2, v3, :cond_24 invoke-virtual {v1, v4}, Landroid/media/AudioManager;->setRingerMode(I)V goto :goto_6a :cond_24 if-ne v2, v4, :cond_67 invoke-virtual {v1, v3}, Landroid/media/AudioManager;->setRingerMode(I)V invoke-virtual {v1, v5}, Landroid/media/AudioManager;->setRingerMode(I)V const-string v2, "notification" invoke-virtual {p0, v2}, Landroid/content/Context;->getSystemService(Ljava/lang/String;)Ljava/lang/Object; move-result-object v2 check-cast v2, Landroid/app/NotificationManager; invoke-virtual {v2, v4}, Landroid/app/NotificationManager;->setInterruptionFilter(I)V const-wide v6, 0x64 :try_start_3c invoke-static {v6, v7}, Ljava/lang/Thread;->sleep(J)V :try_end_3f .catch Ljava/lang/InterruptedException; {:try_start_3c .. :try_end_3f} :catch_3f :catch_3f invoke-virtual {v1}, Landroid/media/AudioManager;->getRingerMode()I move-result v2 if-nez v2, :cond_46 goto :goto_6a :cond_46 if-ne v2, v4, :cond_4b const-string v3, "su 0 u:r:su:s0 -c sh -c \"/system/bin/service call statusbar 1; /system/bin/sleep 0.1; /system/bin/am broadcast -a com.custom.ringer.TOGGLE_RINGER -p com.android.systemui; /system/bin/service call statusbar 2\"" goto :goto_4d :cond_4b const-string v3, "su 0 u:r:su:s0 -c sh -c \"/system/bin/service call statusbar 1; /system/bin/sleep 0.1; /system/bin/am broadcast -a com.custom.ringer.TOGGLE_RINGER -p com.android.systemui; /system/bin/am broadcast -a com.custom.ringer.TOGGLE_RINGER -p com.android.systemui; /system/bin/service call statusbar 2\"" :goto_4d invoke-static {}, Ljava/lang/Runtime;->getRuntime()Ljava/lang/Runtime; move-result-object v2 invoke-virtual {v2, v3}, Ljava/lang/Runtime;->exec(Ljava/lang/String;)Ljava/lang/Process; move-result-object v2 invoke-virtual {v2}, Ljava/lang/Process;->waitFor()I move-result v2 if-nez v2, :cond_5c goto :goto_6a :cond_5c const-string v2, "החלף באופן ידני ונסה שוב" const/4 v3, 0x1 invoke-static {p0, v2, v3}, Landroid/widget/Toast;->makeText(Landroid/content/Context;Ljava/lang/CharSequence;I)Landroid/widget/Toast; move-result-object v2 invoke-virtual {v2}, Landroid/widget/Toast;->show()V goto :goto_6a :cond_67 invoke-virtual {v1, v3}, Landroid/media/AudioManager;->setRingerMode(I)V :goto_6a
לשמור (וכנ"ל).
בהגדרות->הודעות ויישומים->מתקדם->גישה מיוחדת לאפליקציות->נא לא להפריע לגישה->Quickstep: לתת הרשאה שיהיה מותר.
להפעיל מחדש.
מי שרוצה להכין מדריך יותר מפורט יבורך, אין לי כ"כ זמן.
בהצלחה!