包名为fbfh.pi.umfb
用packageName得到不是包名fbfh.pi.umfb的Application 拿到的不是其它应用的Application 而是当前的app
`clazz = getAllActivity(packageName);
Class clazzruntimeinit = clazz.forName("com.android.internal.os.RuntimeInit");//Class.forName("android.app.ActivityThread");
try {
Field localField1 = clazzruntimeinit.getDeclaredField("mApplicationObject");
localField1.setAccessible(true);
try {
Object localObject1 = localField1.get(clazzruntimeinit);
Class localClass2 = Class.forName("android.app.ActivityThread$ApplicationThread");
Field localField2 = localClass2.getDeclaredField("this$0");
localField2.setAccessible(true);
Object localObject2 = localField2.get(localObject1);
Class localClass3 = Class.forName("android.app.ActivityThread");
try {
Method localMethod = localClass3.getMethod("getApplication", new Class[0]);
localMethod.setAccessible(true);
try {
Application localApplication = (Application) localMethod.invoke(localObject2, new Object[0]);
if(localApplication !=null)
Yiet = localApplication;
} catch (InvocationTargetException e) {
e.printStackTrace();
}
} catch (NoSuchMethodException e) {
e.printStackTrace();
}
} catch (IllegalAccessException e) {
e.printStackTrace();
}
} catch (NoSuchFieldException e) {
e.printStackTrace();
}
} catch (ClassNotFoundException e) {
e.printStackTrace();
}