FORUMS
Remove All Ads from XDA

 View Poll Results: Was it Helpful?

Yes!
 
38 Vote(s)
88.37%
No.
 
5 Vote(s)
11.63%

[Tutorial] Adding new Activity Header/Sub Menu to Settings.apk

977 posts
Thanks Meter: 1,078
 
Post Reply Email Thread
5th February 2016, 03:11 PM |#81  
moonryder's Avatar
Senior Member
...who knows...
Thanks Meter: 601
 
More
Quote:
Originally Posted by ajiththiruvatta

The smali syntax mentioned in the main thread is of 1.5.x format, while apktool 2.0.x requires the newer syntax.
@Madaditya please edit OP

Step 6 edit for Lolipop Roms/newest apk tool:

6.Open smali/com/android/settings/ and add a new file named Maddy.smali

paste this code in it

Code:
.class public Lcom/android/settings/Maddy;
.super Lcom/android/settings/SettingsPreferenceFragment;
.source "Maddy.java"


# direct methods
.method public constructor <init>()V
    .locals 0

    .prologue
    .line 17
    invoke-direct {p0}, Lcom/android/settings/SettingsPreferenceFragment;-><init>()V

    return-void
.end method


# virtual methods
.method public onCreate(Landroid/os/Bundle;)V
    .locals 1
    .param p1, "savedInstanceState"    # Landroid/os/Bundle;

    .prologue
    .line 21
    invoke-super {p0, p1}, Lcom/android/settings/SettingsPreferenceFragment;->onCreate(Landroid/os/Bundle;)V

    .line 23
    const v0, 0x7f050054

    invoke-virtual {p0, v0}, Lcom/android/settings/Maddy;->addPreferencesFromResource(I)V

    .line 24
    return-void
.end method


thx very much, works great with this code
 
 
26th February 2016, 10:53 PM |#82  
TecnoTailsPlays's Avatar
Senior Member
Flag Lapa
Thanks Meter: 473
 
More
Quote:
Originally Posted by moonryder

thx very much, works great with this code

I need to change Maddy.java to my smali name too? or only the title?
27th February 2016, 12:09 AM |#83  
TecnoTailsPlays's Avatar
Senior Member
Flag Lapa
Thanks Meter: 473
 
More
I did everything correctly but when I try to compile I get this:

C:\Users\Tails\Desktop\ApkExtractor\AsusSettings\r es\xml\performance_settings.xml:12: error: Error parsing XML: no element found

Exception in thread "main" brut.androlib.AndrolibException: brut.androlib.AndrolibException: brut.common.BrutException: could not exec command: [C:\Users\Tails\AppData\Local\Temp\brut_util_Jar_58 45342536484861976.tmp, p, --forced-package-id, 127, --min-sdk-version, 21, --target-sdk-version, 21, --version-code, 500030, --version-name, 1.2.0.150206, -F, C:\Users\Tails\AppData\Local\Temp\APKTOOL476152637 0464215132.tmp, -0, arsc, -I, C:\Users\Tails\apktool\framework\1.apk, -S, C:\Users\Tails\Desktop\ApkExtractor\AsusSettings\r es, -M, C:\Users\Tails\Desktop\ApkExtractor\AsusSettings\A ndroidManifest.xml]
at brut.androlib.Androlib.buildResourcesFull(Androlib .java:459)
at brut.androlib.Androlib.buildResources(Androlib.jav a:397)
at brut.androlib.Androlib.build(Androlib.java:285)
at brut.androlib.Androlib.build(Androlib.java:256)
at brut.apktool.Main.cmdBuild(Main.java:225)
at brut.apktool.Main.main(Main.java:84)
Caused by: brut.androlib.AndrolibException: brut.common.BrutException: could not exec command: [C:\Users\Tails\AppData\Local\Temp\brut_util_Jar_58 45342536484861976.tmp, p, --forced-package-id, 127, --min-sdk-version, 21, --target-sdk-version, 21, --version-code, 500030, --version-name, 1.2.0.150206, -F, C:\Users\Tails\AppData\Local\Temp\APKTOOL476152637 0464215132.tmp, -0, arsc, -I, C:\Users\Tails\apktool\framework\1.apk, -S, C:\Users\Tails\Desktop\ApkExtractor\AsusSettings\r es, -M, C:\Users\Tails\Desktop\ApkExtractor\AsusSettings\A ndroidManifest.xml]
at brut.androlib.res.AndrolibResources.aaptPackage(An drolibResources.java:419)
at brut.androlib.Androlib.buildResourcesFull(Androlib .java:445)
... 5 more
Caused by: brut.common.BrutException: could not exec command: [C:\Users\Tails\AppData\Local\Temp\brut_util_Jar_58 45342536484861976.tmp, p, --forced-package-id, 127, --min-sdk-version, 21, --target-sdk-version, 21, --version-code, 500030, --version-name, 1.2.0.150206, -F, C:\Users\Tails\AppData\Local\Temp\APKTOOL476152637 0464215132.tmp, -0, arsc, -I, C:\Users\Tails\apktool\framework\1.apk, -S, C:\Users\Tails\Desktop\ApkExtractor\AsusSettings\r es, -M, C:\Users\Tails\Desktop\ApkExtractor\AsusSettings\A ndroidManifest.xml]
at brut.util.OS.exec(OS.java:90)
at brut.androlib.res.AndrolibResources.aaptPackage(An drolibResources.java:413)
... 6 more

