mirror of
https://github.com/SnapEnhance/scripting-docs.git
synced 2026-08-30 20:24:23 +00:00
fix(examples): disable_camera
This commit is contained in:
@@ -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
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user