Git Product home page Git Product logo

Comments (2)

meme avatar meme commented on July 29, 2024

Hi. Thank you for your interest in frida-apk.

This is a very interesting observation. I am not sure why the ordering seems to matter here, I would think that attributes could be parsed regardless of order and still add the FLAG_DEBUGGABLE to the process.

Curiously, the attrs_manifest.xml file which is used to define the "schema" for attributes declares the debuggable attribute after the name, theme, etc. as well: https://cs.android.com/android/platform/superproject/+/master:frameworks/base/core/res/res/values/attrs_manifest.xml;l=1716?q=attrs_manifest and it appears to follow the same order. Unsure if this is a coincidence.

Regardless, I am in the process of developing a frida-core API called Frida.AXML: https://github.com/frida/frida-core/blob/main/src/droidy/axml.vala. The purpose of this module is to en/decode AXML files thus allowing you to create AXML files from scratch, or modify existing ones. The plan is also to expose this API to Python.

Once this module is complete, I will rewrite frida-apk to use the new frida-core API to modify AXML files, thus cleaning up the code considerably and allowing for more flexibility such as reordering attributes with ease. Further, other out-of-tree Python scripts that use frida-core could also develop their own transformations.

from frida-tools.

mhils avatar mhils commented on July 29, 2024

I am not sure why the ordering seems to matter here, I would think that attributes could be parsed regardless of order and still add the FLAG_DEBUGGABLE to the process.

Right. After experimenting a bit longer, I have found that attributes need to be sorted by their resource ids for my stock Pixel phone to pick them up properly (Android 12). I've spend a lot of time reading through ResourceTypes.cpp to find the relevant, code but everything there seems to just iterate through the list... I'm a bit at a loss why/where it's happening, but it's definitely something I'm seeing on my device here. 🤷

After lots of trial and error I got things to work today - #97 has the necessary changes.

Regardless, I am in the process of developing a frida-core API called Frida.AXML

Very nice. You've probably seen the kaitai definition I've posted above, but that only handles decoding. And I guess you are aware of https://justanapplication.wordpress.com/category/android/android-binary-xml/ already as well. :-)

from frida-tools.

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.