Skip to content
This repository was archived by the owner on Apr 14, 2022. It is now read-only.
/ fileprefs Public archive

A file based SharedPreferences library for android.

License

Notifications You must be signed in to change notification settings

chengxuncc/fileprefs

Repository files navigation

FileSharedPreferences


A file based SharedPreferences library for android, which working great on Android SDK>=24 (Android 7.0 Nougat).

Usage

Add JitPack repository to project build file:

allprojects {
    repositories {
        ...
        maven { url 'https://jitpack.io' }
    }
}

Add the dependency:

dependencies {
    implementation 'com.github.chengxuncc:fileprefs:1.0'
}

Set app sharedPreferences file to be world readable:

SharedPreferences sharedpreferences = getSharedPreferences(YourPreferencesFileName, MODE_PRIVATE);
// you should use makeWorldReadable every time after using commit() or apply(), however apply() will delay, it may be better to use commit()
FileSharedPreferences.makeWorldReadable(YourPackageName,YourPreferencesFileName);

Using FileSharedPreferences at other apps or your xposed module hook method:

FileSharedPreferences sharedPreferences = new FileSharedPreferences(YourPackageName, YourPreferencesFileName);
// if you want to reload
sharedPreferences.reload();

Credit

XSharedPreferences

About

A file based SharedPreferences library for android.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages