Restore "Last-Modified" time during apk generation. #3156
Replies: 4 comments
-
So is there a bug you are encountering with this behavior? |
Beta Was this translation helpful? Give feedback.
-
Not that I know or have discovered, and I think there aren't. It's just that it would be cleaner because the apk file would be more similar to a genuine apk. |
Beta Was this translation helpful? Give feedback.
-
Okay, I did some investigation and we could probably do this by recording the LastModified time of files during read, then re-set them back to that value after writing zip file. However, system is not really designed to do that at all. So marking as feature request for backlog. |
Beta Was this translation helpful? Give feedback.
-
Hello, |
Beta Was this translation helpful? Give feedback.
-
Information
apktool -version
) - 2.4.0Steps to Reproduce
apktool d <app>.apk
apktool b <app> -o <new_app>.apk
the original file, in .apk will have the bare minimum needed metadata and last edited date of 01/01/2009, while the edited file, in <new_app>.apk will have more metadata (thus more overhead) than the original file.
N.B. this is just an example, all files inside the apk (zip), regardless if edited or not, will have those added metadata, at least the current date instead of 01/01/2009.
Performing a
zipalign
does not solve the issue.Zip file format FIle headers
APK
If this APK can be freely shared, please upload/attach a link to it.
Google Phone
Questions to ask before submission
apktool d
,apktool b
without changing anything? YesAttached pictures:
In red, you can notice that by removing from the apk (zip) the file android-support-multidex.version and putting it back again, metadata is added.
In green , date difference between original and edited app.
Beta Was this translation helpful? Give feedback.
All reactions