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


Java CfOptions类代码示例

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


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

示例1: DexConverter

import com.android.dx.dex.cf.CfOptions; //导入依赖的package包/类
public DexConverter() {
    this.cfOptions = new CfOptions();
    this.cfOptions.positionInfo = 2;
    this.cfOptions.localInfo = true;
    this.cfOptions.strictNameCheck = false;
    this.cfOptions.optimize = true;
    this.cfOptions.optimizeListFile = null;
    this.cfOptions.dontOptimizeListFile = null;
    this.cfOptions.statistics = false;
    this.cfOptions.warn = DxConsole.noop;

    this.dexOptions = new DexOptions();
    this.dexOptions.forceJumbo = false;

    outputDex = new DexFile(dexOptions);
}
 
开发者ID:imkiva,项目名称:Krine,代码行数:17,代码来源:DexConverter.java

示例2: defineClass

import com.android.dx.dex.cf.CfOptions; //导入依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
public Class<?> defineClass(String name, byte[] data) {
    try {
        DexOptions dexOptions = new DexOptions();
        DexFile dexFile = new DexFile(dexOptions);
        DirectClassFile classFile = new DirectClassFile(data, name.replace('.', '/') + ".class", true);
        classFile.setAttributeFactory(StdAttributeFactory.THE_ONE);
        classFile.getMagic();
        dexFile.add(CfTranslator.translate(classFile, null, new CfOptions(), dexOptions, dexFile));
        Dex dex = new Dex(dexFile.toDex(null, false));
        Dex oldDex = getLastDex();
        if (oldDex != null) {
            dex = new DexMerger(new Dex[]{dex, oldDex}, CollisionPolicy.KEEP_FIRST).merge();
        }
        return loadClass(dex, name);
    } catch (IOException | ClassNotFoundException e) {
        throw new FatalLoadingException(e);
    }
}
 
开发者ID:F43nd1r,项目名称:rhino-android,代码行数:23,代码来源:BaseAndroidClassLoader.java

示例3: makeOptionsObjects

import com.android.dx.dex.cf.CfOptions; //导入依赖的package包/类
/**
 * Copies relevent arguments over into CfOptions and
 * DexOptions instances.
 */
private void makeOptionsObjects() {
    cfOptions = new CfOptions();
    cfOptions.positionInfo = positionInfo;
    cfOptions.localInfo = localInfo;
    cfOptions.strictNameCheck = strictNameCheck;
    cfOptions.optimize = optimize;
    cfOptions.optimizeListFile = optimizeListFile;
    cfOptions.dontOptimizeListFile = dontOptimizeListFile;
    cfOptions.statistics = statistics;

    if (warnings) {
        cfOptions.warn = System.err;
    } else {
        cfOptions.warn = System.err;
    }

    dexOptions = new DexOptions();
    dexOptions.forceJumbo = forceJumbo;
}
 
开发者ID:RunasSudo,项目名称:PyAndroid,代码行数:24,代码来源:Dexer.java

示例4: makeOptionsObjects

import com.android.dx.dex.cf.CfOptions; //导入依赖的package包/类
/**
 * Copies relevent arguments over into CfOptions and
 * DexOptions instances.
 */
private void makeOptionsObjects() {
    cfOptions = new CfOptions();
    cfOptions.positionInfo = positionInfo;
    cfOptions.localInfo = localInfo;
    cfOptions.strictNameCheck = strictNameCheck;
    cfOptions.optimize = optimize;
    cfOptions.optimizeListFile = optimizeListFile;
    cfOptions.dontOptimizeListFile = dontOptimizeListFile;
    cfOptions.statistics = statistics;

    if (warnings) {
        cfOptions.warn = DxConsole.err;
    } else {
        cfOptions.warn = DxConsole.noop;
    }

    dexOptions = new DexOptions();
    dexOptions.forceJumbo = forceJumbo;
}
 
开发者ID:johnlee175,项目名称:dex,代码行数:24,代码来源:Main.java

示例5: dex

