
Research
/Security News
npm Package Uses Prompt Injection and Token Flooding to Disrupt AI Malware Scanners
A new npm package tests AI malware scanners with prompt injection, safety-triggering comments, context flooding, and obfuscated JavaScript.
@capgo/capacitor-brightness
Advanced tools
Control screen brightness on iOS and Android.
The only Capacitor plugin providing complete brightness control for both iOS and Android:
Essential for reading apps, video players, camera apps, and any app needing screen brightness control.
Full documentation available at: https://capgo.app/docs/plugins/brightness/
| Plugin version | Capacitor compatibility | Maintained |
|---|---|---|
| v8.*.* | v8.*.* | ✅ |
| v7.*.* | v7.*.* | On demand |
| v6.*.* | v6.*.* | ❌ |
| v5.*.* | v5.*.* | ❌ |
Note: The major version of this plugin follows the major version of Capacitor. Use the version that matches your Capacitor installation (e.g., plugin v8 for Capacitor 8). Only the latest major version is actively maintained.
You can use our AI-Assisted Setup to install the plugin. Add the Capgo skills to your AI tool using the following command:
npx skills add https://github.com/cap-go/capacitor-skills --skill capacitor-plugins
Then use the following prompt:
Use the `capacitor-plugins` skill from `cap-go/capacitor-skills` to install the `@capgo/capacitor-brightness` plugin in my project.
If you prefer Manual Setup, install the plugin by running the following commands and follow the platform-specific instructions below:
npm install @capgo/capacitor-brightness
npx cap sync
For Android, if you want to modify the system brightness (not just the app brightness), you need to add the WRITE_SETTINGS permission to your AndroidManifest.xml:
<uses-permission android:name="android.permission.WRITE_SETTINGS" />
Note: This permission requires user confirmation through system settings on Android 6.0+.
getBrightness()setBrightness(...)getSystemBrightness()setSystemBrightness(...)getSystemBrightnessMode()setSystemBrightnessMode(...)isUsingSystemBrightness()restoreSystemBrightness()isAvailable()checkPermissions()requestPermissions()getPluginVersion()getBrightness() => Promise<GetBrightnessResult>
Get the current brightness level of the device's main screen.
Returns: Promise<GetBrightnessResult>
Since: 8.0.0
setBrightness(options: SetBrightnessOptions) => Promise<void>
Set the brightness level of the device's main screen.
On iOS, the brightness will persist until the device is locked. On Android, the brightness only applies to the current activity.
| Param | Type | Description |
|---|---|---|
options | SetBrightnessOptions | - The brightness options. |
Since: 8.0.0
getSystemBrightness() => Promise<GetBrightnessResult>
Get the system-wide screen brightness.
Returns: Promise<GetBrightnessResult>
Since: 8.0.0
setSystemBrightness(options: SetBrightnessOptions) => Promise<void>
Set the system-wide screen brightness. Requires WRITE_SETTINGS permission on Android. This also changes the brightness mode to MANUAL.
| Param | Type | Description |
|---|---|---|
options | SetBrightnessOptions | - The brightness options. |
Since: 8.0.0
getSystemBrightnessMode() => Promise<GetBrightnessModeResult>
Get the current system brightness mode (automatic or manual). Requires WRITE_SETTINGS permission on Android.
Returns: Promise<GetBrightnessModeResult>
Since: 8.0.0
setSystemBrightnessMode(options: SetBrightnessModeOptions) => Promise<void>
Set the system brightness mode (automatic or manual). Requires WRITE_SETTINGS permission on Android.
| Param | Type | Description |
|---|---|---|
options | SetBrightnessModeOptions | - The brightness mode options. |
Since: 8.0.0
isUsingSystemBrightness() => Promise<IsUsingSystemBrightnessResult>
Check if the current activity is using the system-wide brightness value.
Returns: Promise<IsUsingSystemBrightnessResult>
Since: 8.0.0
restoreSystemBrightness() => Promise<void>
Reset the brightness setting of the current activity to use the system-wide value.
Since: 8.0.0
isAvailable() => Promise<IsAvailableResult>
Check if the Brightness API is available on the current device.
Returns: Promise<IsAvailableResult>
Since: 8.0.0
checkPermissions() => Promise<PermissionStatus>
Check user's permissions for accessing system brightness.
Returns: Promise<PermissionStatus>
Since: 8.0.0
requestPermissions() => Promise<PermissionStatus>
Request permissions for accessing system brightness. On Android, this opens the system settings to grant WRITE_SETTINGS permission.
Returns: Promise<PermissionStatus>
Since: 8.0.0
getPluginVersion() => Promise<GetPluginVersionResult>
Get the native plugin version.
Returns: Promise<GetPluginVersionResult>
Since: 8.0.0
Result of getBrightness or getSystemBrightness.
| Prop | Type | Description | Since |
|---|---|---|---|
brightness | number | The brightness value from 0 to 1. 0 is the minimum brightness, 1 is the maximum brightness. | 8.0.0 |
Options for setBrightness or setSystemBrightness.
| Prop | Type | Description | Since |
|---|---|---|---|
brightness | number | The brightness value from 0 to 1. 0 is the minimum brightness, 1 is the maximum brightness. | 8.0.0 |
Result of getSystemBrightnessMode.
| Prop | Type | Description | Since |
|---|---|---|---|
mode | BrightnessMode | The current brightness mode. | 8.0.0 |
Options for setSystemBrightnessMode.
| Prop | Type | Description | Since |
|---|---|---|---|
mode | BrightnessMode | The brightness mode to set. Cannot be set to UNKNOWN. | 8.0.0 |
Result of isUsingSystemBrightness.
| Prop | Type | Description | Since |
|---|---|---|---|
isUsing | boolean | Whether the current activity is using the system-wide brightness value. | 8.0.0 |
Result of isAvailable.
| Prop | Type | Description | Since |
|---|---|---|---|
available | boolean | Whether the Brightness API is available on the current device. | 8.0.0 |
Permission status result.
| Prop | Type | Description | Since |
|---|---|---|---|
brightness | PermissionState | Whether the permission to modify system brightness is granted. | 8.0.0 |
Result of getPluginVersion.
| Prop | Type | Description | Since |
|---|---|---|---|
version | string | The native plugin version. | 8.0.0 |
'prompt' | 'prompt-with-rationale' | 'granted' | 'denied'
| Members | Value | Description | Since |
|---|---|---|---|
UNKNOWN | 0 | The brightness mode is unknown. | 8.0.0 |
AUTOMATIC | 1 | The brightness is automatically adjusted by the system. | 8.0.0 |
MANUAL | 2 | The brightness is manually set by the user. | 8.0.0 |
FAQs
Control screen brightness on iOS and Android
We found that @capgo/capacitor-brightness demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Research
/Security News
A new npm package tests AI malware scanners with prompt injection, safety-triggering comments, context flooding, and obfuscated JavaScript.

Product
Socket now detects supply chain risks in project manifests, starting with missing lockfiles that can make dependency installs non-reproducible.

Research
/Security News
The trojanized extensions use TinyGo-compiled WebAssembly and Solana transaction memos to resolve command-and-control infrastructure.