Git Product home page Git Product logo

aapt's Introduction

Overview

AAPT is a Java library for Android assets manipulation, it supports read and write resource files. It also provides command line tools.

Getting Started

Using command line

  • Dump Resource Table

    $ java -jar ./target/aapt-0.0.1-SNAPSHOT-jar-with-dependencies.jar dump resources resources.arsc
  • Dump String Pool

    $ java -jar ./target/aapt-0.0.1-SNAPSHOT-jar-with-dependencies.jar dump strings resources.arsc
  • Dump XML

    $ java -jar ./target/aapt-0.0.1-SNAPSHOT-jar-with-dependencies.jar dump xml AndroidManifest.xml

Using library

  • Dump Resource Table

    ChunkParser parser = new ChunkParser();

parser.parse("resources.arsc").accept(new ResourceTableVisitor(System.out, true));
```

  • Dump String Pool

    ChunkParser parser = new ChunkParser();

parser.parse("resources.arsc").accept(new StringPoolVisitor(System.out, true)); ```

  • Dump XML

    ChunkParser parser = new ChunkParser();

parser.parse("AndroidManifest.xml").accept(new XmlVisitor(System.out, true)); ```

  • Write Resource Table

    ChunkParser parser = new ChunkParser();
    ResourceTable arsc = parser.parse("resources.arsc");
    arsc.purge(0, 1, 2, 3, 4, 5); // retain the specified index of strings 
    
    ChunkOutputStream cos = new ChunkOutputStream(new FileOutputStream("resources.arsc.bak"));
    cos.write(arsc);
    cos.close();
  • Parse & Generate Resource Symbols

    SymbolParser parser = new SymbolParser();
    Symbols symbols = parser.parse("R.txt");
    Aapt.generateR("R.java", "com.example", symbols);
  • Inspect APK

    ApkFile apk = new ApkFile("app.apk");
    Dex main = apk.getMainDex();
    Iterable<Dex> dexes = apk.dexes();
    Iterable<String> classes = apk.classes();
    Xml manifest = apk.getAndroidManifest();
    ResourceTable table = apk.getResourceTable();

Download

AAPT library is available on Maven Central Repository

Maven

<dependency>
  <groupId>com.sdklite</groupId>
  <artifactId>aapt</artifactId>
  <version>0.0.1</version>
</dependency>

Gradle

compile 'com.sdklite:aapt:0.0.1'

API Doc

Please see http://aapt.sdklite.com.

aapt's People

Contributors

johnsonlee avatar

Watchers

James Cloos avatar

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.