Saturday, May 11, 2019

Guide add screenshot toggle in QS panel



Screenshot toggle in QS panel



Tested on A75A* sc7731

ok, let's start

1. Decompile your SystemUI.apk

2. Merge all files

3. Open QSTileHost.smali

4. Search this method



.method private createTile(Ljava/lang/String;)Lcom/android/systemui/qs/QSTile;

5. Scroll down and you can found this line


.line 290
:cond_c
const-string v0, "intent("

invoke-virtual {p1, v0}, Ljava/lang/String;->startsWith(Ljava/lang/String;)Z

move-result v0

if-eqz v0, :cond_d

invoke-static {p0, p1}, Lcom/android/systemui/qs/tiles/IntentTile;->create(Lcom/android/systemui/qs/QSTile$Host;Ljava/lang/String;)Lcom/android/systemui/qs/QSTile;

move-result-object v0

goto/16 :goto_0
   
6. Add this line above that, compare mine.


.line 278
:cond_b
const-string v0, "screenshot"

invoke-virtual {p1, v0}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

move-result v0

if-eqz v0, :cond_c

new-instance v0, Lcom/android/systemui/qs/tiles/ScreenshotTile;

invoke-direct {v0, p0}, Lcom/android/systemui/qs/tiles/ScreenshotTile;->(Lcom/android/systemui/qs/QSTile$Host;)V

goto :goto_0
   
7. Open strings.xml, search this line and added "screenshot" like that.


< string name="quick_settings_tiles_default">wifi,bt,data,inversion,airplane,lte,rotation,flashlight,location,cast,"screenshot",hotspot,audioprofile< /string>
   
8. Added this line above </resources>
   

< string name="quick_settings_screenshot_label">Screenshot< /string>
   
9. Recompile and decompile again.

10. Change ids ScreenshotTile.smali

line 322 const v1, 0x7f0c0226 

< public type="string" name="quick_settings_screenshot_label" id="0x7f0xxxxx" />

line 331 const v0, 0x7f0201d3

< public type="drawable" name="ic_qs_screenshot" id="0x7f0xxxxx" />

11. Recompile, sign, done.


*Material

Guide add screenshot toggle in QS panel
   
   
Thanks To

MAIR
MAAAD
Rentjong OS
SKYMOD
Y0U :*
Rewrite by Me (Aryo Wysata)

Sun, 09-Sep-2018 Jatirejo, Nagan Raya, Aceh.