From 9254b5d8a4728e0eddebc8c193b68a95e2941748 Mon Sep 17 00:00:00 2001 From: auth <64337177+authorisation@users.noreply.github.com> Date: Sun, 24 Dec 2023 21:26:17 +0100 Subject: [PATCH] init documentation --- README.md | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..687f46c --- /dev/null +++ b/README.md @@ -0,0 +1,43 @@ +# Scripting Documentation +Hello! Here is the long awaited Documentation for the Scripting Engine.
+Contributions and improvements to this Documentation are gladly accepted via PRs.
+In case of any questions, feel free to ask via opening an issue or asking on our Telegram Discussions Chat. + +## Script Header + +Every script written for the Scripting Engine must include a header section at the beginning of the file. The header follows a specific format, as shown below: +``` +// ==SE_module== +// name: Script Name +// description: Script description +// version: 1.0 +// author: Author +// ==/SE_module== +``` +The following fields are required: `name`, `version`
+Additionally, there are also optional fields available which are: `description`, `author`, `minSnapchatVersion`, `minSEVersion`, `grantedPermissions` + +### Field Description + +`name`: Descriptive name for the script.
+`author`: Name of the script's creator.
+`version`: Version number of the script (e.g., 1.0).
+`description`: Brief explanation of the script's functionality.
+`minSnapchatVersion`: Minimum required Snapchat version code (e.g., 106822).
+`minSEVersion`: Minimum required SnapEnhance version code (e.g., ).
+`grantedPermissions`: - + +## Examples +To start off, you can find a couple of Example scripts written by us [here](https://github.com/SnapEnhance/docs/tree/main/examples). + +### `disable_camera.js`
+This scripts main function is, as probably recognizable by the name, to disable the camera.
+Conveniently enough, Android offers a great way to do this by using [`getCameraDisabled`](https://developer.android.com/reference/android/app/admin/DevicePolicyManager#getCameraDisabled(android.content.ComponentName)). +```js +var getCameraDisabledMethod = hooker.findMethodWithParameters("android.app.admin.DevicePolicyManager", "getCameraDisabled", ["android.content.ComponentName"]) + +hooker.hook(getCameraDisabledMethod, hooker.stage.BEFORE, param => { + param.result = true +}) +``` +It does this by hooking `getCameraDisabled` in the `android.app.admin.DevicePolicyManager` class and making Snapchat believe the camera is disabled by always returning true.