fix(examples): disable_camera

This commit is contained in:
rhunk
2023-12-24 18:16:05 +01:00
committed by GitHub
parent 38dada3ed0
commit 1aff5e953b

View File

@@ -23,10 +23,10 @@ module.onSnapMainActivityCreate = activity => {
var getCameraDisabledMethod = hooker.findMethodWithParameters("android.app.admin.DevicePolicyManager", "getCameraDisabled", ["android.content.ComponentName"]) var getCameraDisabledMethod = hooker.findMethodWithParameters("android.app.admin.DevicePolicyManager", "getCameraDisabled", ["android.content.ComponentName"])
hooker.hook(getCameraDisabledMethod, hooker.stage.BEFORE, param => { hooker.hook(getCameraDisabledMethod, hooker.stage.BEFORE, param => {
if (!config.getBoolean("disableCamera", false)) { var shouldDisableCamera = config.getBoolean("disableCamera") == true
return logInfo("getCameraDisabled called! shouldDisableCamera=" + shouldDisableCamera)
if (shouldDisableCamera) {
param.result = true
} }
logInfo("getCameraDisabled called!")
param.result = true
}) })
} }