From 9ab3143bf0ff8e789e73911b674f213f5be24cc8 Mon Sep 17 00:00:00 2001 From: topjohnwu Date: Mon, 4 Feb 2019 03:13:01 -0500 Subject: [PATCH] Force preference screen to use our preference stored in DE --- .../com/topjohnwu/magisk/components/BaseActivity.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/app/src/full/java/com/topjohnwu/magisk/components/BaseActivity.java b/app/src/full/java/com/topjohnwu/magisk/components/BaseActivity.java index 5fb822807..9512ef543 100644 --- a/app/src/full/java/com/topjohnwu/magisk/components/BaseActivity.java +++ b/app/src/full/java/com/topjohnwu/magisk/components/BaseActivity.java @@ -3,8 +3,10 @@ package com.topjohnwu.magisk.components; import android.Manifest; import android.content.Context; import android.content.Intent; +import android.content.SharedPreferences; import android.content.pm.PackageManager; import android.os.Bundle; +import android.text.TextUtils; import android.view.WindowManager; import android.widget.Toast; @@ -145,4 +147,11 @@ public abstract class BaseActivity extends AppCompatActivity implements Topic.Au public interface ActivityResultListener { void onActivityResult(int requestCode, int resultCode, Intent data); } + + @Override + public SharedPreferences getSharedPreferences(String name, int mode) { + if (TextUtils.equals(name, getPackageName() + "_preferences")) + return app.prefs; + return super.getSharedPreferences(name, mode); + } }