Coder Social home page Coder Social logo

dex-parser's Issues

Add helper methods to EncodedValue

We can start with the following:

  • type checks
    • is_array
    • is_int
    • is_string
    • is_array
    • is_byte
    • is_char
    • is_long
    • is_float
    • is_double
    • is_field
    • is_method
    • is_method_type
    • is_method_handle
    • is_annotation
    • is_enum
    • is_null
    • is_boolean
    • is_type
    • is_short
  • PartialEq impls with bool, str, f32, f64, Type, byte, short, long, int, DexString

Dex file modification

Is modifying dex files (or even creating ones from scratch) a feature that is in-scope for this project?

Setup CI

Requirements:

  • Contains cargo, rust, android sdk build tools and d8 (required to run test cases)
  • Run cargo clippy, cargo build, cargo test, cargo fmt on git push

Add annotations to Field

Annotations are right now saved in annotations_directory_item of the Class containing this field. We need to extract field annotations from the AnntotationsDirectoryItem and add them when constructing a Field.

Add annotations to Method

Annotations are right now present in annotations_directory_item field in the class containing the method. We need to extract method annotations and parameter annotations from the AnntotationsDirectoryItem and add them when constructing a Method.

v0.3.0 release

This is the tracking issue for v0.3.0:

  • Replace all generated functions to return Option<&Item> instead of &Option<Item>.

Add helper methods on Method

We can start with the following:

  • access_flags:
    • is_constructor
    • is_public
    • is_private
    • is_static
    • is_protected
    • is_final
    • is_synchronized
    • is_native
    • is_bridge
    • is_abstract
    • is_strictfp
    • is_synthetic
    • is_declared_synchronized
  • signature(&self) -> String: the value of the dalvik.annotation.Signature annotation. (after #8 is resolved)

Add helper methods to Field

We can start with the following:

  • access flags:
    • is_public,
    • is_private,
    • is_static,
    • is_final,
    • is_protected
  • signature(&self) -> String (after #7 is implemented)

Add intial value to Field

Initial values of a class's static fields are saved in the static_values field of a Class. We need to get rid of this field and add the value to the corresponding Field struct.

Add options in DexReader to verify checksum

The header section contains an Adler32 checksum of the dex file to detect corruption.

Add an option in DexReader to calculate the checksum and verify the calculated value against the value in the header section.

Implement constraints on data offsets

When reading data structures from dex source, there are no checks to verify if the offsets are in the correct section. For example: string_data_off should be in data section according to the docs.. Need to go over all such constraints and return errors when the offset is not into the correct section.

Add helper methods to Class

We can start with the following:

  • access flags:
    • is_public
    • is_private
    • is_protected
    • is_enum
    • is_interface
    • is_final
    • is_abstract
    • is_native
    • is_annotation
    • is_synthetic
  • signature(&self) -> String the value of the dalvik.annotation.Signature annotation.

Add helper methods in Class to find methods.

We can add two ways to search methods:

  1. Matching by method name, params and return type in the Method structure.
  2. Matching by using the dalvik.annotation.Signature annotation. This will be useful if a method's signature contains type parameters. (after #8 is resolved)

Make Errors more useful

Goal: To be able to pin-point a location where the malformed input is/error occurs.

Currently the Error type doesn't contain information on where an error happened. I think it'd be helpful if we have at least these details to start with:

  • Class name/ClassId - the error occurred while reading this Class from the input.
  • Method/Field - if relevant.
  • Id's of items (say in string_ids, type_ids section etc.)

Add helper methods to Type

We can start with the following:

  • Type checks
    • is_primitive
    • is_array
    • is_reference_type (arrays and classes)
    • is_class
    • is_int
    • is_float
    • is_double
    • is_char
    • is_byte
    • is_short
    • is_long
    • is_boolean
  • to_java_type - return the java representation of a type.
    ex: Ljava/lang/String; -> java.lang.String, [B -> byte[] etc.
  • Add constants representing smali types and replace all usages.
    ex: const BYTE: &str = "B" etc.

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.