Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Map<String, ClassLoader> loaders;
- DexClassLoader dexLoader;
- static int val = 40;
- @Override
- public void handleLoadPackage(LoadPackageParam lpparam) throws Throwable {
- if(!lpparam.packageName.equals("com.oppo.camera"))
- return;
- Class<?> pm = XposedHelpers.findClass("com.oppo.camera.Plugin.PluginManager", lpparam.classLoader);
- XposedHelpers.findAndHookMethod(pm, "addMode", new XC_MethodHook() {
- @Override
- protected void afterHookedMethod(MethodHookParam param)
- throws Throwable {
- loaders = (Map) XposedHelpers.getObjectField(param.thisObject, "mClassLoaderIsLoaded");
- dexLoader = (DexClassLoader) loaders.get("professional");
- Class pr = XposedHelpers.findClass("com.oppo.camera.professional.ManualFocusController", dexLoader);
- XposedHelpers.findAndHookMethod(pr, "initControllerView", new XC_MethodReplacement() {
- @Override
- protected Object replaceHookedMethod(final MethodHookParam param)
- throws Throwable {
- SeekBar bar = new SeekBar((Context) XposedHelpers.getObjectField(param.thisObject, "mContext"));
- bar.setLayoutParams(new LayoutParams(-2, -2));
- bar.setOnSeekBarChangeListener(new OnSeekBarChangeListener() {
- @Override
- public void onStopTrackingTouch(SeekBar arg0) {
- // TODO Auto-generated method stub
- }
- @Override
- public void onStartTrackingTouch(SeekBar arg0) {
- // TODO Auto-generated method stub
- }
- @Override
- public void onProgressChanged(SeekBar bar, int val, boolean arg2) {
- Object handler = XposedHelpers.getObjectField(param.thisObject, "mOnManualFocusSeekBarChange");
- XposedHelpers.callMethod(handler, "OnProgressChange", val);
- XposedBridge.log("Put: " + val);
- }
- });
- ((LinearLayout) param.thisObject).addView(bar);
- return null;
- }
- });
- }
- });
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement