Compress resources.arsc file in framework-res.apk #178

Closed
iBotPeaches opened this Issue Mar 18, 2015 · 12 comments

Comments

Projects
None yet
1 participant
@iBotPeaches
Owner

iBotPeaches commented Mar 18, 2015

Original issue 67 created by Brut.alll on 2010-06-23T17:44:40.000Z:

I had some problems with compressed resources.arsc files in framework resources, so currently apktool store them without a compression. This results in much bigger apk file than in original.

I have to do some research.

@iBotPeaches

This comment has been minimized.

Show comment
Hide comment
@iBotPeaches

iBotPeaches Mar 18, 2015

Owner

Comment #1 originally posted by Brut.alll on 2010-09-03T15:51:58.000Z:

Fixed in v1.3.2 .

Owner

iBotPeaches commented Mar 18, 2015

Comment #1 originally posted by Brut.alll on 2010-09-03T15:51:58.000Z:

Fixed in v1.3.2 .

@iBotPeaches

This comment has been minimized.

Show comment
Hide comment
@iBotPeaches

iBotPeaches Mar 18, 2015

Owner

Comment #3 originally posted by Brut.alll on 2010-09-05T17:04:19.000Z:

Your system can't boot up? Could you look into the logcat and see, what is the error?

Maybe some devices support compressed resources.arsc and others not? Ehhh...

Owner

iBotPeaches commented Mar 18, 2015

Comment #3 originally posted by Brut.alll on 2010-09-05T17:04:19.000Z:

Your system can't boot up? Could you look into the logcat and see, what is the error?

Maybe some devices support compressed resources.arsc and others not? Ehhh...

@iBotPeaches

This comment has been minimized.

Show comment
Hide comment
@iBotPeaches

iBotPeaches Mar 18, 2015

Owner

Comment #5 originally posted by Brut.alll on 2010-09-05T19:23:28.000Z:

I'm tired of these compression problems...

Ok, another way... apktool will compress or not compress resources.arsc file depending on whether it was compressed in original file. This should work.

Owner

iBotPeaches commented Mar 18, 2015

Comment #5 originally posted by Brut.alll on 2010-09-05T19:23:28.000Z:

I'm tired of these compression problems...

Ok, another way... apktool will compress or not compress resources.arsc file depending on whether it was compressed in original file. This should work.

@iBotPeaches

This comment has been minimized.

Show comment
Hide comment
@iBotPeaches

iBotPeaches Mar 18, 2015

Owner

Comment #6 originally posted by nothize on 2010-09-10T11:30:25.000Z:

Brut.alll

It'd be great because some of the apk(framework-res.apk, Settings.apk) was stored in uncompressed form and compressing them will cause an error as the logcat say the "<uncompressed_size which is larger than 1MB>" would exceed 1024768 (blabhalbah limit).

Perhaps it is a feature or bug of Android that the buffer allocated for resources assume the resources to be in uncompressed form? But it couldn't explain why some apk can use compressed rsrc.....perhaps AndroidManifest.xml can specify it?

But anyway, I'm current using zip/unzip to manually "fix" it to make the apk acceptable by the Android system.(Milestone stock ROM 2.1 build 2.36)

Owner

iBotPeaches commented Mar 18, 2015

Comment #6 originally posted by nothize on 2010-09-10T11:30:25.000Z:

Brut.alll

It'd be great because some of the apk(framework-res.apk, Settings.apk) was stored in uncompressed form and compressing them will cause an error as the logcat say the "<uncompressed_size which is larger than 1MB>" would exceed 1024768 (blabhalbah limit).

Perhaps it is a feature or bug of Android that the buffer allocated for resources assume the resources to be in uncompressed form? But it couldn't explain why some apk can use compressed rsrc.....perhaps AndroidManifest.xml can specify it?

But anyway, I'm current using zip/unzip to manually "fix" it to make the apk acceptable by the Android system.(Milestone stock ROM 2.1 build 2.36)

@iBotPeaches

This comment has been minimized.

Show comment
Hide comment
@iBotPeaches

iBotPeaches Mar 18, 2015

Owner

Comment #7 originally posted by introkun on 2010-10-01T12:50:03.000Z:

Is it possible to do 'compression level' configurable?

Owner

iBotPeaches commented Mar 18, 2015

Comment #7 originally posted by introkun on 2010-10-01T12:50:03.000Z:

Is it possible to do 'compression level' configurable?

@iBotPeaches

This comment has been minimized.

Show comment
Hide comment
@iBotPeaches

iBotPeaches Mar 18, 2015

Owner

Comment #8 originally posted by andrei.avramescu on 2010-10-14T12:22:13.000Z:

On my Galaxy S (2.1) after compiling with 4.9 I went into a black screen at boot using a framework-res.apk file with compressed resources.arsc. Not sure about the rest of the files if those need to be compressed.

