FORUMS
Remove All Ads from XDA

[TOOL] Tickle My Android - Decompile & Recompile With Ease

6,667 posts
Thanks Meter: 8,481
 
By Ticklefish, Recognized Themer on 3rd May 2012, 04:15 PM
Post Reply Email Thread
Announcement from Ticklefish: Version 16.1 Now Available!
22nd November 2016, 01:23 PM |#5871  
Quote:
Originally Posted by nujackk

Yep here they are. If it makes a difference its a ZTE Axon 7. trying to add 3minit and change signal icon to steel blue.
SystemUI too big to upload here is link https://www.dropbox.com/s/m9ba3t1oca...I_ZTE.apk?dl=0

This is why your APK won't recompile:

Code:
W: res\drawable-v19\stat_sys_signal_0.xml:0: error: Resource entry stat_sys_signal_0 is already defined.
W: res\drawable-v19\stat_sys_signal_0.png:0: Originally defined here.
You have a lot of these sort of errors in the recompile log. This is because your APK uses XML files to draw the signal icons (these are known as 'Drawable Vectors') and you've used TMA to add a load of PNG files with the same filename. Apktool doesn't like it when two or more files have the same filename in the same folder and that's why the recompile fails.

All you need to do is go into your "drawable-v19" and "drawable-v21" folders and delete all the "stat_sys_signal_*.xml" files that you have a matching PNG file for.

Quote:
Originally Posted by edzamber

@Ticklefish,

I think there is an inversion for recompil between option 2 and option 4 (7.0+).

I have mod my SystemUI (6.0.1 Samsung base) with option 2 and at the end of compilation, there is a lot of files witch are copy (ressources.arsc, qmg...). It result that it break something on my phone into data/system/users/0/runtime-permissions.xml. Then if i flash a vrtheme for change some png into my systemUI, statusbar disappeare, SystemUI is broken.

If i recompil with option 4 (7.0+), no files are copyed at the end of compilation, no problem, everything working, even if i flash my vrtheme.

Option 2 creates a copy of the original APK and then copies the res folder into it, along with the manifest and the classes.dex. This is to keep the signature the same.

With Option 4, you can't keep the signature the same as Nougat won't accept it. So TMA deletes the SEC-INF folder (if it exists) in the new APK and signs it with a new signature.

It sounds like some files in your original APK aren't being put into the recompiled one. This sadly has happened before and was discussed here: http://forum.xda-developers.com/show...postcount=5854
I've reported this bug to apktool's developer here: https://github.com/iBotPeaches/Apktool/issues/1366
Have a look at the number of files in your original res folder and the recompiled one. If there's a difference that's probably what's causing the problem.
The Following 2 Users Say Thank You to Ticklefish For This Useful Post: [ View ] Gift Ticklefish Ad-Free
22nd November 2016, 01:31 PM |#5872  
Senior Member
Flag Kent
Thanks Meter: 88
 
More
Ok, I'll try it with just the 3minit files. Only thing I'm adding there is 3 smali files. Any chance I could get copy of older version of TMA to test. Can't find it anywhere
22nd November 2016, 01:46 PM |#5873  
edzamber's Avatar
Senior Member
Thanks Meter: 3,400
 
Donate to Me
More
Quote:
Originally Posted by Ticklefish



Option 2 creates a copy of the original APK and then copies the res folder into it, along with the manifest and the classes.dex. This is to keep the signature the same.

With Option 4, you can't keep the signature the same as Nougat won't accept it. So TMA deletes the SEC-INF folder (if it exists) in the new APK and signs it with a new signature.

It sounds like some files in your original APK aren't being put into the recompiled one. This sadly has happened before and was discussed here: http://forum.xda-developers.com/show...postcount=5854
I've reported this bug to apktool's developer here: https://github.com/iBotPeaches/Apktool/issues/1366
Have a look at the number of files in your original res folder and the recompiled one. If there's a difference that's probably what's causing the problem.

Thanks for theses explanations !
Yes its that, recompiled files with option 2 are less than with option 4.

Anyway it working with option 4 so maybe my SystemUI needed to use N recompil instead of normal one
22nd November 2016, 03:04 PM |#5874  
Quote:
Originally Posted by nujackk

Ok, I'll try it with just the 3minit files. Only thing I'm adding there is 3 smali files. Any chance I could get copy of older version of TMA to test. Can't find it anywhere


I tried recompiling it with the 3minit mod and it worked without any trouble at all. It's up to you whether you put a new signal icon on or not. Yes you have to delete some files but there's only a few to deal with.


I can link to the previous version if you want, just let me know if you have any recompiling trouble. The previous versions will all do the same thing though...

Quote:
Originally Posted by edzamber

Thanks for theses explanations !
Yes its that, recompiled files with option 2 are less than with option 4.

Anyway it working with option 4 so maybe my SystemUI needed to use N recompil instead of normal one

It's more that Samsung need to stop messing around and making weird APK files..

Can you share your files please? I'll add them to my bug report on the apktool github and it should help get this fixed.
The Following 2 Users Say Thank You to Ticklefish For This Useful Post: [ View ] Gift Ticklefish Ad-Free
22nd November 2016, 04:30 PM |#5875  
edzamber's Avatar
Senior Member
Thanks Meter: 3,400
 
Donate to Me
More
Quote:
Originally Posted by Ticklefish



It's more that Samsung need to stop messing around and making weird APK files..

Can you share your files please? I'll add them to my bug report on the apktool github and it should help get this fixed.

