The OnePlus 6 is officially on sale! Buy now →
FORUMS
Remove All Ads from XDA
OnePlus 6 On Sale

[UTIL] Apktool - Tool for reverse engineering apk files

921 posts
Thanks Meter: 4,198
 
Post Reply Email Thread
30th March 2018, 07:04 AM |#5341  
edzamber's Avatar
Senior Member
Thanks Meter: 3,193
 
Donate to Me
More
Quote:
Originally Posted by Thebear j koss

What happens with no changes? Does it build and install? Are you trying to change that drawer shadow? From the log it looks like it is reading 2 versions of that resource. Do you have that as an xml or color as well as the png somewhere?

If i decompil and recompil without any changes, its the same problem... I have look about drawer shadow
with textscrawler but nothing match except png. I Wonder if there is not a security protection from Google in New Playstore 9.4.18. I havn't Any issue with 9.2.32.
The Following User Says Thank You to edzamber For This Useful Post: [ View ] Gift edzamber Ad-Free
 
 
30th March 2018, 03:48 PM |#5342  
Ibuprophen's Avatar
Senior Member
Flag Upstate New York
Thanks Meter: 3,399
 
Donate to Me
More
Quote:
Originally Posted by edzamber

If i decompil and recompil without any changes, its the same problem... I have look about drawer shadow with textscrawler but nothing match except png. I Wonder if there is not a security protection from Google in New Playstore 9.4.18. I havn't Any issue with 9.2.32.

To be honest...

I know something is different with the newer Play Store because I use an older version and, until recently, I was able to submit feedback and now I can't. Everything else works still but, that.


~~~~~~~~~~~~~~~
I DO NOT provide support via PM unless asked/requested by myself. PLEASE keep it in the threads where everyone can share.
4th April 2018, 05:58 PM |#5343  
Member
Thanks Meter: 4
 
More
Which version is right for Xiaomi Mi A1?

Sorry wrong thread
6th April 2018, 10:18 PM |#5344  
iBotPeaches's Avatar
OP Recognized Developer
Flag Tampa
Thanks Meter: 4,198
 
