Попробуйте использовать приведенный ниже код.Надеюсь, это поможет вам.
Вот ссылка !
findAndHookMethod("com.android.systemui.statusbar.policy.BatteryController", lpParam.classLoader, "onReceive", Context.class, Intent.class, new XC_MethodHook() {
@Override
protected void afterHookedMethod(MethodHookParam param) throws Throwable {
try {
Intent pi = (Intent) param.args[1];
int status = pi.getIntExtra("status", 1);
int blevel = pi.getIntExtra("level", 0);
@SuppressWarnings("unchecked")
int j = ((ArrayList<ImageView>) getObjectField(param.thisObject, "mIconViews")).size();
for (int k = 0; k < j; k++) {
@SuppressWarnings("unchecked")
ImageView iv = ((ArrayList<ImageView>) getObjectField(param.thisObject, "mIconViews")).get(k);
if (status == 2 && blevel < 100) {
AnimationDrawable animation = new AnimationDrawable();
for (int i = 0; i < filearray.size(); i++) {
String cbimg = "battery/charge/" + filearray.get(i);
// Log.d("XSBM", "Req charge img: " + cbimg);
final Bitmap cb = ZipStuff.getBitmap(path, cbimg, 240);
Drawable cd = new BitmapDrawable(null, cb);
animation.addFrame(cd, paramPrefs.getInt("charge_delay", 350));
}
if (paramPrefs.getBoolean("altcharge", false)) {
String bimg = "battery/" + battarray[blevel];
final Bitmap b = ZipStuff.getBitmap(path, bimg, 240);
Drawable bd = new BitmapDrawable(null, b);
animation.addFrame(bd, 500);
}
animation.setOneShot(false);
iv.setImageDrawable(animation);
animation.start();
} else if (status == 2 && blevel >= 100) {
String bimg = "battery/" + battarray[100];
final Bitmap b = ZipStuff.getBitmap(path, bimg, 240);
Drawable d = new BitmapDrawable(null, b);
iv.setImageDrawable(d);
} else {
String bimg = "battery/" + battarray[blevel];
final Bitmap b = ZipStuff.getBitmap(path, bimg, 240);
Drawable d = new BitmapDrawable(null, b);
iv.setImageDrawable(d);
}
}
} catch (Throwable t) { XposedBridge.log(t); }
}
});
}