当前位置: 首页>>代码示例>>Java>>正文


Java InFileNotFoundException类代码示例

本文整理汇总了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);
}
 
开发者ID:Sukelluskello,项目名称:VectorAttackScanner,代码行数:35,代码来源:Androlib.java

示例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();
}
 
开发者ID:Sukelluskello,项目名称:VectorAttackScanner,代码行数:74,代码来源:ApkDecoder.java


注:本文中的brut.androlib.err.InFileNotFoundException类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。