[Q]Apk Decompiling Errors - IDEs, Libraries, & Programming Tools

So, i'm new to this entire thing, i'm hoiping im in the correct section. Redirect me if im not. I appreciate any help I can get.
I must be half retarded or full retarded cause I cannot figure out what i'm doing wrong.
I'm trying apk studio, apk tool, like everything. All I want to do is change a package name of my apk, but I cannot decompile it.
I'm not fully understanding the framework-res.apk I guess. I found one online and tried using it but I keep getting errors while trying to install the framework, and I can't find any framework files via google. Where am I supposed to get the Framework???
THis is the error i'm getting trying to install the framework. Am I using wrong framework? All I want to do is decompile dang apk rename package and recompile, this is killing me. Here is the error i'm getting.
Code:
C:\android\apktool>apktool if framework-res.apk
Exception in thread "main" brut.androlib.AndrolibException: Could not decode ars
c file
at brut.androlib.res.decoder.ARSCDecoder.decode(ARSCDecoder.java:52)
at brut.androlib.res.decoder.ARSCDecoder.decode(ARSCDecoder.java:39)
at brut.androlib.res.AndrolibResources.installFramework(AndrolibResource
s.java:685)
at brut.androlib.res.AndrolibResources.installFramework(AndrolibResource
s.java:667)
at brut.androlib.Androlib.installFramework(Androlib.java:642)
at brut.apktool.Main.cmdInstallFramework(Main.java:240)
at brut.apktool.Main.main(Main.java:87)
Caused by: java.io.IOException: Expected: 0x00000008, got: 0x00000000
at brut.util.ExtDataInput.skipCheckShort(ExtDataInput.java:56)
at brut.androlib.res.decoder.ARSCDecoder.readValue(ARSCDecoder.java:238)
at brut.androlib.res.decoder.ARSCDecoder.readEntry(ARSCDecoder.java:201)
at brut.androlib.res.decoder.ARSCDecoder.readConfig(ARSCDecoder.java:189
)
at brut.androlib.res.decoder.ARSCDecoder.readType(ARSCDecoder.java:157)
at brut.androlib.res.decoder.ARSCDecoder.readPackage(ARSCDecoder.java:11
4)
at brut.androlib.res.decoder.ARSCDecoder.readTable(ARSCDecoder.java:78)
at brut.androlib.res.decoder.ARSCDecoder.decode(ARSCDecoder.java:47)
... 6 more

There are a lot more talented people than me but I'll try my best to help you.
1. Make sure your have updated your apktool.jar to the latest version if using apk studio
2. You need to install the correct framework res for the app your trying to decompile. If it is a Google app then you are best using the latest cm framework res.apk so grab it from any cm rom that is the latest release
3. If it is a vendor app like Samsung then you will need the tw framework res.apk and the framework res.apk from the rom the app is from.
If you can tell me the app you want to decompile and the rom it's from I should be able to tell you which frameworks to install
Sent from my SM-N910F using Tapatalk

Well its a custom made app from my buddy, he went away on vacation and my whole goal is to just change the package name so I can run 2 instances. He told me to go ahead, than left on holiday,
He is on stock lollipop, not custom rom.

Syntax323 said:
Well its a custom made app from my buddy, he went away on vacation and my whole goal is to just change the package name so I can run 2 instances. He told me to go ahead, than left on holiday,
He is on stock lollipop, not custom rom.
Click to expand...
Click to collapse
OK then you probably just need the frameworkres.apk from cm 12 to be honest
Sent from my SM-N910F using Tapatalk

Do you have a link to it? Id really appreciate it. I can't find that, maybe i'm looking in wrong place?

Related

4 Lockscreens for SGS tried but failed