import com.android.dx.dex.cf.CfOptions; //导入依赖的package包/类
private static final byte[] dex(String className, byte[] classData) throws ClassFormatError {
    try {
        DexOptions dexOptions = new DexOptions();
        DexFile dxFile = new DexFile(dexOptions);
        CfOptions cfOptions = new CfOptions();
        dxFile.add(CfTranslator.translate(className.replace('.', '/') + ".class", classData, cfOptions, dexOptions));
        StringWriter out = BridJ.debug ? new StringWriter() : null;
        byte[] dexData = dxFile.toDex(out, false);
        if (BridJ.debug) {
            BridJ.info("Dex output for class " + className + " : " + out);
        }
        return dexData;
    } catch (IOException ex) {
        throw new ClassFormatError("Unable to convert class data to Dalvik code using Dex : " + ex);
    }
}
 
开发者ID:nativelibs4java,项目名称:BridJ,代码行数:17,代码来源:AndroidClassDefiner.java

示例6: makeOptionsObjects

import com.android.dx.dex.cf.CfOptions; //导入依赖的package包/类
/**
 * Copies relevent arguments over into CfOptions and
 * DexOptions instances.
 */
private void makeOptionsObjects() {
    cfOptions = new CfOptions();
    cfOptions.positionInfo = positionInfo;
    cfOptions.localInfo = localInfo;
    cfOptions.strictNameCheck = strictNameCheck;
    cfOptions.optimize = optimize;
    cfOptions.optimizeListFile = optimizeListFile;
    cfOptions.dontOptimizeListFile = dontOptimizeListFile;
    cfOptions.statistics = statistics;
    cfOptions.warn = dxConsole.err;
    cfOptions.codeStatistics = new CodeStatistics();

    dexOptions = new DexOptions();
    dexOptions.forceJumbo = forceJumbo;
}
 
开发者ID:saleehk,项目名称:buck-cutom,代码行数:20,代码来源:Main.java

示例7: makeOptionsObjects

import com.android.dx.dex.cf.CfOptions; //导入依赖的package包/类
/**
 * Copies relevant arguments over into CfOptions and
 * DexOptions instances.
 */
public void makeOptionsObjects(DxContext context) {
    cfOptions = new CfOptions();
    cfOptions.positionInfo = positionInfo;
    cfOptions.localInfo = localInfo;
    cfOptions.strictNameCheck = strictNameCheck;
    cfOptions.optimize = optimize;
    cfOptions.optimizeListFile = optimizeListFile;
    cfOptions.dontOptimizeListFile = dontOptimizeListFile;
    cfOptions.statistics = statistics;

    if (warnings) {
        cfOptions.warn = context.err;
    } else {
        cfOptions.warn = context.noop;
    }

    dexOptions = new DexOptions();
    dexOptions.forceJumbo = forceJumbo;
}
 
开发者ID:facebook,项目名称:buck,代码行数:24,代码来源:Main.java

示例8: makeOptionsObjects

import com.android.dx.dex.cf.CfOptions; //导入依赖的package包/类
/**
 * Copies relevent arguments over into CfOptions and
 * DexOptions instances.
 */
private void makeOptionsObjects() {
    cfOptions = new CfOptions();
    cfOptions.positionInfo = positionInfo;
    cfOptions.localInfo = localInfo;
    cfOptions.strictNameCheck = strictNameCheck;
    cfOptions.optimize = optimize;
    cfOptions.optimizeListFile = optimizeListFile;
    cfOptions.dontOptimizeListFile = dontOptimizeListFile;
    cfOptions.statistics = statistics;
    cfOptions.warn = DxConsole.err;

    dexOptions = new DexOptions();
    dexOptions.forceJumbo = forceJumbo;
}
 
开发者ID:JLLK,项目名称:multidex-maker,代码行数:19,代码来源:Main.java

示例9: makeOptionsObjects

import com.android.dx.dex.cf.CfOptions; //导入依赖的package包/类
/**
 * Copies relevent arguments over into CfOptions and
 * DexOptions instances.
 */
private void makeOptionsObjects() {
    cfOptions = new CfOptions();
    cfOptions.positionInfo = positionInfo;
    cfOptions.localInfo = localInfo;
    cfOptions.strictNameCheck = strictNameCheck;
    cfOptions.optimize = optimize;
    cfOptions.optimizeListFile = optimizeListFile;
    cfOptions.dontOptimizeListFile = dontOptimizeListFile;
    cfOptions.statistics = statistics;
    cfOptions.warn = DxConsole.err;

    dexOptions = new DexOptions();
    dexOptions.targetApiLevel = targetApiLevel;
}
 
