MCPcopy Index your code
hub / github.com/DexPatcher/multidexlib2

github.com/DexPatcher/multidexlib2 @v2.3.4.r2

Chat with this repo
repository ↗ · DeepWiki ↗ · release v2.3.4.r2 ↗ · + Follow
89 symbols 171 edges 21 files 0 documented · 0%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

multidexlib2

Multi-dex extensions for dexlib2.

Maven Central Build Status

This is a free software (GPLv3+) library on top of dexlib2 that features: - Multi-dex reading and writing. - Optional management of the content of the main dex file when writing multi-dex. - Simplified read/write access to multi-dex containers as plain-old dexlib2 DexFile objects, making it trivial to add multi-dex support to existing non-multi-dex-aware dexlib2 clients. - Faster dex reads than plain dexlib2. - Optional multi-threaded multi-dex writes that deliver greatly increased write performance. - Automatic management of dex version, dex opcodes, and API level. - Configurable naming of multi-dex member files. - Progress logging to a client-provided logger.

Limitations: - Only supports dex files. (Does not support odex/oat files.) - Only writes dex files to directories. (Does not write into zip files.)

DISTRIBUTION

Releases of multidexlib2 are distributed with coordinates com.github.lanchon.dexpatcher:multidexlib2 through the Maven Central Repository, with version numbers starting at 2.2.0 and matching the version of dexlib2 they were built against. Release changelog is available here.

USAGE

Interface: - MultiDexIO: read and write potentially multi-dex containers. - readDexFile(): read potentially multi-dex container and return a single, merged DexFile. - readMultiDexContainer(): read potentially multi-dex container and return a MultiDexContainer. - writeDexFile(): write potentially multi-dex container from a single DexFile. - RawDexIO: read and write single dex files (supersedes invoking dexlib2 directly).

Parameters: - boolean multiDex: true to enable multi-dex support. - File file: file or directory to read or write. - DexFileNamer namer: set to new BasicDexFileNamer(). - Opcodes opcodes: null to auto-detect. - int maxDexPoolSize: set to DexIO.DEFAULT_MAX_DEX_POOL_SIZE. - int threadCount: thread count for multi-threaded multi-dex writes. - 1 to force single-threaded writes. - 0 to auto-detect optimum thread count. - int minMainDexClassCount, boolean minimalMainDex: main dex file content management. - 0, false to disable main dex management. - DexIO.Logger logger: null to disable logging.

Sample:

DexPatcher's file processor is a simple yet production-quality client of multidexlib2.

Extension points exported contracts — how you extend this code

DexFileNamer (Interface)
(no doc) [2 implementers]
src/main/java/lanchon/multidexlib2/DexFileNamer.java
Logger (Interface)
(no doc)
src/main/java/lanchon/multidexlib2/DexIO.java

Core symbols most depended-on inside this repo

getClasses
called by 7
src/main/java/lanchon/multidexlib2/MultiDexContainerBackedDexFile.java
hasNext
called by 5
src/main/java/lanchon/multidexlib2/BatchedIterator.java
getOpcodes
called by 5
src/main/java/lanchon/multidexlib2/MultiDexContainerBackedDexFile.java
log
called by 4
src/main/java/lanchon/multidexlib2/DexIO.java
next
called by 4
src/main/java/lanchon/multidexlib2/BatchedIterator.java
getDexEntryNames
called by 4
src/main/java/lanchon/multidexlib2/AbstractMultiDexContainer.java
writeRawDexSingleThread
called by 3
src/main/java/lanchon/multidexlib2/DexIO.java
preloadBatch
called by 3
src/main/java/lanchon/multidexlib2/BatchedIterator.java

Shape

Method 67
Class 20
Interface 2

Languages

Java100%

Modules by API surface

src/main/java/lanchon/multidexlib2/DexIO.java10 symbols
src/main/java/lanchon/multidexlib2/DexFileNameIterator.java8 symbols
src/main/java/lanchon/multidexlib2/MultiDexIO.java7 symbols
src/main/java/lanchon/multidexlib2/OpcodeUtils.java6 symbols
src/main/java/lanchon/multidexlib2/BatchedIterator.java6 symbols
src/main/java/lanchon/multidexlib2/AbstractMultiDexContainer.java6 symbols
src/main/java/lanchon/multidexlib2/BasicDexFileNamer.java5 symbols
src/main/java/lanchon/multidexlib2/BasicDexEntry.java5 symbols
src/main/java/lanchon/multidexlib2/RawDexIO.java4 symbols
src/main/java/lanchon/multidexlib2/MultiDexContainerBackedDexFile.java4 symbols
src/main/java/lanchon/multidexlib2/DexFileNamer.java4 symbols
src/main/java/lanchon/multidexlib2/DexFileNameComparator.java4 symbols

For agents

$ claude mcp add multidexlib2 \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact