REAndroid / APKEditor

Powerful android apk editor - aapt/aapt2 independent
Apache License 2.0
843 stars 125 forks source link

Resources are changed after a rebuild #97

Closed Zenlua closed 5 months ago

Zenlua commented 5 months ago

Version: 1.3.7

REAndroid commented 5 months ago

We can't reproduce this issue without the apk. The attr case needs further investigation. On second dimen case the problem comes from java's float number division/multiplication accuracy, normally it is less than +/- 0.00005, for some reason if you want to keep original value you need to use json format

Zenlua commented 5 months ago

https://gofile.io/d/3pZ7xr

Here is the apk, thanks

Zenlua commented 5 months ago

Same issue, this is the last I know of, the tool is improving day by day.

Screenshot_20240406-200634

File apk: https://mega.nz/file/VNlwUYRA#1sJD4ZRy2bvWWd3OG8ZfjEH7jg5coBAypZAfiHwrhZE

REAndroid commented 5 months ago

I can't reproduce your issue, i did DECOMPILE -> COMPILE -> DECOMPILE , then the output is the same. How you did your comparison ?

Zenlua commented 5 months ago

Use apktool or another decoder to see, I use mt manager to compare resources.arsc

REAndroid commented 5 months ago

APKEditor is different from other tools our main goal is to produce editable files so that you can build it back correctly to working apk. Where as apktool intended to produce android standard source code, check #51 . formats="reference|string|integer|bool|color|float|dimension|fraction" is equivalent to format=any thus you are free to code it like <attr name="__removed3" >.

Q: Why APKEditor is not stripping away format=any like other tools?

A:

During encoding we don't rely/trust xml tag name. Some obfuscators may use different name <abcd name="__removed3" >, but we need to correctly identify the type of entry is attribute, style or plural therefore our logic is:

Zenlua commented 5 months ago

Thank you for your explanation. Great tool. Wishing you a good life.