Or Continue to Thread: [MOD][GUIDE][GB] WIFI & BT…
Find Your Device:
5th August 2013, 01:33 PM   |  #2  
iamareebjamal's Avatar
Recognized Contributor / Themer
Flag Batcave
Thanks Meter: 4,774
 
3,628 posts
Join Date:Joined: Aug 2012
More
Part III : Adding switched and disabling signature check
Adding Buttons in Settings.apk by custom style and Disabling Signature Verification


Quote:

If you were successful in accomplishing the above procedure. Be happy, but not too much because the key part is left, and that is - Adding those custom ICS Buttons in Settings by overriding the default GB tickview. Or else, you will get checkboxes instead of Switches. You don't wanna do that? Do you?

Enough talking let's roll

Quote:

Part III (a)

1. Open AndroidManifest.xml located in decompiled Settings.apk

2. Find this:

Code:
<activity android:label="@string/settings_label_launcher" android:name="Settings"
3. Modify it like this:

Code:
<activity android:theme="@style/Switch" android:label="@string/settings_label_launcher" android:name="Settings"
It means you have to add android:theme="@style/Switch" between <activity and android:label="@string/settings_label_launcher"

4. Save the file.

5. Now, as you have edited the AndroidManifest.xml . Android system won't accept your app and refuse to load it as its signature should be changed.

So, sign the recompile the apk and sign it

6. But again, there's one little problem. Android doesn't load system apps with modified signatures for stability of OS, so your app will disappear from app drawer and if you try to open it from any other source, it will say "App isn't installed"

So?

So, sign ALL system apps and framework apps with same key

...OR...

Follow the workaround in (b) part




You may have accomplished the above thing but still something needs to be done to complete the procedure. Believe me, it's the last thing
Android System doesn't accept the apks that are signed by default. So we, here, will render that option obsolete by editing some files.

Let's start


Quote:

Part III (b)

1. Pull services.jar from /system/framework/

2. Extract it's classes.dex and decompile it via my ROM Tolls

3. Go to com/android/server/PackageManagerService.smali

4. Open it and search for

Code:
.method checkSignaturesLP([Landroid/content/pm/Signature;[Landroid/content/pm/Signature;)I
5. Look below it, you should see something like this

Code:
    .prologue
    .line 1936

    if-nez p1, :cond_1
6. Add this below .line 1936

Code:
    const/4 v6, 0x0
    return v6
Finally, it should look like this:

Code:
.method checkSignaturesLP([Landroid/content/pm/Signature;[Landroid/content/pm/Signature;)I
    .locals 7
    .parameter "s1"
    .parameter "s2"

    .prologue
    .line 1936
    const/4 v6, 0x0

    return v6

    if-nez p1, :cond_1
7. Save the file and recompile classes.dex and then add it to services.jar

8. Now push services.jar and Settings.apk in their respective places and reboot the phone so that signature check changes are affected

9. Enjoy



Last edited by iamareebjamal; 5th August 2013 at 03:55 PM.
The Following 28 Users Say Thank You to iamareebjamal For This Useful Post: [ View ]