Friday, 4 March 2016

Notification Panel Permanent Transparency

Requirements:

1) Apktool version 1.5.2
2) 920 editor or NOTEPAD++
3) Root Explorer

Procedure:

1. Decompile SystemUI.apk

2. Goto to SystemUI_src/smali/com/android/systemui/statusbar/phone/HERE

3. Open PhoneStatusBar$FastColorDrawable.smali

4. Search for code:

.parameter "canvas"

5. You'll then see a code which look like this (this may vary per device)

    iget v0, p0, Lcom/android/systemui/statusbar/phone/PhoneStatusBar$FastColorDrawable;->mColor:I

6. Replace it with

    const v0, 0x00000000

for 100% Transparency

7. for 60% transparency uss this code:

    const v0, 0x5a000000

8. Save it and go to /res/layout/tw_status_bar_expanded.xml or tw_status_bar_expanded_dual.xml

9. Open it and search for code:

@drawable/notification_panel_bg

10. Change it's hex code according to the one you used in PhoneStatusBar$FastColorDrawable.smali but this time, include hashtags.

    example:

    #00000000 - For 100% transparency
    #5a000000For 60% transparency

11. Save it.

10. Recompile SystemUI_src

11. Don't forget to copy the original Android Manifest and Meta-INF from the original .apk

12. Permission = rw,r,r

13. Push to /system/app

14. Reboot

Note: Please don't copy (reguide or relink) this guide without my permission.

Friday, 26 February 2016

How to convert a hex color code to smali color code

In this post , I will tell you all "How to convert a hex color code to smali color code."
0 = F
1 = E
2 = D
3 = C
4 = B
5 = A
6 = 9
7 = 8
8 = 7
9 = 6
A = 5
B = 4
C = 3
D = 2
E = 1
F = 0
======================================
For example ,
1. Take a hex code of any color , suppose #ff444443 .
Now to convert it into a smali color code ,
2. Take the last 6 digits of hex code i.e. 444443 and
write the value that corresponds to it using above
table.
3. Like 4=b , 3=c. The 444443 will become bbbbbc.
4. Now write -0x in front of this value.
5. The final code will become -0xbbbbbc. Done.
======================================
Thanks to ,
XDA
Gurpreet Singh

HoW To Completely Disable Signature check In Touchwiz Devices

HoW To Completely Disable Signature check In Touchwiz Devices

You will need the following:

1. Core.jar from system/framework folder
2. services.jar from system/framework folder
3. Apktool/baksmali+smali

Part 1: Allows installing apps with broken/mismatched signatures

Modding Core.Jar

1. Decompile core.jar and navigate to java/security

2. Open MessageDigest.smali

3. find the following method

