0.5.0 • Published 7 months ago
@charlesmuchene/pref-editor v0.5.0
Android-Preference-Editor js library
View and edit on-device preferences: NO ROOT required! 🥳
Both legacy shared preferences and Datastore preferences are supported! 😎
Requirements
Usage
Install the package:
npm i @charlesmuchene/pref-editorSample code to change a user preference:
import {
Preference,
TypeTag,
changePreference,
} from "@charlesmuchene/pref-editor";
const connection = {
deviceId: "emulator-5554",
appId: "com.charlesmuchene.datastore",
filename: "settings.preferences_pb",
};
const pref: Preference = {
key: "isVisited",
value: "false",
tag: TypeTag.BOOLEAN,
};
changePreference(pref, connection);See the Android Preferences Editor MCP server project on more usages.
Known issues
- string-set key-value preference type operations are partially supported
Build
# Clone the repository
git clone https://github.com/charlesmuchene/pref-editor-js.git
cd pref-editor
# Install dependencies and build
npm installContributing
See Contributing.
License
See LICENSE
Contact
For questions or support, reach out via GitHub Issues.