New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Commit a8bdad62 breaks audio playback from res/raw/*.mp3 by deflating all files in apk #1769

Closed
S-trace opened this Issue Apr 12, 2018 · 4 comments

Comments

Projects
None yet
3 participants
@S-trace

S-trace commented Apr 12, 2018

Information

  1. Apktool Version (apktool -version) - 2.3.2
  2. Operating System (Mac, Linux, Windows) - Linux
  3. APK From? (Playstore, ROM, Other) - Other (own build)

Stacktrace/Logcat

Original apk (from Android Studio 3.0.2):
zipinfo -l HttpTest_v12_0ec223d.apk 
Archive:  HttpTest_v12_0ec223d.apk
Zip file size: 120666 bytes, number of entries: 30
-rw----     0.0 fat     2368 b-      825 defN 80-000-00 00:00 AndroidManifest.xml
-rw----     2.4 fat      765 b-      596 defN 80-000-00 00:00 META-INF/CERT.RSA
-rw----     2.4 fat     2564 b-     1024 defN 80-000-00 00:00 META-INF/CERT.SF
-rw----     2.4 fat     2521 b-      967 defN 80-000-00 00:00 META-INF/MANIFEST.MF
-rw----     2.4 fat    19224 b-     9710 defN 80-000-00 00:00 classes.dex
-rw----     0.0 fat     5696 b-      983 defN 80-000-00 00:00 res/drawable-anydpi-v21/ic_launcher_background.xml
-rw----     2.4 fat      730 b-      730 stor 80-000-00 00:00 res/drawable-hdpi-v4/ic_launcher_background.png
-rw----     2.4 fat      331 b-      331 stor 80-000-00 00:00 res/drawable-ldpi-v4/ic_launcher_background.png
-rw----     2.4 fat      407 b-      407 stor 80-000-00 00:00 res/drawable-mdpi-v4/ic_launcher_background.png
-rw----     0.0 fat      752 b-      337 defN 80-000-00 00:00 res/drawable-v24/$ic_launcher_foreground__0.xml
-rw----     0.0 fat     1696 b-      744 defN 80-000-00 00:00 res/drawable-v24/ic_launcher_foreground.xml
-rw----     2.4 fat     1320 b-     1320 stor 80-000-00 00:00 res/drawable-xhdpi-v4/ic_launcher_background.png
-rw----     2.4 fat     3254 b-     3254 stor 80-000-00 00:00 res/drawable-xxhdpi-v4/ic_launcher_background.png
-rw----     2.4 fat     4380 b-     4380 stor 80-000-00 00:00 res/drawable-xxxhdpi-v4/ic_launcher_background.png
-rw----     0.0 fat     1452 b-      531 defN 80-000-00 00:00 res/layout/activity_main.xml
-rw----     0.0 fat      448 b-      220 defN 80-000-00 00:00 res/mipmap-anydpi-v26/ic_launcher.xml
-rw----     0.0 fat      448 b-      220 defN 80-000-00 00:00 res/mipmap-anydpi-v26/ic_launcher_round.xml
-rw----     2.4 fat     3056 b-     3056 stor 80-000-00 00:00 res/mipmap-hdpi-v4/ic_launcher.png
-rw----     2.4 fat     5024 b-     5024 stor 80-000-00 00:00 res/mipmap-hdpi-v4/ic_launcher_round.png
-rw----     2.4 fat     2096 b-     2096 stor 80-000-00 00:00 res/mipmap-mdpi-v4/ic_launcher.png
-rw----     2.4 fat     2858 b-     2858 stor 80-000-00 00:00 res/mipmap-mdpi-v4/ic_launcher_round.png
-rw----     2.4 fat     4569 b-     4569 stor 80-000-00 00:00 res/mipmap-xhdpi-v4/ic_launcher.png
-rw----     2.4 fat     7098 b-     7098 stor 80-000-00 00:00 res/mipmap-xhdpi-v4/ic_launcher_round.png
-rw----     2.4 fat     6464 b-     6464 stor 80-000-00 00:00 res/mipmap-xxhdpi-v4/ic_launcher.png
-rw----     2.4 fat    10676 b-    10676 stor 80-000-00 00:00 res/mipmap-xxhdpi-v4/ic_launcher_round.png
-rw----     2.4 fat     9250 b-     9250 stor 80-000-00 00:00 res/mipmap-xxxhdpi-v4/ic_launcher.png
-rw----     2.4 fat    15523 b-    15523 stor 80-000-00 00:00 res/mipmap-xxxhdpi-v4/ic_launcher_round.png
-rw----     2.4 fat     2555 b-     2555 stor 80-000-00 00:00 res/raw/channel_in.mp3
-rw----     2.4 fat     3605 b-     3605 stor 80-000-00 00:00 res/raw/ptt_emg.mp3
-rw----     0.0 fat     4692 b-     4692 stor 80-000-00 00:00 resources.arsc
30 files, 125822 bytes uncompressed, 104045 bytes compressed:  17.3%
Rebuilt apk (using Apktool w/o commit a8bdad62):
Archive:  HttpTest_v12_0ec223d.apk
Zip file size: 102541 bytes, number of entries: 27
-rw----     2.0 fat     2568 bl      911 defN 80-Jan-01 03:00 AndroidManifest.xml
-rw----     2.0 fat    19204 bl     9304 defN 80-Jan-01 03:00 classes.dex
-rw----     2.0 fat     6280 bl     1037 defN 80-Jan-01 03:00 res/drawable-anydpi-v21/ic_launcher_background.xml
-rw----     1.0 fat      328 b-      328 stor 80-Jan-01 03:00 res/drawable-hdpi/ic_launcher_background.png
-rw----     1.0 fat      201 b-      201 stor 80-Jan-01 03:00 res/drawable-ldpi/ic_launcher_background.png
-rw----     1.0 fat      211 b-      211 stor 80-Jan-01 03:00 res/drawable-mdpi/ic_launcher_background.png
-rw----     2.0 fat      904 bl      358 defN 80-Jan-01 03:00 res/drawable-v24/$ic_launcher_foreground__0.xml
-rw----     2.0 fat     2656 bl      837 defN 80-Jan-01 03:00 res/drawable-v24/ic_launcher_foreground.xml
-rw----     1.0 fat      539 b-      539 stor 80-Jan-01 03:00 res/drawable-xhdpi/ic_launcher_background.png
-rw----     1.0 fat      844 b-      844 stor 80-Jan-01 03:00 res/drawable-xxhdpi/ic_launcher_background.png
-rw----     1.0 fat     1113 b-     1113 stor 80-Jan-01 03:00 res/drawable-xxxhdpi/ic_launcher_background.png
-rw----     2.0 fat     1460 bl      539 defN 80-Jan-01 03:00 res/layout/activity_main.xml
-rw----     2.0 fat      552 bl      236 defN 80-Jan-01 03:00 res/mipmap-anydpi-v26/ic_launcher.xml
-rw----     2.0 fat      552 bl      236 defN 80-Jan-01 03:00 res/mipmap-anydpi-v26/ic_launcher_round.xml
-rw----     1.0 fat     3322 b-     3322 stor 80-Jan-01 03:00 res/mipmap-hdpi/ic_launcher.png
-rw----     1.0 fat     5843 b-     5843 stor 80-Jan-01 03:00 res/mipmap-hdpi/ic_launcher_round.png
-rw----     1.0 fat     2329 b-     2329 stor 80-Jan-01 03:00 res/mipmap-mdpi/ic_launcher.png
-rw----     1.0 fat     3487 b-     3487 stor 80-Jan-01 03:00 res/mipmap-mdpi/ic_launcher_round.png
-rw----     1.0 fat     4676 b-     4676 stor 80-Jan-01 03:00 res/mipmap-xhdpi/ic_launcher.png
-rw----     1.0 fat     8004 b-     8004 stor 80-Jan-01 03:00 res/mipmap-xhdpi/ic_launcher_round.png
-rw----     1.0 fat     6554 b-     6554 stor 80-Jan-01 03:00 res/mipmap-xxhdpi/ic_launcher.png
-rw----     1.0 fat    11607 b-    11607 stor 80-Jan-01 03:00 res/mipmap-xxhdpi/ic_launcher_round.png
-rw----     1.0 fat     8946 b-     8946 stor 80-Jan-01 03:00 res/mipmap-xxxhdpi/ic_launcher.png
-rw----     1.0 fat    16187 b-    16187 stor 80-Jan-01 03:00 res/mipmap-xxxhdpi/ic_launcher_round.png
-rw----     1.0 fat     2555 b-     2555 stor 80-Jan-01 03:00 res/raw/channel_in.mp3
-rw----     1.0 fat     3605 b-     3605 stor 80-Jan-01 03:00 res/raw/ptt_emg.mp3
-rw----     1.0 fat     4620 b-     4620 stor 80-Jan-01 03:00 resources.arsc
27 files, 119147 bytes uncompressed, 98429 bytes compressed:  17.4%
Rebuilt apk (using Apktool with commit a8bdad62):
Archive:  HttpTest_v12_0ec223d.apk
Zip file size: 100991 bytes, number of entries: 27
-rw----     2.0 fat     2568 bl      911 defN 18-Apr-12 17:59 AndroidManifest.xml
-rw----     2.0 fat    19204 bl     9304 defN 18-Apr-12 17:59 classes.dex
-rw----     2.0 fat     2656 bl      837 defN 18-Apr-12 17:59 res/drawable-v24/ic_launcher_foreground.xml
-rw----     2.0 fat      904 bl      358 defN 18-Apr-12 17:59 res/drawable-v24/$ic_launcher_foreground__0.xml
-rw----     2.0 fat      844 bl      558 defN 18-Apr-12 17:59 res/drawable-xxhdpi/ic_launcher_background.png
-rw----     2.0 fat     2555 bl     2267 defN 18-Apr-12 17:59 res/raw/channel_in.mp3
-rw----     2.0 fat     3605 bl     3141 defN 18-Apr-12 17:59 res/raw/ptt_emg.mp3
-rw----     2.0 fat     3487 bl     3492 defN 18-Apr-12 17:59 res/mipmap-mdpi/ic_launcher_round.png
-rw----     2.0 fat     2329 bl     2334 defN 18-Apr-12 17:59 res/mipmap-mdpi/ic_launcher.png
-rw----     2.0 fat    11607 bl    11612 defN 18-Apr-12 17:59 res/mipmap-xxhdpi/ic_launcher_round.png
-rw----     2.0 fat     6554 bl     6549 defN 18-Apr-12 17:59 res/mipmap-xxhdpi/ic_launcher.png
-rw----     2.0 fat      328 bl      286 defN 18-Apr-12 17:59 res/drawable-hdpi/ic_launcher_background.png
-rw----     2.0 fat      552 bl      236 defN 18-Apr-12 17:59 res/mipmap-anydpi-v26/ic_launcher.xml
-rw----     2.0 fat      552 bl      236 defN 18-Apr-12 17:59 res/mipmap-anydpi-v26/ic_launcher_round.xml
-rw----     2.0 fat     6280 bl     1037 defN 18-Apr-12 17:59 res/drawable-anydpi-v21/ic_launcher_background.xml
-rw----     2.0 fat     8004 bl     8009 defN 18-Apr-12 17:59 res/mipmap-xhdpi/ic_launcher_round.png
-rw----     2.0 fat     4676 bl     4681 defN 18-Apr-12 17:59 res/mipmap-xhdpi/ic_launcher.png
-rw----     2.0 fat    16187 bl    16173 defN 18-Apr-12 17:59 res/mipmap-xxxhdpi/ic_launcher_round.png
-rw----     2.0 fat     8946 bl     8838 defN 18-Apr-12 17:59 res/mipmap-xxxhdpi/ic_launcher.png
-rw----     2.0 fat     5843 bl     5848 defN 18-Apr-12 17:59 res/mipmap-hdpi/ic_launcher_round.png
-rw----     2.0 fat     3322 bl     3327 defN 18-Apr-12 17:59 res/mipmap-hdpi/ic_launcher.png
-rw----     2.0 fat      211 bl      213 defN 18-Apr-12 17:59 res/drawable-mdpi/ic_launcher_background.png
-rw----     2.0 fat      201 bl      199 defN 18-Apr-12 17:59 res/drawable-ldpi/ic_launcher_background.png
-rw----     2.0 fat      539 bl      420 defN 18-Apr-12 17:59 res/drawable-xhdpi/ic_launcher_background.png
-rw----     2.0 fat     1460 bl      539 defN 18-Apr-12 17:59 res/layout/activity_main.xml
-rw----     2.0 fat     1113 bl      566 defN 18-Apr-12 17:59 res/drawable-xxxhdpi/ic_launcher_background.png
-rw----     1.0 fat     4620 b-     4620 stor 18-Apr-12 17:59 resources.arsc
27 files, 119147 bytes uncompressed, 96591 bytes compressed:  18.9%

Steps to Reproduce

  1. apktool d file.apk
  2. apktool b file.apk

Frameworks

Nothing special

APK

HttpTest_v12_0ec223d.zip

Questions to ask before submission

  1. Have you tried apktool d, apktool b without changing anything? - yes, this report is about such test
  2. If you are trying to install a modified apk, did you resign it? - yes, with same key
  3. Are you using the latest apktool version? - yes, v2.3.2 with commit a8bdad6 reverted does not have this problem
@iBotPeaches

This comment has been minimized.

Owner

iBotPeaches commented Apr 12, 2018

Thanks for the report and investigation. I'll look into what went wrong with our new packager to see why the mp3 was not detected to be stored.

@iBotPeaches iBotPeaches added the Bug label Apr 12, 2018

@iBotPeaches

This comment has been minimized.

Owner

iBotPeaches commented Apr 12, 2018

Nice find. Sorry for the regression. This may warrant a patch release. I forgot that aapt by default stores the following extensions as stored

jpg|jpeg|png|gif|wav|mp2|mp3|ogg|aac|mpg|mpeg|mid|midi|smf|jet|rtttl|imy|xmf|mp4|m4a|m4v|3gp|3gpp|3g2|3gpp2|amr|awb|wma|wmv|webm|mkv

I'll patch the new packager to store those files and we should be fine.

@iBotPeaches

This comment has been minimized.

Owner

iBotPeaches commented Apr 12, 2018

Will require another decode to capture the stored extensions, but this should resolve it: #1770

@JustDragon

This comment has been minimized.

JustDragon commented Apr 13, 2018

I notice in version 2.3.2, some mp4 file like GooglePlay logo will be corrupted after rebuild with apktool also. Not sure if this patch will fix that.

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