现在的位置: 首页 > 综合 > 正文

apk 反编译 获得资源文件

2017年12月25日 ⁄ 综合 ⁄ 共 678字 ⁄ 字号 评论关闭

apk 反编译代码

需要用到apktool.jar包

package com.wansha;

import java.io.File;
import java.io.IOException;

import brut.androlib.AndrolibException;
import brut.apktool.Main;

public class Uncompressedfile {

	public static void main(String args[]) throws IOException,AndrolibException {
		String apkfilepath = "C:/order/SogouInput_11922(20111207)_tg_ff_yiwa3.apk";
		File apkFile = new File(apkfilepath);
		String fileName = apkFile.getName();
		String path = apkFile.getParent();
		final String targetDir = path + File.separator+ fileName.substring(0, fileName.lastIndexOf(".")) + "Dir";
		final String[] argss = new String[]{"d", "-s", apkfilepath, targetDir};
		try {
			Main.main(argss);
		} catch (InterruptedException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}

	}
}

抱歉!评论已关闭.