Prerequiste:
Generate a file platform.priv.pem
from you pk8 file.
openssl pkcs8 -in platform.pk8 -inform DER -outform PEM -out platform.priv.pem -nocrypt
import javax.crypto.*; | |
import javax.crypto.spec.IvParameterSpec; | |
import javax.crypto.spec.PBEKeySpec; | |
import javax.crypto.spec.SecretKeySpec; | |
import java.nio.charset.StandardCharsets; | |
import java.security.InvalidAlgorithmParameterException; | |
import java.security.InvalidKeyException; | |
import java.security.NoSuchAlgorithmException; | |
import java.security.SecureRandom; | |
import java.security.spec.InvalidKeySpecException; |
import javax.crypto.Cipher; | |
import java.nio.charset.StandardCharsets; | |
import java.security.KeyPair; | |
import java.security.KeyPairGenerator; | |
import java.security.SecureRandom; | |
import java.security.Signature; | |
public class RsaExample { | |
public static void main(String... argv) throws Exception { | |
//First generate a public/private key pair |
// | |
// !!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); |
public class Dexter { | |
private static String optimizedDirectory = "optimized"; | |
private static String workDirectory = "working"; | |
public static void loadFromAssets(Context context, String fileName) throws Exception { | |
File optimized = new File(optimizedDirectory); | |
optimized = context.getDir(optimized.toString(), Context.MODE_PRIVATE); | |
optimized = new File(optimized, fileName); |
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
import urllib | |
import urllib2 | |
data = urllib2.urlencode({'foo': 'bar'}) | |
r = urllib2.Request('https://www.google.com', # url | |
data, # post data |
// | |
// !!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); |
This is gist. | |
There are many like it, but this one is mine. | |
It is my life. | |
I must master it as I must master my life. | |
Without me gist is useless. | |
Without gist, I am useless. |