All Projects → mmin18 → Dex65536

mmin18 / Dex65536

Licence: mit
Solve the issue with dalvik compiler limitation on 65536 methods (Unable to execute dex: method ID not in [0, 0xffff]: 65536)

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to Dex65536

Dexcalibur
[Official] Android reverse engineering tool focused on dynamic instrumentation automation. Powered by Frida. It disassembles dex, analyzes it statically, generates hooks, discovers reflected methods, stores intercepted data and does new things from it. Its aim is to be an all-in-one Android reverse engineering platform.
Stars: ✭ 512 (+45.45%)
Mutual labels:  apk, dex
Android Classyshark
Android and Java bytecode viewer
Stars: ✭ 6,930 (+1868.75%)
Mutual labels:  apk, dex
Adhrit
Android Security Suite for in-depth reconnaissance and static bytecode analysis based on Ghera benchmarks.
Stars: ✭ 399 (+13.35%)
Mutual labels:  apk, dex
Hellomello
Experiments with writing Android apps in Nim
Stars: ✭ 47 (-86.65%)
Mutual labels:  apk, dex
Android Crack Tool
🐞Android crack tool For Mac
Stars: ✭ 2,666 (+657.39%)
Mutual labels:  apk, dex
NinjaDroid
Ninja Reverse Engineering on Android APK packages
Stars: ✭ 224 (-36.36%)
Mutual labels:  apk, dex
Fakerandroid
A tool translate a apk file to stantard android project include so hook api and il2cpp c++ scaffolding when apk is a unity il2cpp game. Write code on a apk file elegantly.
Stars: ✭ 695 (+97.44%)
Mutual labels:  apk, dex
Fastdex
🚀 加快 apk 的编译速度 🚀
Stars: ✭ 1,457 (+313.92%)
Mutual labels:  apk, dex
Apk Changer
Command line program for modifying apk files
Stars: ✭ 122 (-65.34%)
Mutual labels:  apk, dex
dalvikgate
Lightweight dex / odex / apk to jar converter
Stars: ✭ 32 (-90.91%)
Mutual labels:  apk, dex
RocketXPlugin
🔥🔥 android 端编译加速插件🚀 自动识别未改动 module 并在编译流程中替换为 aar ,只编译改动模块,加速 Android apk 的编译速度。
Stars: ✭ 408 (+15.91%)
Mutual labels:  apk, dex
App Info Parser
A javascript parser for parsing .ipa or .apk files. IPA/APK文件 js 解析器
Stars: ✭ 298 (-15.34%)
Mutual labels:  apk
app info
Teardown tool for mobile app (ipa, apk and aab file) and dSYM.zip file, analysis metedata like version, name, icon etc.
Stars: ✭ 32 (-90.91%)
Mutual labels:  apk
atomicDEX-API
This is the official AtomicAPI (atomicDEX API) repository
Stars: ✭ 65 (-81.53%)
Mutual labels:  dex
ApkDecompiler
【Linux系统】上apk反编译助手,已打包为ApkDecompiler.deb,支持debian系linux,如debian、ubuntu、mint、deepin等等
Stars: ✭ 34 (-90.34%)
Mutual labels:  apk
Vancedmanager
Vanced Installer
Stars: ✭ 5,523 (+1469.03%)
Mutual labels:  apk
Zeronet Kivy
Android client for ZeroNet
Stars: ✭ 279 (-20.74%)
Mutual labels:  apk
universal-apk-builder
This action converts given *.aab file to universal *.apk file
Stars: ✭ 15 (-95.74%)
Mutual labels:  apk
AndTTT
🎲 Simple tic tac toe game for Android
Stars: ✭ 15 (-95.74%)
Mutual labels:  apk
Xam.Plugin.AutoUpdate
Xamarin Forms plugin that auto updates your Android or UWP sideloaded application.
Stars: ✭ 22 (-93.75%)
Mutual labels:  apk

Dex 65536

Unable to execute dex: method ID not in [0, 0xffff]: 65536)

When you get this message, normally it is not because your project itself has too much methods, but you are importing some big .jar libraries.

So the easy solution is to pack your .jar libraries in libs/ folder into a secondary .dex file and load that file before your application starts.

How to run sample project

/Dex65536 is the main project, depends on a android library project /Lib.

You can write code in eclipse, but you need to build/run in ant.

android update project -p ./Dex65536
android update project -p ./Lib
cd Dex65536
ant clean debug install run

(Make sure your android_sdk/tools is in the $PATH)

How to make it work on your own project

Step1: build tools

Dex65536/custom_rules.xml
Dex65536/pathtool.jar

Copy these two files in your android project, and execute the following command to generate build.xml.

android update project -p .

(Make sure your android_sdk/tools is in the $PATH)

Step2: add some code

You need to add some code to load the secondary .dex file before your application starts.

public class App extends Application {

	@Override
	public void onCreate() {
		super.onCreate();
		dexTool();
	}

	/**
	 * Copy the following code and call dexTool() after super.onCreate() in
	 * Application.onCreate()
	 * <p>
	 * This method hacks the default PathClassLoader and load the secondary dex
	 * file as it's parent.
	 */
	@SuppressLint("NewApi")
	private void dexTool() {

		File dexDir = new File(getFilesDir(), "dlibs");
		dexDir.mkdir();
		File dexFile = new File(dexDir, "libs.apk");
		File dexOpt = new File(dexDir, "opt");
		dexOpt.mkdir();
		try {
			InputStream ins = getAssets().open("libs.apk");
			if (dexFile.length() != ins.available()) {
				FileOutputStream fos = new FileOutputStream(dexFile);
				byte[] buf = new byte[4096];
				int l;
				while ((l = ins.read(buf)) != -1) {
					fos.write(buf, 0, l);
				}
				fos.close();
			}
			ins.close();
		} catch (Exception e) {
			throw new RuntimeException(e);
		}

		ClassLoader cl = getClassLoader();
		ApplicationInfo ai = getApplicationInfo();
		String nativeLibraryDir = null;
		if (Build.VERSION.SDK_INT > 8) {
			nativeLibraryDir = ai.nativeLibraryDir;
		} else {
			nativeLibraryDir = "/data/data/" + ai.packageName + "/lib/";
		}
		DexClassLoader dcl = new DexClassLoader(dexFile.getAbsolutePath(),
				dexOpt.getAbsolutePath(), nativeLibraryDir, cl.getParent());

		try {
			Field f = ClassLoader.class.getDeclaredField("parent");
			f.setAccessible(true);
			f.set(cl, dcl);
		} catch (Exception e) {
			throw new RuntimeException(e);
		}
	}

}

If you don't have a custom Application class, register one in your AndroidManifest.xml like:

<application
    android:name="com.github.mmin18.dex65536.App"
    android:icon="@drawable/ic_launcher"
    android:label="@string/app_name" >

Othersise you just need to copy dexTool() method into your own custom Application and call it after super.onCreate().

Step3: ant build and run

Make sure you have ant installed.

cd /YourProject
ant clean debug install run

Your project should be compile and runnable. Good luck.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].