开发者ID:AndreJCL,项目名称:JCL,代码行数:19,代码来源:Main.java

示例10: generateDexFile

import com.android.dx.dex.cf.CfOptions; //导入依赖的package包/类
private OutputFile generateDexFile(OutputFile classFile) {
    if (!classFile.getFullPath().startsWith(arguments.option_out())) {
        Log.error("DexOutputProcess: Something is wrong with the class output path.");
        return null;
    }
    String relativePath = classFile.getFullPath()
            .substring(arguments.option_out().length() + 1);

    // Remove a starting slash or backslash.
    if (relativePath.startsWith("/") || relativePath.startsWith("\\")) {
        relativePath = relativePath.substring(1);
    }
    Log.debug("DExing:" + relativePath);

    CfOptions options = new CfOptions();
    options.strictNameCheck = false;
    ClassDefItem item = CfTranslator.translate(relativePath, classFile.getDataAsBytes(),
            options);
    DexFile dexFile = new DexFile();
    dexFile.add(item);
    try {
        byte[] rawDex = dexFile.toDex(null, false);
        OutputFile result = new OutputFile(rawDex);
        result.setLocation(classFile.getLocation());
        result.setFileName(classFile.getFileName().replace(ClassFile.CLASS_ENDING, DEX_ENDING));
        return result;
    } catch (IOException e) {
        e.printStackTrace();
        Log.error("Could not generate DEX file.");
    }
    return null;
}
 
开发者ID:shannah,项目名称:cn1,代码行数:33,代码来源:DexOutputProcess.java

示例11: toCfOptions

import com.android.dx.dex.cf.CfOptions; //导入依赖的package包/类
public CfOptions toCfOptions(DxContext context) {
  CfOptions result = new CfOptions();
  result.localInfo = this.localInfo;
  result.optimize = this.optimize;
  result.warn = printWarnings ? context.err : Dexing.nullout;
  // Use dx's defaults
  result.optimizeListFile = null;
  result.dontOptimizeListFile = null;
  result.positionInfo = positionInfo;
  result.strictNameCheck = true;
  result.statistics = false; // we're not supporting statistics anyways
  return result;
}
 
开发者ID:bazelbuild,项目名称:bazel,代码行数:14,代码来源:Dexing.java

示例12: convertClass

import com.android.dx.dex.cf.CfOptions; //导入依赖的package包/类
private static DexFile convertClass(Class<?> clazz) throws IOException {
  String path = clazz.getName().replace('.', '/') + ".class";
  try (InputStream in =
      Thread.currentThread().getContextClassLoader().getResourceAsStream(path)) {
    return new DexConverter(new Dexing(new DxContext(), new DexOptions(), new CfOptions()))
        .toDexFile(ByteStreams.toByteArray(in), path);
  }
}
 
开发者ID:bazelbuild,项目名称:bazel,代码行数:9,代码来源:DexFileAggregatorTest.java

示例13: makeStuffer

import com.android.dx.dex.cf.CfOptions; //导入依赖的package包/类
private void makeStuffer() {
  stuffer =
      new DexConversionEnqueuer(
          zip,
          newDirectExecutorService(),
          new DexConverter(new Dexing(new DxContext(), new DexOptions(), new CfOptions())),
          cache);
}
 
开发者ID:bazelbuild,项目名称:bazel,代码行数:9,代码来源:DexConversionEnqueuerTest.java

示例14: addClass

import com.android.dx.dex.cf.CfOptions; //导入依赖的package包/类
public void addClass(String nameClass, byte[] byteClass) {
    final CfOptions cf_options = new CfOptions();
    //System.out.println(nameClass);
    final ClassDefItem cdi = CfTranslator.translate(nameClass, byteClass, cf_options, dex_options);
    file.add(cdi);
}
 
开发者ID:AndreJCL,项目名称:JCL,代码行数:7,代码来源:DexFile.java

示例15: Dexing

import com.android.dx.dex.cf.CfOptions; //导入依赖的package包/类
@VisibleForTesting
Dexing(DxContext context, DexOptions dexOptions, CfOptions cfOptions) {
  this.context = context;
  this.dexOptions = dexOptions;
  this.cfOptions = cfOptions;
}
 
开发者ID:bazelbuild,项目名称:bazel,代码行数:7,代码来源:Dexing.java


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