Anyway, the same apk file recompiled with 4.8 worked fine.

Owner

iBotPeaches commented Mar 18, 2015

Comment #8 originally posted by andrei.avramescu on 2010-10-14T12:22:13.000Z:

On my Galaxy S (2.1) after compiling with 4.9 I went into a black screen at boot using a framework-res.apk file with compressed resources.arsc. Not sure about the rest of the files if those need to be compressed.

Anyway, the same apk file recompiled with 4.8 worked fine.

@iBotPeaches

This comment has been minimized.

Show comment
Hide comment
@iBotPeaches

iBotPeaches Mar 18, 2015

Owner

Comment #9 originally posted by techana on 2010-11-02T22:58:36.000Z:

Yes, it is annoying! As an easier and faster solution, you can just add an option to not compress resources.arsc. Let then the user control.

Thanks.

Owner

iBotPeaches commented Mar 18, 2015

Comment #9 originally posted by techana on 2010-11-02T22:58:36.000Z:

Yes, it is annoying! As an easier and faster solution, you can just add an option to not compress resources.arsc. Let then the user control.

Thanks.

@iBotPeaches

This comment has been minimized.

Show comment
Hide comment
@iBotPeaches

iBotPeaches Mar 18, 2015

Owner

Comment #10 originally posted by Brut.alll on 2011-05-03T08:56:25.000Z:

Issue 112 has been merged into this issue.

Owner

iBotPeaches commented Mar 18, 2015

Comment #10 originally posted by Brut.alll on 2011-05-03T08:56:25.000Z:

Issue 112 has been merged into this issue.

@iBotPeaches

This comment has been minimized.

Show comment
Hide comment
@iBotPeaches

iBotPeaches Mar 18, 2015

Owner

Comment #11 originally posted by Brut.alll on 2011-06-03T15:51:24.000Z:

Issue 174 has been merged into this issue.

Owner

iBotPeaches commented Mar 18, 2015

Comment #11 originally posted by Brut.alll on 2011-06-03T15:51:24.000Z:

Issue 174 has been merged into this issue.

@iBotPeaches

This comment has been minimized.

Show comment
Hide comment
@iBotPeaches

iBotPeaches Mar 18, 2015

Owner

Comment #12 originally posted by connor.tumbleson on 2013-01-13T13:32:51.000Z:

Length Method Size Ratio Date Time CRC-32 Name


3076268 Stored 3076268 0% 5754333 11-15-12 17:12 b56c411a resources.arsc
3075536 Deflate 779552 75% 10183712 01-13-13 06:30 320291f0 resources.arsc

before and after. It seems that if any compressed file uncompresses above 1MB (on Android 2.3 or lower) you get FCs and errors. Which means that the benefit to compressing is almost useless for resources.arsc. As the AssetManager just has to take time to uncompress it, for barely any noticeable space difference.

So my best method to solve. Just read the ZIP entry looking for DEFLATE vs STORED, as there are too many factors (frameworks vs API version vs type) of when to deflate or not.

Owner

iBotPeaches commented Mar 18, 2015

Comment #12 originally posted by connor.tumbleson on 2013-01-13T13:32:51.000Z:

Length Method Size Ratio Date Time CRC-32 Name


3076268 Stored 3076268 0% 5754333 11-15-12 17:12 b56c411a resources.arsc
3075536 Deflate 779552 75% 10183712 01-13-13 06:30 320291f0 resources.arsc

before and after. It seems that if any compressed file uncompresses above 1MB (on Android 2.3 or lower) you get FCs and errors. Which means that the benefit to compressing is almost useless for resources.arsc. As the AssetManager just has to take time to uncompress it, for barely any noticeable space difference.

So my best method to solve. Just read the ZIP entry looking for DEFLATE vs STORED, as there are too many factors (frameworks vs API version vs type) of when to deflate or not.

@iBotPeaches

This comment has been minimized.

Show comment
Hide comment
@iBotPeaches

iBotPeaches Mar 18, 2015

Owner

Comment #13 originally posted by connor.tumbleson on 2013-01-13T14:21:30.000Z:

This issue was closed by revision f82b2e1.

Owner

iBotPeaches commented Mar 18, 2015

Comment #13 originally posted by connor.tumbleson on 2013-01-13T14:21:30.000Z:

This issue was closed by revision f82b2e1.

@iBotPeaches

This comment has been minimized.

Show comment
Hide comment
@iBotPeaches

iBotPeaches Mar 18, 2015

Owner

Comment #14 originally posted by connor.tumbleson on 2013-01-17T14:10:34.000Z:

<empty>

Owner

iBotPeaches commented Mar 18, 2015

Comment #14 originally posted by connor.tumbleson on 2013-01-17T14:10:34.000Z:

<empty>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment