!NOOB ALERT!NOOB ALERT!
The post you are about to read is from a noob. Be aware that he does not know **** about anything other than making themes and smoking pot. YOU HAVE BEEN WARNED.​
so im trying to edit an apk, but i never really learned how to modify/edit smali files.
do you or does anyone know how to edit smali files?
i looked on the google page and i don't understand at all whats going on..
can someone dumb it down for me?
first you need apktool:
http://code.google.com/p/android-apktool/
then a good text editor, I prefer notepad++:
http://notepad-plus-plus.org/
open a cmd prompt where u extracted apktool:
ie... c:\apktool
decompile the file u want to edit:
ie... apktool d settings.apk
make your edits
compile the apk:
ie.... apktool b settings
O.M.J said:
first you need apktool:
http://code.google.com/p/android-apktool/
then a good text editor, I prefer notepad++:
http://notepad-plus-plus.org/
open a cmd prompt where u extracted apktool:
ie... c:\apktool
decompile the file u want to edit:
ie... apktool d settings.apk
make your edits
compile the apk:
ie.... apktool b settings
Click to expand...
Click to collapse
so notepad++ can edit .smali files? :O
Rolando.Ramiro said:
so notepad++ can edit .smali files? :O
Click to expand...
Click to collapse
yes, you're just editing text
ahgahd damn it. :l
i've been looking for something or a thread or a post about editing .smali files since 6am....
and you come here and tell me that you can edit it with a good text editing tool...
WOOOOWWWW
by any chance, would i still be able to remove a license verification on an .apk
but i get error pls help me
Microsoft Windows [Version 6.1.7600]
Copyright (c) 2009 Microsoft Corporation. All rights reserved.
C:\Users\Balaji>cd c:\bala\apk
c:\Bala\apk>apktool d settings.apk
I: Baksmaling...
testI: Loading resource table...
I: Loaded.
I: Loading resource table from file: C:\Users\Balaji\apktool\framework\1.apk
I: Loaded.
W: Could not decode attr value, using undecoded value instead: ns=android, name=
theme, value=0x02070015
I: Decoding file-resources...
W: Could not decode attr value, using undecoded value instead: ns=android, name=
textColor, value=0x02050000
W: Could not decode attr value, using undecoded value instead: ns=android, name=
textColorHint, value=0x02050001
W: Could not decode attr value, using undecoded value instead: ns=android, name=
textAppearance, value=0x0207000e
W: Could not decode attr value, using undecoded value instead: ns=android, name=
textAppearance, value=0x0207000f
W: Could not decode attr value, using undecoded value instead: ns=android, name=
textAppearance, value=0x0207000f
W: Could not decode attr value, using undecoded value instead: ns=android, name=
textColor, value=0x02050002
I: Decoding values*/* XMLs...
I: Done.
Can't find framework resources for package of id: 2. You must install proper fra
mework files, see project website for more info.
c:\Bala\apk>apktool b settings
Exception in thread "main" brut.androlib.AndrolibException: brut.directory.PathN
otExist: apktool.yml
at brut.androlib.Androlib.readMetaFile(Androlib.java:142)
at brut.androlib.Androlib.build(Androlib.java:159)
at brut.androlib.Androlib.build(Androlib.java:154)
at brut.apktool.Main.cmdBuild(Main.java:174)
at brut.apktool.Main.main(Main.java:59)
Caused by: brut.directory.PathNotExist: apktool.yml
at brut.directory.AbstractDirectory.getFileInput(AbstractDirectory.java:
103)
at brut.androlib.Androlib.readMetaFile(Androlib.java:138)
... 4 more
c:\Bala\apk>apktool b settings
Exception in thread "main" brut.androlib.AndrolibException: brut.directory.PathN
otExist: apktool.yml
at brut.androlib.Androlib.readMetaFile(Androlib.java:142)
at brut.androlib.Androlib.build(Androlib.java:159)
at brut.androlib.Androlib.build(Androlib.java:154)
at brut.apktool.Main.cmdBuild(Main.java:174)
at brut.apktool.Main.main(Main.java:59)
Caused by: brut.directory.PathNotExist: apktool.yml
at brut.directory.AbstractDirectory.getFileInput(AbstractDirectory.java:
103)
at brut.androlib.Androlib.readMetaFile(Androlib.java:138)
... 4 more
c:\Bala\apk>apktool b settings
Exception in thread "main" brut.androlib.AndrolibException: brut.directory.PathN
otExist: apktool.yml
at brut.androlib.Androlib.readMetaFile(Androlib.java:142)
at brut.androlib.Androlib.build(Androlib.java:159)
at brut.androlib.Androlib.build(Androlib.java:154)
at brut.apktool.Main.cmdBuild(Main.java:174)
at brut.apktool.Main.main(Main.java:59)
Caused by: brut.directory.PathNotExist: apktool.yml
at brut.directory.AbstractDirectory.getFileInput(AbstractDirectory.java:
103)
at brut.androlib.Androlib.readMetaFile(Androlib.java:138)
... 4 more
c:\Bala\apk>
this might fix it.
idk if this is even right, but this is what i did.
go into your phone
go to;
/system/framework/
and copy
com.htc.resources.apk
and
framework-res.apk
now take both of those files and put them in the
C:\Users\Balaji\apktool\framework\ <--- folder.
remove the 1.apk and put it somewhere safe (just incase this **** dont work)
then, since com.htc.resources.apk and framework-res.apk are both in there, rename 'com.htc.resources.apk' to '1.apk'
then go to 'framework-res.apk' and rename it to '2.apk'
remember that 1 is always 'com.htc.resources.apk'
remember that 2 is always 'framework-res.apk'
(just for future reference lol)
now try to decompile and build.
let me know what happens
bala242 said:
but i get error pls help me
Microsoft Windows [Version 6.1.7600]
Copyright (c) 2009 Microsoft Corporation. All rights reserved.
C:\Users\Balaji>cd c:\bala\apk
c:\Bala\apk>apktool d settings.apk
I: Baksmaling...
testI: Loading resource table...
I: Loaded.
I: Loading resource table from file: C:\Users\Balaji\apktool\framework\1.apk
I: Loaded.
W: Could not decode attr value, using undecoded value instead: ns=android, name=
theme, value=0x02070015
I: Decoding file-resources...
W: Could not decode attr value, using undecoded value instead: ns=android, name=
textColor, value=0x02050000
W: Could not decode attr value, using undecoded value instead: ns=android, name=
textColorHint, value=0x02050001
W: Could not decode attr value, using undecoded value instead: ns=android, name=
textAppearance, value=0x0207000e
W: Could not decode attr value, using undecoded value instead: ns=android, name=
textAppearance, value=0x0207000f
W: Could not decode attr value, using undecoded value instead: ns=android, name=
textAppearance, value=0x0207000f
W: Could not decode attr value, using undecoded value instead: ns=android, name=
textColor, value=0x02050002
I: Decoding values*/* XMLs...
I: Done.
Can't find framework resources for package of id: 2. You must install proper fra
mework files, see project website for more info.
c:\Bala\apk>apktool b settings
Exception in thread "main" brut.androlib.AndrolibException: brut.directory.PathN
otExist: apktool.yml
at brut.androlib.Androlib.readMetaFile(Androlib.java:142)
at brut.androlib.Androlib.build(Androlib.java:159)
at brut.androlib.Androlib.build(Androlib.java:154)
at brut.apktool.Main.cmdBuild(Main.java:174)
at brut.apktool.Main.main(Main.java:59)
Caused by: brut.directory.PathNotExist: apktool.yml
at brut.directory.AbstractDirectory.getFileInput(AbstractDirectory.java:
103)
at brut.androlib.Androlib.readMetaFile(Androlib.java:138)
... 4 more
c:\Bala\apk>apktool b settings
Exception in thread "main" brut.androlib.AndrolibException: brut.directory.PathN
otExist: apktool.yml
at brut.androlib.Androlib.readMetaFile(Androlib.java:142)
at brut.androlib.Androlib.build(Androlib.java:159)
at brut.androlib.Androlib.build(Androlib.java:154)
at brut.apktool.Main.cmdBuild(Main.java:174)
at brut.apktool.Main.main(Main.java:59)
Caused by: brut.directory.PathNotExist: apktool.yml
at brut.directory.AbstractDirectory.getFileInput(AbstractDirectory.java:
103)
at brut.androlib.Androlib.readMetaFile(Androlib.java:138)
... 4 more
c:\Bala\apk>apktool b settings
Exception in thread "main" brut.androlib.AndrolibException: brut.directory.PathN
otExist: apktool.yml
at brut.androlib.Androlib.readMetaFile(Androlib.java:142)
at brut.androlib.Androlib.build(Androlib.java:159)
at brut.androlib.Androlib.build(Androlib.java:154)
at brut.apktool.Main.cmdBuild(Main.java:174)
at brut.apktool.Main.main(Main.java:59)
Caused by: brut.directory.PathNotExist: apktool.yml
at brut.directory.AbstractDirectory.getFileInput(AbstractDirectory.java:
103)
at brut.androlib.Androlib.readMetaFile(Androlib.java:138)
... 4 more
c:\Bala\apk>
Click to expand...
Click to collapse
run this from the command line
java -jar apktool.jar if <PATH_TO_YOUR>/framework-res.apk
@t3project
thx but...
c:\Bala\apk>java -jar apktool.jar if framework-res.apk
I: Framework installed to: C:\Users\Balaji\apktool\framework\1.apk
c:\Bala\apk>apktool b settings
Exception in thread "main" brut.androlib.AndrolibException: brut.directory.PathN
otExist: apktool.yml
at brut.androlib.Androlib.readMetaFile(Androlib.java:142)
at brut.androlib.Androlib.build(Androlib.java:159)
at brut.androlib.Androlib.build(Androlib.java:154)
at brut.apktool.Main.cmdBuild(Main.java:174)
at brut.apktool.Main.main(Main.java:59)
Caused by: brut.directory.PathNotExist: apktool.yml
at brut.directory.AbstractDirectory.getFileInput(AbstractDirectory.java:
103)
at brut.androlib.Androlib.readMetaFile(Androlib.java:138)
... 4 more
c:\Bala\apk>
bala242 said:
@t3project
thx but...
c:\Bala\apk>java -jar apktool.jar if framework-res.apk
I: Framework installed to: C:\Users\Balaji\apktool\framework\1.apk
c:\Bala\apk>apktool b settings
Exception in thread "main" brut.androlib.AndrolibException: brut.directory.PathN
otExist: apktool.yml
at brut.androlib.Androlib.readMetaFile(Androlib.java:142)
at brut.androlib.Androlib.build(Androlib.java:159)
at brut.androlib.Androlib.build(Androlib.java:154)
at brut.apktool.Main.cmdBuild(Main.java:174)
at brut.apktool.Main.main(Main.java:59)
Caused by: brut.directory.PathNotExist: apktool.yml
at brut.directory.AbstractDirectory.getFileInput(AbstractDirectory.java:
103)
at brut.androlib.Androlib.readMetaFile(Androlib.java:138)
... 4 more
c:\Bala\apk>
Click to expand...
Click to collapse
let me know if my method helped out.
read more on this @ the apktool wiki:
http://code.google.com/p/android-apktool/wiki/FrameworkFiles
Overview
As you probably know, Android apps use some code and resources that are built into the Android system on your device. Apktool needs these framework files to decode and build apks.
Standard framework is embedded into apktool, so you don't need to do anything for most apk files. But some manufacturers, for example HTC, add their own framework files and use them in system apps. To use apktool against such apps, you must pull framework from a device and install/register it to apktool.
Click to expand...
Click to collapse
so both framework-res.apk & com.htc.resources.apk need to be registered w/ apktool
copy both to your apktool folder then run these cmds:
apktool if com.htc.resources.apk
apktool if framework-res.apk
output will look like this:
Framework installed to: /home/brutall/apktool/framework/2.apk
Search for apk manager here on xda. It will compile and decompile plus many other things. Also will give error log andvwhere to find error and so forth. Its a great tool.
free the dirk
Papa Smurf151 said:
Search for apk manager here on xda. It will compile and decompile plus many other things. Also will give error log andvwhere to find error and so forth. Its a great tool.
free the dirk
Click to expand...
Click to collapse
apkmanager have problems deompiling system apk's...often/always with the xml's in res/values*
j4n87 said:
apkmanager have problems deompiling system apk's...often/always with the xml's in res/values*
Click to expand...
Click to collapse
That's cause the latest version doesn't work so well. I'm using 4.7 and it works great
free the dirk
Hi guys, go to
http://forum.xda-developers.com/showthread.php?p=23644305 to get yours. it's ray home.apk but should be compatible with arc or neo
Now with Xperia S style of home launcher
Added Xperia S mirror effect on Lower Dock..
REQ: Edit Home.apk of Xperia-s
hansip87,
I was trying to decompile the xperia s home.apk, which i have got it from one of your link. i'm running into the below issue. could you please help me out, what is wrong that i'm doing?
-----------------------------------------------------------------------------------------------------------
error
-----------------------------------------------------------------------------------------------------------
I: Baksmaling...
I: Loading resource table...
I: Loaded.
I: Loading resource table from file: C:\Users\admroot\apktool\framework\1.apk
I: Loaded.
I: Decoding file-resources...
W: Could not decode attr value, using undecoded value instead: ns=android, name=textAppearance, value=0x02090045
W: Could not decode attr value, using undecoded value instead: ns=android, name=textAppearance, value=0x02090048
W: Could not decode attr value, using undecoded value instead: ns=android, name=textAppearance, value=0x02090045
W: Could not decode attr value, using undecoded value instead: ns=android, name=textAppearance, value=0x02090048
I: Decoding values*/* XMLs...
-----------------------------------------------------------------------------------------------------------
Note: Before editing, i have downloaded framework-res.apk of xperia s and did an 'apktool if framework-res.apk' as well. I'm also using the apktool recommended by you in one of your reply.
-Thanks
please update the apktool.jar to at least version 1.4.1. Don't have any link now unfortunately. the old download link is expired Or you can update by searching @ google "apktool"
hansip,
I have managed it to decompile by including the other resource file of xperia-s.
-Thanks.
So to get right to the point, I haven't tried my hand at theming in quite awhile. Whenever i did, I really only did 3rd party apps. I have been trying to theme the flashservicebar.apk. Whenever I try to decompile the apk I get errors. Has anyone seen these before, and can give me some hints as to what i am doing wrong? I have read guide after guide, and i know i am missing a small step, but for the life of me I Can't figure out what I am doing wrong. Any help, or suggestions would be greatly appreciated.
C:\android\platform-tools\apktool>apktool d flashbarserviceclean.apk
I: Baksmaling...
I: Loading resource table...
I: Loaded.
I: Decoding AndroidManifest.xml with resources...
I: Loading resource table from file: C:\Users\jeramyeggers\apktool\framework\1.a
pk
I: Loaded.
I: Regular manifest package...
I: Decoding file-resources...
W: Could not decode attr value, using undecoded value instead: ns=android, name=
requiresFadingEdge, value=0x00001000
W: Could not decode attr value, using undecoded value instead: ns=android, name=
requiresFadingEdge, value=0x00002000
I: Decoding values */* XMLs...
I: Done.
Exception in thread "main" brut.androlib.err.UndefinedResObject: resource spec:
0x010103a5
at brut.androlib.res.data.ResPackage.getResSpec(ResPackage.java:61)
at brut.androlib.res.data.ResTable.getResSpec(ResTable.java:58)
at brut.androlib.res.data.ResTable.getResSpec(ResTable.java:54)
at brut.androlib.res.decoder.ResAttrDecoder.decode(ResAttrDecoder.java:3
5)
at brut.androlib.res.decoder.AXmlResourceParser.getAttributeValue(AXmlRe
sourceParser.java:313)
at org.xmlpull.v1.wrapper.classic.XmlPullParserDelegate.getAttributeValu
e(XmlPullParserDelegate.java:69)
at org.xmlpull.v1.wrapper.classic.StaticXmlSerializerWrapper.writeStartT
ag(StaticXmlSerializerWrapper.java:267)
at org.xmlpull.v1.wrapper.classic.StaticXmlSerializerWrapper.event(Stati
cXmlSerializerWrapper.java:211)
at brut.androlib.res.decoder.XmlPullStreamDecoder$1.event(XmlPullStreamD
ecoder.java:80)
at brut.androlib.res.decoder.XmlPullStreamDecoder.decode(XmlPullStreamDe
coder.java:130)
at brut.androlib.res.decoder.ResStreamDecoderContainer.decode(ResStreamD
ecoderContainer.java:34)
at brut.androlib.res.decoder.ResFileDecoder.decode(ResFileDecoder.java:1
07)
at brut.androlib.res.decoder.ResFileDecoder.decode(ResFileDecoder.java:9
1)
at brut.androlib.res.AndrolibResources.decode(AndrolibResources.java:238
)
at brut.androlib.Androlib.decodeResourcesFull(Androlib.java:115)
at brut.androlib.ApkDecoder.decode(ApkDecoder.java:114)
at brut.apktool.Main.cmdDecode(Main.java:146)
at brut.apktool.Main.main(Main.java:77)
Did you install the two framework files, framework-res.apk and twframework-res.apk, for apktool to use when decompiling?
Yeah, I did that. Like I said, I have read som many guides at this point. I am going to reinstall the 2 framework files again. When I do that, it will overwrite them, right? I will go ahead and try this, but as I have said, I have done it already. I don't want to set everything up again. I have java, and andeoid sdk setup right. So I think it is just apktool I am stuggling with. May go ahead, and trycto set up apktool from scratch. It's funny, because the last time I tried hand at theming, I had no problems. I just suck at graphic design.
Sent from my SCH-I605 using Tapatalk 2
Hi guys, i use Cyanogenmod 10.1 with a theme, and i would decompile/edit and compile SystemUI.apk but when i try with apktool show me this error
Code:
I: Baksmaling...
I: Loading resource table...
I: Loaded.
I: Decoding AndroidManifest.xml with resources...
I: Loading resource table from file: C:\Users\lucry\apktool\framework\1.apk
I: Loaded.
I: Regular manifest package...
I: Decoding file-resources...
W: Could not decode attr value, using undecoded value instead: ns=android, name=
drawable, value=0x01080666
W: Could not decode attr value, using undecoded value instead: ns=android, name=
drawable, value=0x01080665
W: Could not decode attr value, using undecoded value instead: ns=android, name=
drawable, value=0x01080665
S: Could not decode file, replacing by FALSE value: layout/status_bar.xml
W: Could not decode attr value, using undecoded value instead: ns=android, name=
drawable, value=0x01080666
I: Decoding values */* XMLs...
I: Done.
Exception in thread "main" brut.androlib.err.UndefinedResObject: resource spec:
0x01080666
at brut.androlib.res.data.ResPackage.getResSpec(ResPackage.java:61)
at brut.androlib.res.data.ResTable.getResSpec(ResTable.java:58)
at brut.androlib.res.data.ResTable.getResSpec(ResTable.java:54)
at brut.androlib.res.data.value.ResReferenceValue.getReferent(ResReferen
ceValue.java:62)
at brut.androlib.res.data.value.ResReferenceValue.encodeAsResXml(ResRefe
renceValue.java:46)
at brut.androlib.res.data.value.ResScalarValue.encodeAsResXmlAttr(ResSca
larValue.java:44)
at brut.androlib.res.decoder.ResAttrDecoder.decode(ResAttrDecoder.java:4
0)
at brut.androlib.res.decoder.AXmlResourceParser.getAttributeValue(AXmlRe
sourceParser.java:313)
at org.xmlpull.v1.wrapper.classic.XmlPullParserDelegate.getAttributeValu
e(XmlPullParserDelegate.java:69)
at org.xmlpull.v1.wrapper.classic.StaticXmlSerializerWrapper.writeStartT
ag(StaticXmlSerializerWrapper.java:267)
at org.xmlpull.v1.wrapper.classic.StaticXmlSerializerWrapper.event(Stati
cXmlSerializerWrapper.java:211)
at brut.androlib.res.decoder.XmlPullStreamDecoder$1.event(XmlPullStreamD
ecoder.java:80)
at brut.androlib.res.decoder.XmlPullStreamDecoder.decode(XmlPullStreamDe
coder.java:130)
at brut.androlib.res.decoder.ResStreamDecoderContainer.decode(ResStreamD
ecoderContainer.java:34)
at brut.androlib.res.decoder.ResFileDecoder.decode(ResFileDecoder.java:1
07)
at brut.androlib.res.decoder.ResFileDecoder.decode(ResFileDecoder.java:9
1)
at brut.androlib.res.AndrolibResources.decode(AndrolibResources.java:238
)
at brut.androlib.Androlib.decodeResourcesFull(Androlib.java:115)
at brut.androlib.ApkDecoder.decode(ApkDecoder.java:114)
at brut.apktool.Main.cmdDecode(Main.java:146)
at brut.apktool.Main.main(Main.java:77)
how can i fix this problem??
bump
I'm positive these threads are a dime a dozen but now i'm at a loss. I have been working for a number of days on a new android project. I stored the whole thing on my memory stick on my keys which i kept on me at all times.
It however appears that today they have been stolen as i walked through town and i was stupid enough to not backup the data. I've attempted to use ApkTool with all manner of different versions and framework-res files but every single time i'm presented with this error:
Code:
I: Using Apktool 2.0.0-Beta9 on par.apk
I: Loading resource table...
I: Loading resource table...
I: Decoding AndroidManifest.xml with resources...
I: Loading resource table from file: C:\Users\Jayminor\apktool\framework\1.apk
I: Regular manifest package...
I: Decoding file-resources...
W: Could not decode attr value, using undecoded value instead: ns=android, name=touchscreenBlocksFocus, value=0xffffffff
W: Could not decode attr value, using undecoded value instead: ns=android, name=paddingMode, value=0x00000001
I: Decoding values */* XMLs...
Exception in thread "main" brut.androlib.err.UndefinedResObject: resource spec: 0x01010462
at brut.androlib.res.data.ResPackage.getResSpec(ResPackage.java:59)
at brut.androlib.res.data.ResTable.getResSpec(ResTable.java:59)
at brut.androlib.res.data.ResTable.getResSpec(ResTable.java:55)
at brut.androlib.res.data.value.ResReferenceValue.getReferent(ResReferenceValue.java:60)
at brut.androlib.res.data.value.ResStyleValue.serializeToResValuesXml(ResStyleValue.java:54)
at brut.androlib.res.AndrolibResources.generateValuesFile(AndrolibResources.java:553)
at brut.androlib.res.AndrolibResources.decode(AndrolibResources.java:309)
at brut.androlib.Androlib.decodeResourcesFull(Androlib.java:116)
at brut.androlib.ApkDecoder.decode(ApkDecoder.java:114)
at brut.apktool.Main.cmdDecode(Main.java:169)
at brut.apktool.Main.main(Main.java:85)
I have no smart-guard or obfuscation of any kind on the project and it is all but vanilla. I've no idea why it's posing so many problems?
I'm hoping someone knowledgeable has it in their heart to help me out here Sorry again.