Skip to content

Instantly share code, notes, and snippets.

View nickcaballero's full-sized avatar
🏠
Working from home

Nick Caballero nickcaballero

🏠
Working from home
View GitHub Profile
@khernyo
khernyo / build.gradle
Created December 6, 2012 18:39
Gradle Android configuration with .so hack
// 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 February 22, 2011 17:16
A reflection hack to override the APK ClassLoader so you can launch Activities in an external JAR.
//
// !!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);