Donate to Me
More
Time for my ever so-often update for the crowd here. This morning I merged a feature that fixed a Windows issue with commands becoming too long. This happens with applications built by Unity (and others), as assets are frequently stored or compressed which Apktool needs to know about. Apktool then passes a command to aapt which is sometimes upwards of 3,000 characters in length. Windows is the only operating system that has a problem about this. I did a solid amount of research (#1 / #2 / #3) in hopes to "stage" the steps that aapt does. This would allow Windows to work around the small limitation it has when it comes to commands.

I ended up building my own "apk" builder, which was nothing more than a glorified .zip creator. It took compression type into account when adding files into the application. The problem is that you can't modify the compression type of a file in a zip easily using only aapt. The options are basically, remove that file and then re-add it with the compression type you prefer. So if I accidentally built the application with a compressed "ic_sysbar_back_carmode.webp" file, then I needed to remove that file before I attempted adding it again in the STORED format. This took some engineering, hence why the pull request ended up changing a good deal of code. I basically don't add files to the application that I intend to add manually without compression. It finally worked and I was excited, it passed all testing and was merged.

Unfortunately, success was short-lived. As a side affect of now storing the entire directory path of the file, we included the directory the asset in question was from. In the example above this was "SystemUI/res/drawable-ldrtl-xxhdpi-v4/ic_sysbar_back_carmode.webp".

Apktool works by decoding the resources.arsc which leads to decoding each configuration in the application and finding resources in that configuration. We can see that the configuration above is "ldrtl-xxhdpi-v4", but aapt and by extension Apktool don't see the "v4" portion.
➜ Bug1761 aapt d configurations SystemUI.apk | grep 'ldrtl-xxxhdpi'
ldrtl-xxxhdpi
This is because "v4" is an implicit sdk version added by the aapt binary. No one building this example application added that qualifier, it was automatic. Here comes the problem. The 56 byte header for that qualifier does not list anything about an SDK version. It only tells me "ldtrl" and "xxhdpi", if the qualifiers used were from API21 like "notround", then its obvious to know a SDK level should be added. This qualifier was added by aapt/aapt2 because it scanned a massive hardcoded list of attributes in order to determine what qualifier that resource should be under. It actually does this crazy thing and "strip" resources to versioned qualifiers on its own. The long story is Apktool does not read the file (AXML) to determine the attributes used, so it cannot determine this. It might be able too in the future, but Java is not blazing speed low level C++. It would have to use like an XML reader (PullParser) to read each attribute. It therefore, currently, drops those version qualifiers unless they were explicitly provided. This means an uncompressed asset is recorded in file-system, but then the qualifier processed file-path is different (missing the implicit version qualifier).

This means my patch broke lots of applications (None of which that were in testing). This caused errors like
java.io.FileNotFoundException: SystemUI/res/drawable-ldrtl-xxhdpi-v4/ic_sysbar_back_carmode.webp (No such file or directory)
So I had to revert the fix. This means Windows support for large application is still broken. It means that version v2.3.2 will have a release this weekend, but not with all the intended features I hoped. I apologize and we will fix these in time.
The Following 18 Users Say Thank You to iBotPeaches For This Useful Post: [ View ]
7th April 2018, 09:36 PM |#5345  
iBotPeaches's Avatar
OP Recognized Developer
Flag Tampa
Thanks Meter: 4,198
 
Donate to Me
More
A new version has been released!

v2.3.2 (Released April, 7, 2018)

Quote:

  • [#1742] - Android P Preview Support
  • [#1689] - Initial support for rebuilding with aapt2 binary
  • [#1730] - Fixed issue with application with empty resources.arsc file
  • [#1703] - Fixed issue with root depth kotlin folder
  • [#1741] - Fixed building Apktool on Windows.
  • Added warning if application is non-zero typeIdOffset is discovered.
  • Update to baksmali v2.2.2
  • Support for treating additional photo extensions as raw (m4a)
  • Prevent temporary BRUT files from clogging temp directories.

Download: https://bitbucket.org/iBotPeaches/ap...tool_2.3.2.jar
md5 - 953ed8a553becac4e713d1073912f15f
sha256 - 648dba910d49365d78665f7060935802f4187d5529064e16ca f34eee06cb5207

Details of Release: https://connortumbleson.com/2018/04/...-3-2-released/
The Following 26 Users Say Thank You to iBotPeaches For This Useful Post: [ View ]
7th April 2018, 10:05 PM |#5346  
danyldft's Avatar
Senior Member
Thanks Meter: 49
 
More
Quote:
Originally Posted by iBotPeaches

A new version has been released!

v2.3.2 (Released April, 7, 2018)



Download: https://bitbucket.org/iBotPeaches/ap...tool_2.3.2.jar
md5 - 953ed8a553becac4e713d1073912f15f
sha256 - 648dba910d49365d78665f7060935802f4187d5529064e16ca f34eee06cb5207

Details of Release: https://connortumbleson.com/2018/04/...-3-2-released/

Thanks for your great work

Enviado desde mi ZP951 mediante Tapatalk
8th April 2018, 06:18 AM |#5347  
kos25k's Avatar
Senior Member
Thanks Meter: 318
 
More
hello and happy Easter!Newbie here.(to be honest I never used apktool) So i'll tell my story and I would be really very thankful if someone could help me.So,I bought a prerooted Vorke Z6 tv box.But the problem is that the tv app from my provider that I pay monthly,doesn't run cause it detects root.I tryied rootcloack xposed module but it doesn't work.The decoder is on my father on the 1st floor so I can only use the app to watch tv.So I would love a kindful dude to decompile my app not to detect root.or at least someone to tell me a working method to do myself.Here is my app.I hope for help.Thanks.
https://drive.google.com/file/d/1RQ4...w?usp=drivesdk
8th April 2018, 06:12 PM |#5348  
djdarkknight96's Avatar
Recognized Themer
Flag Springfield
Thanks Meter: 45,050
 
Donate to Me
More
Quote:
Originally Posted by kos25k

hello and happy Easter!Newbie here.(to be honest I never used apktool) So i'll tell my story and I would be really very thankful if someone could help me.So,I bought a prerooted Vorke Z6 tv box.But the problem is that the tv app from my provider that I pay monthly,doesn't run cause it detects root.I tryied rootcloack xposed module but it doesn't work.The decoder is on my father on the 1st floor so I can only use the app to watch tv.So I would love a kindful dude to decompile my app not to detect root.or at least someone to tell me a working method to do myself.Here is my app.I hope for help.Thanks.
https://drive.google.com/file/d/1RQ4...w?usp=drivesdk

There is no guide or anything to fix this, you need to hide root in the system. Magisk and SuperSU can do this already. Try using one of those to root if possible. Otherwise you might be stuck.
The Following 2 Users Say Thank You to djdarkknight96 For This Useful Post: [ View ] Gift djdarkknight96 Ad-Free
8th April 2018, 06:31 PM |#5349  
ANDROIDXFOREVER's Avatar
Senior Member
Flag sanremo
Thanks Meter: 365
 
Donate to Me
More
Quote:
Originally Posted by iBotPeaches

Time for my ever so-often update for the crowd here. This morning I merged a feature that fixed a Windows issue with commands becoming too long. This happens with applications built by Unity (and others), as assets are frequently stored or compressed which Apktool needs to know about. Apktool then passes a command to aapt which is sometimes upwards of 3,000 characters in length. Windows is the only operating system that has a problem about this. I did a solid amount of research (#1 / #2 / #3) in hopes to "stage" the steps that aapt does. This would allow Windows to work around the small limitation it has when it comes to commands.

I ended up building my own "apk" builder, which was nothing more than a glorified .zip creator. It took compression type into account when adding files into the application. The problem is that you can't modify the compression type of a file in a zip easily using only aapt. The options are basically, remove that file and then re-add it with the compression type you prefer. So if I accidentally built the application with a compressed "ic_sysbar_back_carmode.webp" file, then I needed to remove that file before I attempted adding it again in the STORED format. This took some engineering, hence why the pull request ended up changing a good deal of code. I basically don't add files to the application that I intend to add manually without compression. It finally worked and I was excited, it passed all testing and was merged.

Unfortunately, success was short-lived. As a side affect of now storing the entire directory path of the file, we included the directory the asset in question was from. In the example above this was "SystemUI/res/drawable-ldrtl-xxhdpi-v4/ic_sysbar_back_carmode.webp".

Apktool works by decoding the resources.arsc which leads to decoding each configuration in the application and finding resources in that configuration. We can see that the configuration above is "ldrtl-xxhdpi-v4", but aapt and by extension Apktool don't see the "v4" portion.

➜ Bug1761 aapt d configurations SystemUI.apk | grep 'ldrtl-xxxhdpi'
ldrtl-xxxhdpi
This is because "v4" is an implicit sdk version added by the aapt binary. No one building this example application added that qualifier, it was automatic. Here comes the problem. The 56 byte header for that qualifier does not list anything about an SDK version. It only tells me "ldtrl" and "xxhdpi", if the qualifiers used were from API21 like "notround", then its obvious to know a SDK level should be added. This qualifier was added by aapt/aapt2 because it scanned a massive hardcoded list of attributes in order to determine what qualifier that resource should be under. It actually does this crazy thing and "strip" resources to versioned qualifiers on its own. The long story is Apktool does not read the file (AXML) to determine the attributes used, so it cannot determine this. It might be able too in the future, but Java is not blazing speed low level C++. It would have to use like an XML reader (PullParser) to read each attribute. It therefore, currently, drops those version qualifiers unless they were explicitly provided. This means an uncompressed asset is recorded in file-system, but then the qualifier processed file-path is different (missing the implicit version qualifier).

This means my patch broke lots of applications (None of which that were in testing). This caused errors like
java.io.FileNotFoundException: SystemUI/res/drawable-ldrtl-xxhdpi-v4/ic_sysbar_back_carmode.webp (No such file or directory)
So I had to revert the fix. This means Windows support for large application is still broken. It means that version v2.3.2 will have a release this weekend, but not with all the intended features I hoped. I apologize and we will fix these in time.

thanks bro for your hard work you is incredible
8th April 2018, 07:05 PM |#5350  
kos25k's Avatar
Senior Member
Thanks Meter: 318
 
More
Quote:
Originally Posted by djdarkknight96

There is no guide or anything to fix this, you need to hide root in the system. Magisk and SuperSU can do this already. Try using one of those to root if possible. Otherwise you might be stuck.

how to hide root with supersu dude?I tryied everything without success..
8th April 2018, 08:22 PM |#5351  
haqanguven's Avatar
Senior Member
Flag İzmir
Thanks Meter: 346
 
More
Quote:
Originally Posted by iBotPeaches

A new version has been released!

v2.3.2 (Released April, 7, 2018)



Download: https://bitbucket.org/iBotPeaches/ap...tool_2.3.2.jar
md5 - 953ed8a553becac4e713d1073912f15f
sha256 - 648dba910d49365d78665f7060935802f4187d5529064e16ca f34eee06cb5207

Details of Release: https://connortumbleson.com/2018/04/...-3-2-released/

Android 8 for Miui9 Work...
Thanks
Post Reply Subscribe to Thread

Tags
apktool, apktools, customise apk, decompile, edit apk, recompile, reverse

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

Advanced Search
Display Modes