APK parser lib, for decoding binary XML files, getting APK meta info.
Table of Contents
=================
* [Features](#features)
* [Get APK-parser](#get-apk-parser)
* [Usage](#usage)
* [1. APK Info](#1-apk-info)
* [2. Get Binary XML and Manifest XML Files](#2-get-binary-xml-and-manifest-xml-file)
* [3. Get DEX Classes](#3-get-dex-classes)
* [4. Get APK Signing Info](#4-get-apk-sign-info)
* [5. Locales](#5-locales)
* [Reporting Issues](#open-issue)
#### Features
* Retrieve APK meta info, such as title, icon, package name, version, etc.
* Parse and convert binary XML files to text
* Get classes from DEX files
* Get APK singer info
#### Get APK-parser
Get APK-parser from the Maven Central Reposotiry:
```xml
<dependency>
<groupId>net.dongliu</groupId>
<artifactId>apk-parser</artifactId>
<version>2.6.10</version>
</dependency>
```
From version 2.0, apk-parser requires Java 7. The last version to support Java 6 is 1.7.4.
#### Usage
The ordinary way is using the ApkFile class, which contains convenient methods to get AndroidManifest.xml, APK info, etc.
The ApkFile need to be closed when no longer used.
There is also a ByteArrayApkFile class for reading APK files from byte array.
##### 1. APK Info
ApkMeta contains name(label), packageName, version, SDK, used features, etc.
```java
try (ApkFile apkFile = new ApkFile(new File(filePath))) {
ApkMeta apkMeta = apkFile.getApkMeta();
System.out.println(apkMeta.getLabel());
System.out.println(apkMeta.getPackageName());
System.out.println(apkMeta.getVersionCode());
for (UseFeature feature : apkMeta.getUsesFeatures()) {
System.out.println(feature.getName());
}
}
```
##### 2. Get Binary XML and Manifest XML Files
```java
try (ApkFile apkFile = new ApkFile(new File(filePath))) {
String manifestXml = apkFile.getManifestXml();
String xml = apkFile.transBinaryXml("res/menu/main.xml");
}
```
##### 3. Get DEX Classes
```java
try(ApkFile apkFile = new ApkFile(new File(filePath))) {
DexClass[] classes = apkFile.getDexClasses();
for (DexClass dexClass : classes) {
System.out.println(dexClass);
}
}
```
##### 4. Get APK Signing Info
Get the APK signer certificate info and other messages, using:
```java
try(ApkFile apkFile = new ApkFile(new File(filePath))) {
List<ApkSigner> signers = apkFile.getApkSingers(); // apk v1 signers
List<ApkV2Signer> v2signers = apkFile.getApkV2Singers(); // apk v2 signers
}
```
##### 5. Locales
An APK may have different info (title, icon, etc.) for different regions and languages——or we can call it a "locale".
If a locale is not set, the default "en_US" locale (<code>Locale.US</code>) is used. You can set a preferred locale by:
```java
try (ApkFile apkFile = new ApkFile(new File(filePath))) {
apkFile.setPreferredLocale(Locale.SIMPLIFIED_CHINESE);
ApkMeta apkMeta = apkFile.getApkMeta();
}
```
APK-parser will find the best matching languages for the locale you specified.
If locale is set to null, ApkFile will not translate the resource tag, and instead just give the resource ID.
For example, the title will be something like '@string/app_name' instead of the real name.
#### Reporting Issues
If this parser has any problem with a specific APK, open a new issue, **with a link to download the APK file**.
没有合适的资源?快使用搜索试试~ 我知道了~
Java 版 Apk 解析器.zip
共148个文件
java:131个
apk:4个
ini:2个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 87 浏览量
2024-11-25
09:21:42
上传
评论
收藏 20.97MB ZIP 举报
温馨提示
APK 解析库,用于解码二进制 XML 文件,获取 APK 元信息。目录特征获取 APK 解析器用法1. APK 信息2. 获取二进制 XML 和清单 XML 文件3. 获取 DEX 类4. 获取 APK 签名信息5. 区域设置报告问题特征检索 APK 元信息,例如标题、图标、包名称、版本等。解析二进制 XML 文件并将其转换为文本从 DEX 文件中获取类获取APK歌手信息获取 APK 解析器从 Maven Central Repository 获取 APK-parser:<dependency> <groupId>net.dongliu</groupId> <artifactId>apk-parser</artifactId> <version>2.6.10</version></dependency>从 2.0 版本开始,apk-parser 需要 Java 7。支持 Java 6 的最后一个版本是 1.7.4。用法常规方法是使用 ApkFile 类,该类包含获取 AndroidManifest.xml
资源推荐
资源详情
资源评论
收起资源包目录
Java 版 Apk 解析器.zip (148个子文件)
Twitter_v7.93.2.apk 31.03MB
NetworkStack_210000000.apk 677KB
app-debug.apk 6KB
app-release.apk 2KB
.gitignore 21B
gmail_sign_block 2KB
r_styles.ini 32KB
r_values.ini 30KB
Asn1BerParser.java 27KB
Asn1DerEncoder.java 22KB
AbstractApkFile.java 16KB
BinaryXmlParser.java 13KB
ApkMeta.java 12KB
ResourceTableParser.java 12KB
InputStreamBerDataValueReader.java 11KB
ResourceValue.java 9KB
ApkMetaTranslator.java 9KB
DexParser.java 9KB
ByteBufferBerDataValueReader.java 8KB
ParseUtils.java 7KB
AttributeValues.java 6KB
BerEncoding.java 6KB
ApkSignBlockParser.java 6KB
ResValue.java 6KB
ResourceFetcher.java 5KB
CharSequenceTranslator.java 5KB
ResTableConfig.java 5KB
DexHeader.java 5KB
Type.java 4KB
ApkParsers.java 4KB
NumericEntityEscaper.java 4KB
ApkFile.java 4KB
ResourceTableMap.java 4KB
XmlTranslator.java 4KB
ResourceTable.java 3KB
Buffers.java 3KB
BerDataValue.java 3KB
DexClassStruct.java 3KB
LookupTranslator.java 3KB
XmlNamespaces.java 3KB
ApkFileTest.java 3KB
PackageHeader.java 3KB
CertificateMetas.java 3KB
CertificateMeta.java 3KB
XmlEscaper.java 3KB
ResourcePackage.java 2KB
JSSECertificateParser.java 2KB
Attribute.java 2KB
Strings.java 2KB
ByteArrayApkFile.java 2KB
ResourceEntry.java 2KB
DexClass.java 2KB
TypeHeader.java 2KB
AggregateTranslator.java 2KB
ChunkHeader.java 2KB
BCCertificateParser.java 2KB
EOCD.java 2KB
CodePointTranslator.java 2KB
ResourceLoader.java 2KB
Attributes.java 2KB
ByteArrayApkFileTest.java 2KB
StringPoolHeader.java 2KB
EntityArrays.java 2KB
ResourceMapEntry.java 2KB
SignerInfo.java 2KB
SignedData.java 2KB
Asn1Field.java 2KB
TypeSpecHeader.java 2KB
UnicodeUnpairedSurrogateRemover.java 2KB
XmlNodeStartTag.java 2KB
XmlCData.java 2KB
EncapsulatedContentInfo.java 1KB
IssuerAndSerialNumber.java 1KB
SignerIdentifier.java 1KB
ChunkType.java 1KB
AlgorithmIdentifier.java 1KB
JSSECertificateParserTest.java 1KB
AdaptiveIconParser.java 1KB
BerDataValueReader.java 1KB
CompositeXmlStreamer.java 1KB
Icon.java 1KB
Attribute.java 1KB
BCCertificateParserTest.java 1KB
AdaptiveIcon.java 1KB
Permission.java 1KB
BerDataValueFormatException.java 1KB
Asn1OpaqueObject.java 1KB
Pkcs7Constants.java 1KB
ContentInfo.java 1KB
Asn1DecodingException.java 1KB
AndroidConstants.java 1KB
Asn1EncodingException.java 1KB
Unsigned.java 1KB
LibraryHeader.java 1019B
Main.java 969B
Locales.java 943B
Asn1Class.java 943B
TypeSpec.java 935B
ApkSigner.java 922B
Asn1TagClass.java 914B
共 148 条
- 1
- 2
资源评论
徐浪老师
- 粉丝: 8084
- 资源: 7772
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功