Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Master #33

Open
wants to merge 35 commits into
base: wip-2.0
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
d936508
Strip down to only classes necessary for AXmlResourceParser
tony19 Jul 25, 2012
cb109fd
Move apktool-lib subdir contents to top-level
tony19 Jul 25, 2012
8b9565f
Bump snapshot version to 1.4.4
tony19 Jul 25, 2012
fe331a0
Add README
tony19 Jul 25, 2012
9c6ecc8
Include qualifier in version: 1.4.4-1
tony19 Jul 25, 2012
4f0bfa3
Fix project name in pom.xml
tony19 Jul 25, 2012
2477048
[maven-release-plugin] prepare release apktool-lib-1.4.4-1
tony19 Jul 25, 2012
ed50dd9
[maven-release-plugin] prepare for next development iteration
tony19 Jul 25, 2012
b104952
Update README.md
tony19 Jul 25, 2012
0d7203c
Update README.md
tony19 Jul 25, 2012
3082840
Update README.md
tony19 Jul 25, 2012
3833553
Disable debug info to reduce JAR size
tony19 Jul 26, 2012
891ae59
Merge branch 'master' of https://github.com/tony19/apktool-lib
tony19 Jul 26, 2012
4aa086e
Update README.md
tony19 Jul 26, 2012
5fe450d
Remove huge unused resource
tony19 Jul 26, 2012
584d2cf
[maven-release-plugin] prepare release apktool-lib-1.4.4-2
tony19 Jul 26, 2012
f83d976
[maven-release-plugin] prepare for next development iteration
tony19 Jul 26, 2012
43d4c71
Fix attribute decoding
tony19 Jul 26, 2012
1e6d977
[maven-release-plugin] prepare release apktool-lib-1.4.4-3
tony19 Jul 26, 2012
4d63ec6
[maven-release-plugin] prepare for next development iteration
tony19 Jul 26, 2012
0e49750
Switch to Gradle build
tony19 Feb 5, 2018
4eb2052
Remove java.awt ref
tony19 Feb 5, 2018
8c6006e
Tabs to spaces
tony19 Feb 5, 2018
84aa2c6
Remove @noinspection tags
tony19 Feb 5, 2018
f929160
Add CircleCI config
tony19 Feb 5, 2018
3671c7b
Update release tag template
tony19 Feb 5, 2018
5495274
:books: Update README for 1.4.4-4
tony19 Feb 5, 2018
9afbdfd
:cloud: Bump 'apktool-lib-1.4.4-5-SNAPSHOT'.
tony19 Feb 5, 2018
fb96832
Add CHANGELOG.md
tony19 Feb 5, 2018
c35dde2
Add nexus.sh
tony19 Feb 5, 2018
6296514
Update CHANGELOG
tony19 Feb 5, 2018
42dac4f
Update CHANGELOG
tony19 Feb 5, 2018
56be6d0
Specify full package name in AndroidManifest
tony19 Feb 25, 2018
ff82681
:books: Update README for 1.4.4-5
tony19 Feb 25, 2018
02da833
:cloud: Bump 'apktool-lib-1.4.4-6-SNAPSHOT'.
tony19 Feb 25, 2018
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 30 additions & 6 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,31 @@
/nb*
/target
/apktool-lib/nb*
/apktool-lib/target
/apktool-cli/nb*
/apktool-cli/target
.DS_Store
.settings
target
.classpath
.project
.idea
*~
*.iml
*.ipr
*.iws
local.properties
**/test/resources

# Ignore `mvn versions` output
*.versionsBackup

.gradle
build/

# Ignore Gradle GUI config
gradle-app.setting

# Avoid ignoring Gradle wrapper jar file (.jar files are usually ignored)
!gradle-wrapper.jar

# Cache of project
.gradletasknamecache

# # Work around https://youtrack.jetbrains.com/issue/IDEA-116898
# gradle/wrapper/gradle-wrapper.properties

17 changes: 17 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Changelog

__1.4.4-4__ (5 February 2018)
* Switch to AAR format
* Remove Android dependency
* Fix invalid reference to AWT

__1.4.4-3__ (26 July 2012)
* Fix attribute decoding

__1.4.4-2__ (26 July 2012)
* Remove debug info and unused resource to reduce JAR size

__1.4.4-1__ (25 July 2012)
* Initial commit (based on [apktool][1] v1.4.4)

[1]: https://github.com/brutall/brut.apktool
98 changes: 0 additions & 98 deletions NOTICE-smali

This file was deleted.

82 changes: 82 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
# apktool-lib [![CircleCI branch](https://img.shields.io/circleci/project/tony19/apktool-lib/master.svg)](https://circleci.com/gh/tony19/logback-android)
<sup>v1.4.4-5</sup>

Overview
--------
This library decodes a given precompiled XML resource (such as `AndroidManifest.xml`)
from an APK without requiring an Android application context.

Normally, precompiled (as opposed to raw) XML can be accessed from an Android application
using [`AssetManager.openXmlResourceParser()`][2]. In order to get an instance of
`AssetManager`, the caller must have access to the Android application context, which
is normally unavailable for libraries. A possible workaround is to pass the context (e.g.,
via the consumer's constructor) to libraries that need context-specific classes, but
that might be infeasible or undesirable in some applications, including ones that need
access to the precompiled XML before the context is initialized. `apktool-lib` enables
libraries to read precompiled XML without an application context or the Android `AssetManager`.

This is based on the [APK Tool][1] project.

Usage
-----
Parse XML events from `AXmlResourceParser` in a loop, as in the following code example:

```java
import brut.androlib.res.decoder.AXmlResourceParser;

//...

// called from a library, used by an Android application
public void readManifest() {
InputStream manifestStream = getClassLoader().getResourceAsStream("AndroidManifest.xml");
parseXmlStream(manifestStream);
}

public void parseXmlStream(InputStream stream) {
AXmlResourceParser xpp = new AXmlResourceParser(stream);

int eventType = -1;
while ((eventType = xpp.next()) > -1) {
if (XmlPullParser.START_DOCUMENT == eventType) {
startDocument(xpp);
} else if (XmlPullParser.END_DOCUMENT == eventType) {
endDocument();
break;
} else if (XmlPullParser.START_TAG == eventType) {
startElement(xpp);
} else if (XmlPullParser.END_TAG == eventType) {
endElement(xpp);
} else if (XmlPullParser.TEXT == eventType) {
characters(xpp);
}
}
}
```


Download
--------
_Gradle_

```groovy
dependencies {
compile 'com.github.tony19:apktool-lib:1.4.4-5'
}
```

Build
-----
Use these commands to create the AAR:

git clone git://github.com/tony19/apktool-lib.git
cd apktool-lib
scripts/makejar.sh

The file is output to: `./build/apktool-lib-1.4.4-5-debug.aar`

License
=======
[Apache License 2.0](http://www.apache.org/licenses/LICENSE-2.0)

[1]: https://github.com/brutall/brut.apktool
[2]: http://developer.android.com/reference/android/content/res/AssetManager.html#openXmlResourceParser(java.lang.String)
55 changes: 0 additions & 55 deletions apktool-cli/pom.xml

This file was deleted.

41 changes: 0 additions & 41 deletions apktool-cli/src/main/assembly/jar-with-deps.xml

This file was deleted.

Loading