.method public static isEqual([B[B)Z

At the beginning you will find code like this:

    const/4 v1, 0x0
    array-length v2, p0
   
Change the 0x0 to 0x1 so that it becomes:-

    const/4 v1, 0x1
    array-length v2, p0
   
4. Now save and close MessageDigest.smali

5. In the same directory, open Signature.smali

6. Find the method:

.method public final verify([B)Z

7. Find this code at the very end of the method:

    invoke-virtual {p0, p1}, Ljava/security/SignatureSpi;->engineVerify([B)Z
   
    move-result v0
   
    return v0
   
Change the move-result v0 to const/4 v0, 0x1 so that it becomes like this:

    invoke-virtual {p0, p1}, Ljava/security/SignatureSpi;->engineVerify([B)Z

    const/4 v0, 0x1

    return v0
   
8. Now find this method:

.method public final verify([BII)Z

9. Scroll to the end of the method and find this code:

    invoke-virtual {p0, p1, p2, p3}, Ljava/security/SignatureSpi;->engineVerify([BII)Z

    move-result v0
   
    return v0

And replace it with this Code:

    invoke-virtual {p0, p1, p2, p3}, Ljava/security/SignatureSpi;->engineVerify([BII)Z
   
    const/4 v0, 0x1

    return v0

10. Now save and close Signature.smali. Recompile core.jar

Part 2 need Services.jar

1. Decompile services.jar and navigate to com\android\server\pm

2. Open PackageManagerService$InstallParams.smali and find the following
method:

.method private installLocationPolicy(Landroid/content/pm/PackageInfoLite;I)I

3. Scroll down until you find code that looks like the following Code:

    if-nez v7, :cond_1
    iget v7, p1, Landroid/content/pm/PackageInfoLite;->versionCode:I

    iget v8, v3, Landroid/content/pm/PackageParser$Package;->mVersionCode:I

    if-ge v7, v8, :cond_1 [U have to.modify this line)
   
    const-string v4, "PackageManager" new-instance v5, Ljava/lang/StringBuilder;
    invoke-direct {v5}, Ljava/lang/
StringBuilder;->()V

    const-string v7, "Can\'t install update of "

(okay i already highlighted the code if-ge v7, v8, :cond_1 u have to change it so it will look like this:

    if-ge v8, v8, :cond_1

4. Okay Done now save the smali
recompile services.jar

5. Now - Push core.jar & services.jar to your system/framework/here before pushing make sure you already copied the original backup to you sdcard.

6. Now reboot and enjoy

Note: Please Don't Mirror the link or guide.

Tested in JB 4.1.2

Saturday, 9 January 2016

Lollipop Battery Low Notifcation Warning In Jb 4.1.2

Materials Required;

1) Apktool 1.5.2
2) SystemUI.apk
3) Files

Procedure;

1) Decompile SystemUI.apk

2) Extract the given files and move them to their respective folders.

3) Recompile SystemUI.apk

4) Sign it and push it to system/app folder and set its permissions to rw--rr

Credit: Abdusy Syukur

Tuesday, 5 January 2016

Hide Am Pm in Jb 4.1.2 Status Bar And Expanded Header

Requirements:
1) Apktool 1.5.2
2) Notepad ++
3) SystemUI.apk

Procedure;

1) Decompile SystemUI.apk

2) Now goto decompiled folder and navigate to smali/com/android/systemui/statusbar/policy folder.

3) Open clock.smali using notepad++ and search for this method .method final updateClock()V and mark It until .end method

4) Replace it with this method