Hi,
I kno I've posted this in Q&A but maybe there is one super developer who can help the community getting there 4 lockscreens?!
Currently there only exist two types of lockscreen for the sgs i9000. AOSP or samsung glass.
For the Vibrant on the other hand, some people (untermensch ) have managed to get 4 lockscreen types:
AOSP lockscreen
Glass lockscreen
Puzzle lockscreen
Epic lockscreen
More info in this topic: http://forum.xda-developers.com/showthread.php?t=838260
It must definitly be possible to port this to a froyo rom on our SGS but it has taken me a lot of time allready and have not progressed one bit.
Frustrating indeed.
I managed to decompile the android.policy.jar using the command: java -jar baksmali.jar -x android.policy.jar -o android.policy
I added the epic classes from the source zip file in the earlier mentioned post.
I recompiled ((java -jar smali.jar android.policy -o classes.dex) it again and at least no errors at this stage.
Next I tried to decompile the framework-res.apk.
Got errors from apktool, saying that it can't decompile a nine patch image. The nine patch image does not contain a nine patch chunk (so not really a nine patch but png with .0.png extension?)
Tried a lot of things, options, google, this forum but failed to find a solution.
The same thing with the Settings.apk, same kind of error, no solution.
I must be doing something wrong here and have come to a point that I cant figure it out anymore.
I believe that a lot of people would be interested in this kind of thing and this is something achievable.
If somebody could take a shot at this modification please, it would be so awesome to have this for Darkys rom or Docrom v9.
ps.i do remember that some id's of resources need to change cause there are some duplicates somewhere but don't remember which one where.
The source codes that untenmensch provided contain all the information. Though haven't tried it, but it is comprehensive enough.
Try using apk manager to decompile the framework-res.apk, and you use baksmali and smali for the settings apk.
Use stock apk, instead of modded ones.
Sent from my GT-I9000 using Tapatalk
laboratik said:
Next I tried to decompile the framework-res.apk.
Got errors from apktool, saying that it can't decompile a nine patch image. The nine patch image does not contain a nine patch chunk (so not really a nine patch but png with .0.png extension?)
Click to expand...
Click to collapse
to decompile framework-res use this: http://forum.xda-developers.com/showthread.php?t=745189
I use it for my personal rom and works better.
apktool or apkmanager don't work better with samsung framework-res,because Samsung don't respect the standard image and there are a lot of errors that can you correct using draw9patch from SDK,but in this way must edit all pngs...and they are a lot.
texture said:
to decompile framework-res use this: http://forum.xda-developers.com/showthread.php?t=745189
I use it for my personal rom and works better.
apktool or apkmanager don't work better with samsung framework-res,because Samsung don't respect the standard image and there are a lot of errors that can you correct using draw9patch from SDK,but in this way must edit all pngs...and they are a lot.
Click to expand...
Click to collapse
doesnt really help as it still uses apktool. I tried to build the lockscreen mod for my ROM with it
just delete them.nothing will be happened

[Q] Deodexed Theme Template or equivalent?

Hi all,
Wondering if anyone has made a stock theme template for the Shift? All I see are ROMs but I like to mess around with a clean stock deodexed system for a while before I flash a full ROM. I would make one myself but I'm still learning how the update-script/updater-script works. Is there one, or does everyone just flash ROMs around here? Closest I've found is the theme eraser, but that assumes you're already deodexed (no .odex removal script). Any help would be appreciated, links to guides, tutorials, how CWM works, a stock theme template, anything. And thanks in advance.
http://forum.xda-developers.com/showthread.php?t=948566
there ya go
Thank you, but this is a full ROM not a theme template.
Sent from my PG06100 using Tapatalk
Are you looking for the stock framework then?
Sent from my PG06100 using XDA App
Basically just the /system/app and /system/framework dirs deodexed. no other changes to the system folder. And a script that removes the odex files. Can that be run with just an update-script, or would it need other things?
Sent from my PG06100 using Tapatalk
Just unzip the zip file from the thread foxsdaddy67 linked & you have access to those two deodexed directories.
I guess I'm not being clear enough. I'm aware those files are there, what I don't understand is how cwm works. I'm coming from sdx where every rom, theme and mod had the same structure with only an update script in meta-inf. By testing I did find out that just having an update script works though I'm not sure if a script will run. Guess I'll have to test it.
Bottom line is that there is no flashable theme template zip, only roms, but I think I'll be fixing that shortly.
Sent from my PG06100 using Tapatalk
Tambourineman is developing for the Shift?!? THATS AWESOME!!
No, I'm not. Just an end user.

[Q] Edit System APK

Hi all
I have a Samsung Galaxy mini (S5570L) and I'm trying to edit Phone.apk, I wanna replace the unknown caller picture for the stock android picture, I already managed to do that but I have 2 questions:
1) When I try to replace Phone.apk with the one I edited the phone starts vibrating uncontrollably and I can't seem to be able to do pretty much anything, is there any special treatment when editing system APKs??
2) The stock Samsung ROM is odexed so I know editing and replacing the APK isn't as simple as it sounds, what else do I need to do after zipping the APK in APK Manager??
Thanx for you help
P.S.: This is a wild idea but is there a way to change the TouchWiz Phone.apk for the stock Froyo Phone.apk??
Akath19 said:
Hi all
I have a Samsung Galaxy mini (S5570L) and I'm trying to edit Phone.apk, I wanna replace the unknown caller picture for the stock android picture, I already managed to do that but I have 2 questions:
1) When I try to replace Phone.apk with the one I edited the phone starts vibrating uncontrollably and I can't seem to be able to do pretty much anything, is there any special treatment when editing system APKs??
2) The stock Samsung ROM is odexed so I know editing and replacing the APK isn't as simple as it sounds, what else do I need to do after zipping the APK in APK Manager??
Thanx for you help
P.S.: This is a wild idea but is there a way to change the TouchWiz Phone.apk for the stock Froyo Phone.apk??
Click to expand...
Click to collapse
To 2.
It causes issues if u have some odexed and one deodexed apk so u should deodex all apks.
1. Do a logcat to find out what's wrong .
Did u push the file via adb?
And u should sign the apk ...
Sent from my HTC HD2 using XDA Premium App
Thanx man, turns out I needed to deodex the APK before editing (which I didn't know).
I've got another question, since I'm using a stock Samsung ROM should I deodex all the system and framework apps?? 'Cause that sounds like a huge amount of work
Sent from my GT-S5570L using XDA App
Akath19 said:
Thanx man, turns out I needed to deodex the APK before editing (which I didn't know).
I've got another question, since I'm using a stock Samsung ROM should I deodex all the system and framework apps?? 'Cause that sounds like a huge amount of work
Sent from my GT-S5570L using XDA App
Click to expand...
Click to collapse
You are welcome
Try dsixdas kitchen which can deodexe all apks of ur Rom.deodexing makes the Rom faster.
Sent from my HTC HD2 using XDA Premium App

Odex -> <- Problem / Confusion

I know the technical difference b/w ODex-ed and DeODex-ed
I have an odexed ROM
I simply want some applications (apks) from my Previous ROM, which was deodexed
When I PUT .apk files from My Previous ROMs ZIP to my Device's system/app - I get FC
When I restore apps like Go Launcher Ex, from Titanium Backup, I still get FC for that
Any Info...?
I want to use some apps from my Previous ROM
I want Rotary LockScreen
Also, a Professional Theme, Odexed
As I have seen that odexed ROM are so incredibly smooth in almost every aspect
(Not only 1st boot or initial days)
Help appreciated !!
the anserw is simle if your previous firmware was deodexed:
Youraplicationname.odex is missing
@$omator --
Deleting th old apk & dex file, bfore replacing, should work, then?
Sent from my GT-I9000 using xda premium
you must either have all files in pairs apk + odex (thats odex)
or apk only (thats deodexed)
when looking at /system/framework/
that would be jar + odex (odex) or jar only (deodexed)
@$omator
I am talking bout MyFiles.apk
I want new Samsung's MyFiles.apk
So I will delete old apk & dex files
Then put new apk file
Is tht wht u mean?
Sent from my GT-I9000 using xda premium
if you now have aapk+odex
you have to copy new apk and odex
om.thelostone said:
@$omator
I am talking bout MyFiles.apk
I want new Samsung's MyFiles.apk
So I will delete old apk & dex files
Then put new apk file
Is tht wht u mean?
Sent from my GT-I9000 using xda premium
Click to expand...
Click to collapse
I'm pretty sure I tried this some time ago and found it will not work. The MyFiles.apk is strictly linked to the ROM you are using, something to do with the framework, so you cannot use one on another ROM version.
As for other apk's, if the file you want to use is deodexed, you simply delete the new apk and odex file and put the old one in its place although be warned, it may cause instability on your ROM if you do this with system apk files
ok whatever if you know better
$omator said:
ok whatever if you know better
Click to expand...
Click to collapse
Woah chill on the attitude, I was only offering some help based on my experience with trying the same thing
bigdyl69 said:
I'm pretty sure I tried this some time ago and found it will not work. The MyFiles.apk is strictly linked to the ROM you are using, something to do with the framework, so you cannot use one on another ROM version.
As for other apk's, if the file you want to use is deodexed, you simply delete the new apk and odex file and put the old one in its place although be warned, it may cause instability on your ROM if you do this with system apk files
Click to expand...
Click to collapse
Yup
Thanks
U got my doubt clear
I was not replacing MyFiles actually
Was just giving an example so that $omator thinks I understood
Also
The irony is most of th times, its th system apks tht have dex files
If its not a system apk, I wud rather download th latest 4m market
Sent from my GT-I9000 using xda premium

[Q] Deodexing problem

Hello, I'm an owner of XPERIA Z1, using the latest Customized Lollipop firmware (.242), struggling very much to deodex his device. I've tried 2 different methods, which both lead to problems:
1.) Using a flashable zip provided by venkat kamesh, in this thread: link. After flashing, I don't face any prominent problems, like FCs on system apps e.t.c. But whenever I'm trying to launch any app requiring OpenGL ES 2 , I get an error message/toast notification, about that, saying that my device is incompatible. And Google Play refuses to even show these apps in the search results, listing them as incompatible.
2.) Modifying the flashable zip to use my own /app, /priv-app, /framework, and even /vendor/apps fully deodexed folders, leading to a bootloop, and refusing to show more than 2 seconds of the bootanimation before rebooting. I thought that some package may be incompatible with my firmware, but this theory can't be proved yet.
*I've tried fixing permisions using both terminaland adb using this method: link. No result either.
Is there any other solution? Thank you!
NFS_FM said:
Hello, I'm an owner of XPERIA Z1, using the latest Customized Lollipop firmware (.242), struggling very much to deodex his device. I've tried 2 different methods, which both lead to problems:
1.) Using a flashable zip provided by venkat kamesh, in this thread: link. After flashing, I don't face any prominent problems, like FCs on system apps e.t.c. But whenever I'm trying to launch any app requiring OpenGL ES 2 , I get an error message/toast notification, about that, saying that my device is incompatible. And Google Play refuses to even show these apps in the search results, listing them as incompatible.
2.) Modifying the flashable zip to use my own /app, /priv-app, /framework, and even /vendor/apps fully deodexed folders, leading to a bootloop, and refusing to show more than 2 seconds of the bootanimation before rebooting. I thought that some package may be incompatible with my firmware, but this theory can't be proved yet.
*I've tried fixing permisions using both terminaland adb using this method: link. No result either.
Is there any other solution? Thank you!
Click to expand...
Click to collapse
Are you deodexing every odexed file? I normally only deodex those files whose smali I'm going to mod. There's not much point deodexing anything else..
Ticklefish said:
Are you deodexing every odexed file? I normally only deodex those files whose smali I'm going to mod. There's not much point deodexing anything else..
Click to expand...
Click to collapse
Well yes, I just suppose that a fully odexed or deodexed system is more stable than a mix of those two.
Is there any red-line that I must not pass? Like a paricular .apk or .jar file, for example. Also on KitKat, we had to have fully deodexed system for some mods to work (like the 4K Mod by Chocolatetrain). This restriction doesn't exist on Lollipop, which utilises ARM?
NFS_FM said:
Well yes, I just suppose that a fully odexed or deodexed system is more stable than a mix of those two.
Is there any red-line that I must not pass? Like a paricular .apk or .jar file, for example. Also on KitKat, we had to have fully deodexed system for some mods to work (like the 4K Mod by Chocolatetrain). This restriction doesn't exist on Lollipop, which utilises ARM?
Click to expand...
Click to collapse
No. You can, in theory, deodex as many or as few APK and JAR files as you like.
The whole point of deodexing is to make it easy to change smali files. It doesn't affect stability or performance, it's solely for modding. I normally deodex SystemUI.apk, framework.jar and android.policy.jar then leave the rest of the odexed files alone.
(Well, technically a deodexed ROM takes longer to boot if the Dalvik cache has been wiped but that's about it.)
The only reason I ask is that, if you only need to deodex a few files, there are various tools available for deodexing individual files instead of whole ROM's. I could mention that Tickle My Android can do it but that'd be a bit cheeky.
Oh, looking at that 4K mod you mentioned, it doesn't actually need the whole ROM to be deodexed. But there are so many files that are being replaced that do need to be deodexed that it's probably just simpler to say the entire ROM needs to be.
Ticklefish said:
No. You can, in theory, deodex as many or as few APK and JAR files as you like.
The only reason I ask is that, if you only need to deodex a few files, there are various tools available for deodexing individual files instead of whole ROM's. I could mention that Tickle My Android can do it but that'd be a bit cheeky.
Click to expand...
Click to collapse
OK, thank you for the answer, I will try then deodexing just the essentials: SystemUI.apk, framework.jar, framework-res.apk and SemcGenericUxpRes.apk
Final question, as I see in your program's thread, Lollipop editing/deodexing is not supported yet, so do you recommend an automate tool for the deodexing process (like JoelDroidLollipopBatchDeodexe or any other), or the manual method?
NFS_FM said:
OK, thank you for the answer, I will try then deodexing just the essentials: SystemUI.apk, framework.jar, framework-res.apk and SemcGenericUxpRes.apk
Final question, as I see in your program's thread, Lollipop editing/deodexing is not supported yet, so do you recommend an automate tool for the deodexing process (like JoelDroidLollipopBatchDeodexe or any other), or the manual method?
Click to expand...
Click to collapse
TMA does support deodexing of Lollipop APK files...I just can't guarantee that it'll be able to deodex everything. Guess I need to reword the OP....lol
NFS_FM said:
OK, thank you for the answer, I will try then deodexing just the essentials: SystemUI.apk, framework.jar, framework-res.apk and SemcGenericUxpRes.apk
Final question, as I see in your program's thread, Lollipop editing/deodexing is not supported yet, so do you recommend an automate tool for the deodexing process (like JoelDroidLollipopBatchDeodexe or any other), or the manual method?
Click to expand...
Click to collapse
you also can use advance apktool (nice tool) , but you will have to update the apktool to the last one i think its the 2.0.0because is not updated.. cheers
juanpirulo said:
you also can use advance apktool (nice tool) , but you will have to update the apktool to the last one i think its the 2.0.0because is not updated.. cheers
Click to expand...
Click to collapse
Hm... I will try that too if my (already) deodexed apks won't work, thank you.
Please ask in the Q&A section for your device.
Cross device section is for development only
Thread closed

Categories

Resources