本文整理汇总了Java中brut.androlib.err.InFileNotFoundException类的典型用法代码示例。如果您正苦于以下问题:Java InFileNotFoundException类的具体用法?Java InFileNotFoundException怎么用?Java InFileNotFoundException使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
InFileNotFoundException类属于brut.androlib.err包,在下文中一共展示了InFileNotFoundException类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: build
import brut.androlib.err.InFileNotFoundException; //导入依赖的package包/类
public void build(ExtFile appDir, File outFile,
HashMap<String, Boolean> flags, ExtFile origApk, String aaptPath)
throws BrutException {
mAaptPath = aaptPath;
Map<String, Object> meta = readMetaFile(appDir);
Object t1 = meta.get("isFrameworkApk");
flags.put("framework", t1 == null ? false : (Boolean) t1);
flags.put("compression", meta.get("compressionType") == null ? false
: (Boolean) meta.get("compressionType"));
mAndRes.setSdkInfo((Map<String, String>) meta.get("sdkInfo"));
// check the orig apk
if (flags.get("injectOriginal")) {
if (!origApk.isFile() || !origApk.canRead()) {
throw new InFileNotFoundException();
} else {
mOrigApkFile = origApk;
}
}
if (outFile == null) {
String outFileName = (String) meta.get("apkFileName");
outFile = new File(appDir, "dist" + File.separator
+ (outFileName == null ? "out.apk" : outFileName));
}
new File(appDir, APK_DIRNAME).mkdirs();
buildSources(appDir, flags);
buildResources(appDir, flags,
(Map<String, Object>) meta.get("usesFramework"));
buildLib(appDir, flags);
buildApk(appDir, outFile, flags);
}
示例2: decode
import brut.androlib.err.InFileNotFoundException; //导入依赖的package包/类
public void decode() throws AndrolibException, IOException {
File outDir = getOutDir();
if (!mForceDelete && outDir.exists()) {
throw new OutDirExistsException();
}
if (!mApkFile.isFile() || !mApkFile.canRead()) {
throw new InFileNotFoundException();
}
try {
OS.rmdir(outDir);
} catch (BrutException ex) {
throw new AndrolibException(ex);
}
outDir.mkdirs();
if (hasSources()) {
switch (mDecodeSources) {
case DECODE_SOURCES_NONE:
mAndrolib.decodeSourcesRaw(mApkFile, outDir, mDebug);
break;
case DECODE_SOURCES_SMALI:
mAndrolib.decodeSourcesSmali(mApkFile, outDir, mDebug, mBakDeb);
break;
case DECODE_SOURCES_JAVA:
mAndrolib.decodeSourcesJava(mApkFile, outDir, mDebug);
break;
}
}
if (hasResources()) {
// read the resources.arsc checking for STORED vs DEFLATE
// compression
// this will determine whether we compress on rebuild or not.
JarFile jf = new JarFile(mApkFile.getAbsoluteFile());
JarEntry je = jf.getJarEntry("resources.arsc");
if (je != null) {
int compression = je.getMethod();
mCompressResources = (compression != ZipEntry.STORED)
&& (compression == ZipEntry.DEFLATED);
}
jf.close();
switch (mDecodeResources) {
case DECODE_RESOURCES_NONE:
mAndrolib.decodeResourcesRaw(mApkFile, outDir);
break;
case DECODE_RESOURCES_FULL:
mAndrolib.decodeResourcesFull(mApkFile, outDir, getResTable());
break;
}
} else {
// if there's no resources.asrc, decode the manifest without looking
// up attribute references
if (hasManifest()) {
switch (mDecodeResources) {
case DECODE_RESOURCES_NONE:
mAndrolib.decodeManifestRaw(mApkFile, outDir);
break;
case DECODE_RESOURCES_FULL:
mAndrolib.decodeManifestFull(mApkFile, outDir,
getResTable());
break;
}
}
}
mAndrolib.decodeRawFiles(mApkFile, outDir);
writeMetaFile();
}