mirror of
https://github.com/SnapEnhance/scripting-docs.git
synced 2026-08-31 04:32:30 +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"])
|
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
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user