Giter Club home page Giter Club logo

reproducible-apk-tools's Issues

Add command to sort binary AndroidManifest.xml file inside the generated APK

The binary AndroidManifest.xml file can have ordering differences beetwen compiled APK to tested APK (From github or Google Play)

2 Examples:

  1. In BlueWallet app v6.3.2, comparing AndroidManifest.xml from Github APK at https://github.com/BlueWallet/BlueWallet/releases/download/v6.3.2/BlueWallet-6.3.2.apk
    to attached AndroidManifest.xml from APK built using the Containerfile I wrote in BlueWallet/BlueWallet#758 (comment)

AndroidManifest.zip
The file in zip archive as Github wont allow uploading it otherwise.

Result only in order differences (AndroidManifest.xml was decoded using command androguard axml AndroidManifest.xml ) as the same value exists before </application> tag in upstream and in other place in built apk.

  1. Apps from GooglePlay include a tag like:
<meta-data android:name="com.android.vending.derived.apk.id" android:value="1"/>

Running a sed command that will add this tag to AndroidManifest during compilation, such as:

sed -i '/^\s*<\/application>\s*/i <meta-data android:name="com.android.vending.derived.apk.id" android:value="1"\/>' android/app/src/main/AndroidManifest.xml; \

sometimes works as intended, and sometimes it result in the value being added in different order (exists not before the </application> tag)

The suggestion is for this repo to add a command to sort this file, so it can be used during RB process.

Above issues were found during my contributions to WalletScrutiny project https://walletscrutiny.com/

zipinfo differences

good

  • defS, defF, defX
  • extended fat file permissions (e.g. -r--a--, -rw-a--, -rwxa--)
  • executable permission for .com/.exe/.btm/.cmd/.bat (fat)
  • ntf
  • d for directories (fat) [NB: --extended treats filenames ending w/ / as dirs]
  • atime, ctime
  • T/B for encrypted files
  • NN.N% rounding differences (?!)

wontfix

zipinfo executable permission mystery

For some reason, the original zipinfo marks files named META-INF/services/io.jsonwebtoken.CompressionCodec as executable.

I have no idea why, since there are no metadata differences that would explain this.

So I'm assuming it's an odd bug in the original, not in the Python version in this repo.

I've seen this with several different APK files, and it's always the same filename, never any other file.

@@ -95,7 +95,7 @@
 -rw----     2.4 fat        5 b-        5 stor 81-Jan-01 01:01 META-INF/kotlinx_coroutines_core.version
 -rw----     2.4 fat       39 b-       39 stor 81-Jan-01 01:01 META-INF/services/com.fasterxml.jackson.core.JsonFactory
 -rw----     2.4 fat       44 b-       44 stor 81-Jan-01 01:01 META-INF/services/com.fasterxml.jackson.core.ObjectCodec
--rwx---     2.4 fat      110 b-       60 defN 81-Jan-01 01:01 META-INF/services/io.jsonwebtoken.CompressionCodec
+-rw----     2.4 fat      110 b-       60 defN 81-Jan-01 01:01 META-INF/services/io.jsonwebtoken.CompressionCodec
 -rw----     2.4 fat       46 b-       42 defN 81-Jan-01 01:01 META-INF/services/io.jsonwebtoken.io.Deserializer
 -rw----     2.4 fat       44 b-       40 defN 81-Jan-01 01:01 META-INF/services/io.jsonwebtoken.io.Serializer
 -rw----     2.4 fat      112 b-       57 defN 81-Jan-01 01:01 META-INF/services/java.security.Provider

call zipalign automatically

The zipalign needs to be call manully with something like $$SDK$$/build-tools/30.0.3/zipalign. When the build-tools is updated the path also changes. I thought it would be convenient to find sdk from environment or option and use the zipalign from the build-tools with the highest version.

gradle integration?

Making a gradle plugin is probably too much effort, but it would be nice to have a snippet of code one can customise and add to build.gradle to integrate these tools (and maybe zipalign as well) into the build process if that's easily doable.

[help wanted] dump/sort-baseline: support more versions

Help wanted

Implementation of support for the missing baseline.prof file format versions below should not be too hard but is currently blocked by a lack of samples (i.e. we have none) to test against.


dump

prof

  • 001 N
  • 005 O
  • 009 O MR1
  • 010 P
  • 015 S

profm

  • 001 N
  • 002

sort

profm

  • 001 N
  • 002

binres.py

  • basic functionality
  • fix show/json/xml
  • find out how to use/display Style/Span
  • add anim/ / (file) / type=PNG stuff
  • fully implement & test LibraryChunk
  • incomplete BinResCfg
  • fix FIXMEs (payload size checks, weakrefs)
  • permissions protection level?
  • format updates?

[help wanted] zipinfo: support more ZIP formats and extensions

Help wanted

zipinfo.py currently produces (almost) identical output to Info-ZIP's zipinfo for various ZIP & JAR files found on a Debian system and APKs from F-Droid.

To support more varieties of ZIP formats and extensions -- if they are sufficiently common that it makes sense to -- requires having "real world" samples to test against.

Supported

  • create_system 0 (unix), 3 (fat), and 11 (ntfs)
  • compress_type stored, deflated, bzip2, and lzma (via Python's zipfile)
  • unix & fat permissions
  • timestamps from UT and UX extra fields (in CD)

See also: #9 #10.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.