Sure, i send you in PM

Edit : PM sended
The Following User Says Thank You to edzamber For This Useful Post: [ View ] Gift edzamber Ad-Free
22nd November 2016, 07:46 PM |#5876  
Senior Member
Flag Kent
Thanks Meter: 88
 
More
Quote:
Originally Posted by Ticklefish

I tried recompiling it with the 3minit mod and it worked without any trouble at all. It's up to you whether you put a new signal icon on or not. Yes you have to delete some files but there's only a few to deal with.


I can link to the previous version if you want, just let me know if you have any recompiling trouble. The previous versions will all do the same thing though...

I have no problem deleting files, its just that 3minit is the priority for me at the moment. And i had same issue with just 3minit mod.
izarcc crash and failure. Now i should mention I am attempting to recompile with original signature. As i am under the assumption systemui with different signature would fc continuously or something like that.
It will recompile with new signature for me no problem. But although i have added 3 files it comes out slightly smaller then original. 53.3mb orig and 52.9 on new sig apk.
I have not dared test it yet.
22nd November 2016, 08:32 PM |#5877  
Quote:
Originally Posted by edzamber

Sure, i send you in PM

Edit : PM sended

Thank you!

Quote:
Originally Posted by nujackk

I have no problem deleting files, its just that 3minit is the priority for me at the moment. And i had same issue with just 3minit mod.
izarcc crash and failure. Now i should mention I am attempting to recompile with original signature. As i am under the assumption systemui with different signature would fc continuously or something like that.
It will recompile with new signature for me no problem. But although i have added 3 files it comes out slightly smaller then original. 53.3mb orig and 52.9 on new sig apk.
I have not dared test it yet.

I was able to recompile with original signature without any problem. Izarcc didn't cause any trouble. Odd. Are you able to share a screenshot of the error at all?

It's not unusual for the recompiled APK to be smaller than the original one. The smali files aren't that big. It's just the way it's compressed.
You can test the new file. Just, as always, make sure you have a backup in case it doesn't work. I generally always have a ZIP file with a stock SystemUI.apk on my SDCArd just to play it safe.
22nd November 2016, 09:00 PM |#5878  
Senior Member
Flag Kent
Thanks Meter: 88
 
More
Quote:
Originally Posted by Ticklefish

Thank you!



I was able to recompile with original signature without any problem. Izarcc didn't cause any trouble. Odd. Are you able to share a screenshot of the error at all?

had to do 2 shots to get details but here ya go.
Attached Thumbnails
Click image for larger version

Name:	screen1.jpg
Views:	114
Size:	118.2 KB
ID:	3945113   Click image for larger version

Name:	screen2.jpg
Views:	112
Size:	63.0 KB
ID:	3945114  
22nd November 2016, 09:13 PM |#5879  
Senior Member
Flag Kent
Thanks Meter: 88
 
More
Think I will try it on my windows 7 machine later today see what happens.
Update: worked fine on win 7 machine, so guess problem with my laptop. Think i should check the memory on there. maybe bad stick or something.
Just waiting on answer from Gharrington about 3minit before I test it.
Thank you for all your help. And this great tool. Get to try stuff I had to ask others for.
The Following User Says Thank You to nujackk For This Useful Post: [ View ] Gift nujackk Ad-Free
26th November 2016, 10:38 AM |#5880  
MaFiBoSS's Avatar
Senior Member
Flag 404 not found
Thanks Meter: 50
 
More
Quote:
Originally Posted by Ticklefish

I'll be honest..I'm completely perplexed by this. I don't know why the APK made by v14.2 doesn't work and the one made by v14.1 does..


Recompiling with the original signature works a bit differently in each version. In 14.1, apktool 2.2.0 has the ability to copy the original META-INF and SEC-INF folders into the new APK so TMA just uses that. Apktool 2.2.1 removed that ability so the v14.2 instead creates a copy of the original APK in the _out folder and copies the res folder, classes.dex and resources.arsc into that.
I did wonder if your issue could be caused by a different compression rate. Maybe v14.2 compressed a certain file in a different way to v14.1 and it's causing a FC. But all the obvious candidates seem to be compressed correctly. There are a few differences but nothing that should cause a problem.


Hang on a second...


Your original APK has more files in the "drawable" folder than the recompiled v14.2 APK. All your stat_sys_wifi_captive*.pio files are missing in the new app. It looks like apktool is completely ignoring them.
I think we may have a genuine apktool bug on our hands here, which may well explain why the new file doesn't run.


I'll report this on the apktool thread and we should hopefully have a resolution soon.


Oh, I'm also seeing a lot of Touchwiz files in here. Should have known that it would be Samsung causing trouble again..lol

Ok, thanks again for your support in trying to explain this "bug"

and a lot of patient to Touchwiz of Sam .
The Following User Says Thank You to MaFiBoSS For This Useful Post: [ View ] Gift MaFiBoSS Ad-Free
26th November 2016, 07:05 PM |#5881  
Quote:
Originally Posted by MaFiBoSS

Ok, thanks again for your support in trying to explain this "bug"

and a lot of patient to Touchwiz of Sam .

You have to be patient with Samsung. They do some amazing phones but their roms are horrible..
The Following User Says Thank You to Ticklefish For This Useful Post: [ View ] Gift Ticklefish Ad-Free
Post Reply Subscribe to Thread

Tags
apktool, decompile, recompile, smali, xml

Guest Quick Reply (no urls or BBcode)
Message:
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes