Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

Nick Caballero nickcaballero

🏠
Working from home
View GitHub Profile
@khernyo
khernyo / build.gradle
Created Dec 6, 2012
Gradle Android configuration with .so hack
View build.gradle
// This hack works with com.android.tools.build:gradle:0.2, won't work in later version without modification
apply plugin: 'android'
targetCompatibility = 1.6
sourceCompatibility = 1.6
android {
target = 'android-14'
@marshall
marshall / ClassLoaderActivity.java
Created Feb 22, 2011
A reflection hack to override the APK ClassLoader so you can launch Activities in an external JAR.
View ClassLoaderActivity.java
//
// !!WARNING: Not recommended for production code!!
//
public class ClassLoaderActivity extends Activity
{
public void onCreate(Bundle savedInstanceState)
{
// file.jar has a dex'd "classes.dex" entry that you can generate with "dx" from any number of JARs or class files
ClassLoader dexLoader = new DexClassLoader("/path/to/file.jar", getCacheDir().getAbsolutePath(), null, getClassLoader());
setAPKClassLoader(dexLoader);