.method final updateClock()V
    .locals 15

    .prologue
    const/4 v14, 0x0

    .line 191
    iget-object v11, p0, Lcom/android/systemui/statusbar/policy/Clock;->mCalendar:Ljava/util/Calendar;

    invoke-static {}, Ljava/lang/System;->currentTimeMillis()J

    move-result-wide v12

    invoke-virtual {v11, v12, v13}, Ljava/util/Calendar;->setTimeInMillis(J)V

    .line 200
    invoke-virtual {p0}, Lcom/android/systemui/statusbar/policy/Clock;->getContext()Landroid/content/Context;

    move-result-object v3

    .line 201
    .local v3, context:Landroid/content/Context;
    invoke-static {v3}, Landroid/text/format/DateFormat;->is24HourFormat(Landroid/content/Context;)Z

    move-result v2

    .line 202
    .local v2, b24:Z
    const/4 v8, 0x0

    .line 203
    .local v8, res:I
    const-string v1, ""

    .line 205
    .local v1, AM_PM:Ljava/lang/String;
    if-nez v2, :cond_0

    .line 206
    iget-object v11, p0, Lcom/android/systemui/statusbar/policy/Clock;->mCalendar:Ljava/util/Calendar;

    const/16 v12, 0x9

    invoke-virtual {v11, v12}, Ljava/util/Calendar;->get(I)I

    move-result v0

    .line 207
    .local v0, AMPM:I
    if-nez v0, :cond_3

    .line 208
    const v8, 0x104009a

    .line 214
    .end local v0           #AMPM:I
    :cond_0
    :goto_0
    if-eqz v8, :cond_1

    .line 215
    invoke-virtual {v3, v8}, Landroid/content/Context;->getString(I)Ljava/lang/String;

    move-result-object v11

    invoke-virtual {v11}, Ljava/lang/String;->toUpperCase()Ljava/lang/String;

    move-result-object v1

    .line 218
    :cond_1
    const v11, 0x7f0a005c

    const/4 v12, 0x2

    new-array v12, v12, [Ljava/lang/Object;

    invoke-direct {p0}, Lcom/android/systemui/statusbar/policy/Clock;->getSmallTime()Ljava/lang/CharSequence;

    move-result-object v13

    aput-object v13, v12, v14

    const/4 v13, 0x1

    aput-object v1, v12, v13

    invoke-virtual {v3, v11, v12}, Landroid/content/Context;->getString(I[Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v11

    new-array v12, v14, [Ljava/lang/Object;

    invoke-static {v11, v12}, Ljava/lang/String;->format(Ljava/lang/String;[Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v10

    .line 221
    .local v10, timeText:Ljava/lang/String;
    if-eqz v8, :cond_4

    sget-boolean v11, Lcom/android/systemui/statusbar/BaseStatusBar;->useTouchWizGUI:Z

    if-eqz v11, :cond_4

    sget-boolean v11, Lcom/android/systemui/statusbar/BaseStatusBar;->canStatusBarHide:Z

    if-eqz v11, :cond_2

    iget-boolean v11, p0, Lcom/android/systemui/statusbar/policy/Clock;->mExpandedHeader:Z

    if-eqz v11, :cond_4

    .line 223
    :cond_2
    new-instance v4, Landroid/text/SpannableStringBuilder;

    invoke-direct {v4, v10}, Landroid/text/SpannableStringBuilder;-><init>(Ljava/lang/CharSequence;)V

    .line 224
    .local v4, formatted:Landroid/text/SpannableStringBuilder;
    const/high16 v7, 0x3000

    .line 225
    .local v7, proportion:F
    invoke-virtual {v10, v1}, Ljava/lang/String;->indexOf(Ljava/lang/String;)I

    move-result v5

    .line 226
    .local v5, magic1:I
    invoke-virtual {v1}, Ljava/lang/String;->length()I

    move-result v6

    .line 227
    .local v6, magic2:I
    new-instance v9, Landroid/text/style/RelativeSizeSpan;

    invoke-direct {v9, v7}, Landroid/text/style/RelativeSizeSpan;-><init>(F)V

    .line 228
    .local v9, style:Landroid/text/style/CharacterStyle;
    add-int v11, v5, v6

    const/16 v12, 0x22

    invoke-virtual {v4, v9, v5, v11, v12}, Landroid/text/SpannableStringBuilder;->setSpan(Ljava/lang/Object;III)V

    .line 230
    invoke-virtual {p0, v4}, Lcom/android/systemui/statusbar/policy/Clock;->setText(Ljava/lang/CharSequence;)V

    .line 235
    .end local v4           #formatted:Landroid/text/SpannableStringBuilder;
    .end local v5           #magic1:I
    .end local v6           #magic2:I
    .end local v7           #proportion:F
    .end local v9           #style:Landroid/text/style/CharacterStyle;
    :goto_1
    return-void

    .line 210
    .end local v10           #timeText:Ljava/lang/String;
    .restart local v0       #AMPM:I
    :cond_3
    const v8, 0x104009b

    goto :goto_0

    .line 232
    .end local v0           #AMPM:I
    .restart local v10       #timeText:Ljava/lang/String;
    :cond_4
    invoke-virtual {p0, v10}, Lcom/android/systemui/statusbar/policy/Clock;->setText(Ljava/lang/CharSequence;)V

    goto :goto_1
.end method

5) Now goto res/layout folder.

6) Open tw_status_bar.xml , tw_status_bar_dual.xml and tw_status_bar_expanded_header.xml

7) Search for code <com.android.systemui.statusbar.policy.clock

8) Add this attribute to it android:ampmSmall="true"

9) Save it , recompile it.

10) Sign it and push it to rw--rr

Credit: ShadeSk@xda