APKEditor icon indicating copy to clipboard operation
APKEditor copied to clipboard

Resource file size doubles when recompiled, AndroidManifest.xml problem

Open Zenlua opened this issue 1 year ago • 7 comments

Screenshot_2024-05-08-16-28-15-698_bin mt plus-edit

After adding some text the size has doubled the original file

Second problem

When this file AndroidManifest.xml is not repaired, copy the original file, this will not damage the apk, in apkeditor it will be edited again which will cause some system apk to be corrupted.

Zenlua avatar May 08 '24 09:05 Zenlua

Can't help without sample

REAndroid avatar May 08 '24 20:05 REAndroid

sample.zip

File number 2 has been edited

Things added to resources

<public id="0x11089871" type="drawable" name="pop_camera_high_wave" />
<public id="0x11089872" type="drawable" name="pop_camera_high_wave1" />
<public id="0x11089873" type="drawable" name="pop_camera_high_wave2" />
<public id="0x11089874" type="drawable" name="pop_camera_high_wave3" />
<public id="0x11089875" type="drawable" name="pop_camera_high_wave4" />
<public id="0x11089876" type="drawable" name="pop_camera_high_wave5" />
<public id="0x11089877" type="drawable" name="pop_camera_low_wave" />
<public id="0x11089878" type="drawable" name="pop_camera_low_wave1" />
<public id="0x11089879" type="drawable" name="pop_camera_low_wave2" />
<public id="0x1108987a" type="drawable" name="pop_camera_low_wave3" />
<public id="0x1108987b" type="drawable" name="pop_camera_low_wave4" />
<public id="0x1108987c" type="drawable" name="pop_camera_low_wave5" />
<public id="0x110c9877" type="layout" name="up_and_down_animation_view" />
<public id="0x110a987b" type="id" name="highWave" />
<public id="0x110a987c" type="id" name="lowWave" />

Zenlua avatar May 09 '24 04:05 Zenlua

  • I guess you assumed you have added only 12 drawable, you choose starting id 0x11089871 originally the last drawable id was 0x11080382. Therefore you left huge null entries in between 0x9871 - 0382 = 38,127 entries x 19 configs = 724,413.

  • Even if the entry is null, the resource table holds indexed data to tell each resource id is null.

  • Try this and see the difference:

<public id="0x11080400" type="drawable" name="pop_camera_high_wave" />
<public id="0x11080401" type="drawable" name="pop_camera_high_wave1" />
.
.

TIP: at public.xml the last entry is placed at first row, just to make encoding process fast

REAndroid avatar May 09 '24 12:05 REAndroid

Thank you very much, because I didn't learn to code, I misunderstood

Zenlua avatar May 09 '24 13:05 Zenlua

Hopefully the next version will add a flag allowing the original AndroidManifest.xml file to be retained, system apk files will not have broken signatures

Zenlua avatar May 09 '24 13:05 Zenlua

Hopefully the next version will add a flag allowing the original AndroidManifest.xml file to be retained, system apk files will not have broken signatures

d -t raw

REAndroid avatar May 09 '24 13:05 REAndroid

Hopefully the next version will add a flag allowing the original AndroidManifest.xml file to be retained, system apk files will not have broken signatures

d -t raw

I use -t xml is it possible to add another flag

Zenlua avatar May 09 '24 14:05 Zenlua