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


Java FileDataStore类代码示例

本文整理汇总了Java中org.jf.dexlib2.writer.io.FileDataStore的典型用法代码示例。如果您正苦于以下问题:Java FileDataStore类的具体用法?Java FileDataStore怎么用?Java FileDataStore使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


FileDataStore类属于org.jf.dexlib2.writer.io包,在下文中一共展示了FileDataStore类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: buildCode

import org.jf.dexlib2.writer.io.FileDataStore; //导入依赖的package包/类
public static Set<String> buildCode(File smaliDir, File dexFile, DexDiffInfo info) throws IOException,
        RecognitionException {
    Set<String> classes = new HashSet<String>();
    Set<DexBackedClassDef> classDefs = new HashSet<DexBackedClassDef>();
    classDefs.addAll(info.getModifiedClasses());
    classDefs.addAll(info.getAddedClasses());
    final ClassFileNameHandler outFileNameHandler = new ClassFileNameHandler(smaliDir, ".smali");
    final ClassFileNameHandler inFileNameHandler = new ClassFileNameHandler(smaliDir, ".smali");
    DexBuilder dexBuilder = DexBuilder.makeDexBuilder();
    File smaliFile;
    String className;
    for (DexBackedClassDef classDef : classDefs) {
        ApkPatch.currentClassType = classDef.getType();
        className = TypeGenUtil.newType(classDef.getType());
        AfBakSmali.disassembleClass(classDef, outFileNameHandler, getBuildOption(classDefs, 19), false, false);
        smaliFile = inFileNameHandler.getUniqueFilenameForClass(className);
        classes.add(className.substring(1, className.length() - 1).replace('/', '.'));
        SmaliMod.assembleSmaliFile(smaliFile, dexBuilder, true, true);
    }

    dexBuilder.writeTo(new FileDataStore(dexFile));

    return classes;
}
 
开发者ID:alibaba,项目名称:atlas,代码行数:25,代码来源:SmaliDiffUtils.java

示例2: writeTo

import org.jf.dexlib2.writer.io.FileDataStore; //导入依赖的package包/类
public static void writeTo(@Nonnull String path, @Nonnull org.jf.dexlib2.iface.DexFile input) throws IOException {
     DexPool dexPool = makeDexPool();
     for (ClassDef classDef: input.getClasses()) {
     	/*
     	 * Modified(@CwT)
     	 * The reason I modified this place(add continue here) is that I modified the function
     	 * @link getClasses
     	 * I want to add a filter and consequently drop some class which lead to return some null
     	 * class. I just ignore here. 
     	 */
     	if (classDef == null) {
	continue;
}
         ((ClassPool)dexPool.classSection).intern(classDef);
     }
     dexPool.writeTo(new FileDataStore(new File(path)));
 }
 
开发者ID:CvvT,项目名称:DexTamper,代码行数:18,代码来源:DexPool.java

示例3: build

import org.jf.dexlib2.writer.io.FileDataStore; //导入依赖的package包/类
private void build() throws AndrolibException {
    try {
        DexBuilder dexBuilder = DexBuilder.makeDexBuilder();

        for (String fileName : mSmaliDir.getDirectory().getFiles(true)) {
            buildFile(fileName, dexBuilder);
        }
        dexBuilder.writeTo(new FileDataStore( new File(mDexFile.getAbsolutePath())));
    } catch (IOException | DirectoryException ex) {
        throw new AndrolibException(ex);
    }
}
 
开发者ID:imkiva,项目名称:AndroidApktool,代码行数:13,代码来源:SmaliBuilder.java

示例4: assembleSmaliFile

import org.jf.dexlib2.writer.io.FileDataStore; //导入依赖的package包/类
/**
 * 将smali文件夹转换为dex文件
 * @param smaliFolder
 * @param outDexFile
 * @return
 */
public static boolean assembleSmaliFile(File smaliFolder,File outDexFile) throws IOException, RecognitionException {
    Collection<File> smaliFiles =  FileUtils.listFiles(smaliFolder, new String[]{"smali"}, true);
    if(null!= smaliFiles && smaliFiles.size() > 0){
        DexBuilder dexBuilder = DexBuilder.makeDexBuilder();
        for(File smaliFile:smaliFiles){
            SmaliMod.assembleSmaliFile(smaliFile, dexBuilder, true, true);
        }
        dexBuilder.writeTo(new FileDataStore(outDexFile));
        return true;
    }else{
        return false;
    }
}
 
开发者ID:alibaba,项目名称:atlas,代码行数:20,代码来源:SmaliUtils.java

示例5: writeTo

import org.jf.dexlib2.writer.io.FileDataStore; //导入依赖的package包/类
public static void writeTo(@Nonnull String path, @Nonnull org.jf.dexlib2.iface.DexFile input) throws IOException {
    DexPool dexPool = makeDexPool();
    for (ClassDef classDef: input.getClasses()) {
        ((ClassPool)dexPool.classSection).intern(classDef);
    }
    dexPool.writeTo(new FileDataStore(new File(path)));
}
 
开发者ID:CvvT,项目名称:andbg,代码行数:8,代码来源:DexPool.java

示例6: writeTo

import org.jf.dexlib2.writer.io.FileDataStore; //导入依赖的package包/类
public static void writeTo( String path,  org.jf.dexlib2.iface.DexFile input) throws IOException {
    DexPool dexPool = new DexPool(input.getOpcodes());
    for (ClassDef classDef: input.getClasses()) {
        dexPool.internClass(classDef);
    }
    dexPool.writeTo(new FileDataStore(new File(path)));
}
 
开发者ID:AndreJCL,项目名称:JCL,代码行数:8,代码来源:DexPool.java

示例7: writeTo

import org.jf.dexlib2.writer.io.FileDataStore; //导入依赖的package包/类
public static void writeTo(@Nonnull String path, @Nonnull org.jf.dexlib2.iface.DexFile input) throws IOException {
    DexPool dexPool = makeDexPool();
    for (ClassDef classDef : input.getClasses()) {
        ((ClassPool) dexPool.classSection).intern(classDef);
    }
    dexPool.writeTo(new FileDataStore(new File(path)));
}
 
开发者ID:niranjan94,项目名称:show-java,代码行数:8,代码来源:DexPool.java

示例8: writeRawDexFile

import org.jf.dexlib2.writer.io.FileDataStore; //导入依赖的package包/类
public static void writeRawDexFile(File file, DexFile dexFile, int maxDexPoolSize, DexIO.Logger logger)
		throws IOException {
	DexIO.writeRawDexSingleThread(new FileDataStore(file), dexFile, maxDexPoolSize, logger, file);
}
 
开发者ID:DexPatcher,项目名称:multidexlib2,代码行数:5,代码来源:RawDexIO.java

示例9: writeTo

import org.jf.dexlib2.writer.io.FileDataStore; //导入依赖的package包/类
private void writeTo(String fileName) throws IOException {
	FileDataStore fds = new FileDataStore(new File(fileName));
	dexFile.writeTo(fds);
	fds.close();
}
 
开发者ID:flankerhqd,项目名称:JAADAS,代码行数:6,代码来源:DexPrinter.java


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