C:\Users\Tails\Desktop\ApkExtractor>
27th February 2016, 11:38 AM |#84  
moonryder's Avatar
Senior Member
...who knows...
Thanks Meter: 601
 
More
Quote:
Originally Posted by TecnoTailsPlays

I did everything correctly but when I try to compile I get this:

C:\Users\Tails\Desktop\ApkExtractor\AsusSettings\r es\xml\performance_settings.xml:12: error: Error parsing XML: no element found

Exception in thread "main" brut.androlib.AndrolibException: brut.androlib.AndrolibException: brut.common.BrutException: could not exec command: [C:\Users\Tails\AppData\Local\Temp\brut_util_Jar_58 45342536484861976.tmp, p, --forced-package-id, 127, --min-sdk-version, 21, --target-sdk-version, 21, --version-code, 500030, --version-name, 1.2.0.150206, -F, C:\Users\Tails\AppData\Local\Temp\APKTOOL476152637 0464215132.tmp, -0, arsc, -I, C:\Users\Tails\apktool\framework\1.apk, -S, C:\Users\Tails\Desktop\ApkExtractor\AsusSettings\r es, -M, C:\Users\Tails\Desktop\ApkExtractor\AsusSettings\A ndroidManifest.xml]
at brut.androlib.Androlib.buildResourcesFull(Androlib .java:459)
at brut.androlib.Androlib.buildResources(Androlib.jav a:397)
at brut.androlib.Androlib.build(Androlib.java:285)
at brut.androlib.Androlib.build(Androlib.java:256)
at brut.apktool.Main.cmdBuild(Main.java:225)
at brut.apktool.Main.main(Main.java:84)
Caused by: brut.androlib.AndrolibException: brut.common.BrutException: could not exec command: [C:\Users\Tails\AppData\Local\Temp\brut_util_Jar_58 45342536484861976.tmp, p, --forced-package-id, 127, --min-sdk-version, 21, --target-sdk-version, 21, --version-code, 500030, --version-name, 1.2.0.150206, -F, C:\Users\Tails\AppData\Local\Temp\APKTOOL476152637 0464215132.tmp, -0, arsc, -I, C:\Users\Tails\apktool\framework\1.apk, -S, C:\Users\Tails\Desktop\ApkExtractor\AsusSettings\r es, -M, C:\Users\Tails\Desktop\ApkExtractor\AsusSettings\A ndroidManifest.xml]
at brut.androlib.res.AndrolibResources.aaptPackage(An drolibResources.java:419)
at brut.androlib.Androlib.buildResourcesFull(Androlib .java:445)
... 5 more
Caused by: brut.common.BrutException: could not exec command: [C:\Users\Tails\AppData\Local\Temp\brut_util_Jar_58 45342536484861976.tmp, p, --forced-package-id, 127, --min-sdk-version, 21, --target-sdk-version, 21, --version-code, 500030, --version-name, 1.2.0.150206, -F, C:\Users\Tails\AppData\Local\Temp\APKTOOL476152637 0464215132.tmp, -0, arsc, -I, C:\Users\Tails\apktool\framework\1.apk, -S, C:\Users\Tails\Desktop\ApkExtractor\AsusSettings\r es, -M, C:\Users\Tails\Desktop\ApkExtractor\AsusSettings\A ndroidManifest.xml]
at brut.util.OS.exec(OS.java:90)
at brut.androlib.res.AndrolibResources.aaptPackage(An drolibResources.java:413)
... 6 more

C:\Users\Tails\Desktop\ApkExtractor>


you must change all "Maddy" in smali to your name (i think 3 times)
Post Reply Subscribe to Thread

Tags
add, edit, header, settings.apk
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes