From 1aff5e953b2b9bdce088f145028dc4c1f7b2dcd6 Mon Sep 17 00:00:00 2001 From: rhunk <101876869+rhunk@users.noreply.github.com> Date: Sun, 24 Dec 2023 18:16:05 +0100 Subject: [PATCH] fix(examples): disable_camera --- examples/disable_camera.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/examples/disable_camera.js b/examples/disable_camera.js index 38b2068..0b06528 100644 --- a/examples/disable_camera.js +++ b/examples/disable_camera.js @@ -23,10 +23,10 @@ module.onSnapMainActivityCreate = activity => { var getCameraDisabledMethod = hooker.findMethodWithParameters("android.app.admin.DevicePolicyManager", "getCameraDisabled", ["android.content.ComponentName"]) hooker.hook(getCameraDisabledMethod, hooker.stage.BEFORE, param => { - if (!config.getBoolean("disableCamera", false)) { - return + var shouldDisableCamera = config.getBoolean("disableCamera") == true + logInfo("getCameraDisabled called! shouldDisableCamera=" + shouldDisableCamera) + if (shouldDisableCamera) { + param.result = true } - logInfo("getCameraDisabled called!") - param.result = true }) -} \ No newline at end of file +}