如何使用XposedHook禁用相机?

时间:2017-03-09 04:32:53

标签: xposed

我想使用xposed停用相机。所以我无法理解我应该挂钩哪种原生方法,以便我的手机摄像头被禁用。

我试过了: -

public class main1 implements IXposedHookLoadPackage {

@Override
public  void handleLoadPackage(final LoadPackageParam lpparam) throws  Throwable{
    if(!lpparam.packageName.equals("android.hardware.camera2"))
        return;

    findAndHookMethod("android.hardware.camera2.CameraManager", lpparam.classLoader, "openCamera", String.class, CameraDevice.StateCallback.class, Handler.class, new XC_MethodReplacement() {
        @Override
        protected Object replaceHookedMethod(MethodHookParam methodHookParam) throws Throwable {
            XposedBridge.log("CameraBlocked");
            return null;
        }
    });
    XposedBridge.log("Loaded app: " + lpparam.packageName);
  }
 } 

但它不起作用。请帮帮我。

0 个答案:

没有答案