
Research
/Security News
Malicious npm Packages Target WhatsApp Developers with Remote Kill Switch
Two npm packages masquerading as WhatsApp developer libraries include a kill switch that deletes all files if the phone number isn’t whitelisted.
kiosk-react-native
Advanced tools
A Library for setting up kiosk mode on Android with react native
npm install kiosk-react-native
import { enableKioskMode, disableKioskMode } from 'kiosk-react-native';
// Enable Kiosk Mode
enableKioskMode();
// Disable Kiosk Mode
disableKioskMode();
We need device owner permission for the app for higher order access like disable volume buttons,prevent uninstallation etc.
Add below configuration to AndroidManifest.xml(android/app/src/main/AndroidManifest.xml)
Add android:testOnly . This will allow to developers to uninstall and remove admin for the app.
<application
android:name=".MainApplication"
android:label="@string/app_name"
android:supportsRtl="true"
android:testOnly="true"
...Rest of the App
Now create a new "device_owner.xml" file (android/app/src/main/xml/device_owner.xml) and add the following code.
<?xml version="1.0" encoding="utf-8"?>
<device-admin>
<uses-policies>
<limit-password/>
<watch-login/>
<reset-password/>
<force-lock/>
<wipe-data/>
<expire-password/>
<encrypted-storage/>
<disable-camera/>
</uses-policies>
</device-admin>
Add a new reciever to your AndroidManifest.xml(android/app/src/main/AndroidManifest.xml).
<receiver
android:name="com.kiosk.RNKioskDevice"
android:label="@string/app_name"
android:exported="true"
android:permission="android.permission.BIND_DEVICE_ADMIN">
<meta-data
android:name="android.app.device_admin"
android:resource="@xml/device_owner" />
<intent-filter>
<action android:name="android.app.action.DEVICE_ADMIN_ENABLED"/>
</intent-filter>
</receiver>
Finally run the following script using adb
adb shell dpm set-device-owner <YourPackageName>/com.kiosk.RNKioskDevice
Rebuild the app. The app should run in admin mode now.
To Remove the device from owner
adb shell dpm remove-active-admin <YourPackageName>/com.kiosk.RNKioskDevice
MIT
Made with create-react-native-library
FAQs
A Library for setting up kiosk mode with react native
The npm package kiosk-react-native receives a total of 469 weekly downloads. As such, kiosk-react-native popularity was classified as not popular.
We found that kiosk-react-native demonstrated a not healthy version release cadence and project activity because the last version was released 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
Two npm packages masquerading as WhatsApp developer libraries include a kill switch that deletes all files if the phone number isn’t whitelisted.
Research
/Security News
Socket uncovered 11 malicious Go packages using obfuscated loaders to fetch and execute second-stage payloads via C2 domains.
Security News
TC39 advances 11 JavaScript proposals, with two moving to Stage 4, bringing better math, binary APIs, and more features one step closer to the ECMAScript spec.