Showing posts with label completely disable signature check. Show all posts
Showing posts with label completely disable signature check. Show all posts

Friday, 26 February 2016

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