Code Monkey home page Code Monkey logo

Comments (3)

obfusk avatar obfusk commented on June 12, 2024

Note that the documentation clearly states to use the first v2/v3 block:

Locate the first APK Signature Scheme v2 Block inside the APK Signing Block.
Locate the first APK Signature Scheme v3 Block inside the APK Signing Block.

https://source.android.com/docs/security/features/apksigning/v2#v2-verification
https://source.android.com/docs/security/features/apksigning/v3#v3-verification

from androguard.

obfusk avatar obfusk commented on June 12, 2024

My suggestion for now would be to simply not overwrite any existing keys (block IDs) and raise a warning if any are found:

            if key in self._v2_blocks:
                logger.warning("Duplicate block ID in APK Signing Block: {}".format(key))
            else:
                self._v2_blocks[key] = value

For later, it might be useful to have a second API that parses and returns all blocks for anyone wanting to inspect (manipulated) APKs with duplicates (like my work-in-progress apksigtool allows).

from androguard.

erev0s avatar erev0s commented on June 12, 2024

Thank you once again @obfusk for pointing this out.
only the first signature block is stored now and a warn is returned for duplicate ones.

Completely agree it would be nice to store the duplicate blocks and provide also information about them so I added the label Nice to have. Hopefully i can pick it up sometime in the next weeks.

from androguard.

Related Issues (20)

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.