From c3b3af4a02a94e1afcd0504501f9e80cebde6e0e Mon Sep 17 00:00:00 2001 From: ikws4 Date: Wed, 20 May 2020 21:45:09 +0800 Subject: [PATCH] Make inheritable --- .../src/main/java/io/ikws4/kxposedhelper/MethodReplacement.kt | 2 +- .../io/ikws4/kxposedhelper/utilities/KXBroadcastReceiver.kt | 4 +--- .../io/ikws4/kxposedhelper/utilities/KXSharedPreferences.kt | 2 +- .../kxposedhelper/utilities/KXSharedPreferencesProvider.kt | 2 +- 4 files changed, 4 insertions(+), 6 deletions(-) diff --git a/kxposedhelper/src/main/java/io/ikws4/kxposedhelper/MethodReplacement.kt b/kxposedhelper/src/main/java/io/ikws4/kxposedhelper/MethodReplacement.kt index 9077493..a2c6282 100644 --- a/kxposedhelper/src/main/java/io/ikws4/kxposedhelper/MethodReplacement.kt +++ b/kxposedhelper/src/main/java/io/ikws4/kxposedhelper/MethodReplacement.kt @@ -1,7 +1,7 @@ package io.ikws4.kxposedhelper @Suppress("UNCHECKED_CAST") -class MethodReplacement(private val replaceHookedMethod: T.(param: MethodHookParam) -> Any? = {}) : +open class MethodReplacement(private val replaceHookedMethod: T.(param: MethodHookParam) -> Any? = {}) : MethodHook(beforeHookedMethod = { param -> try { val result = replaceHookedMethod.invoke(param.thisObject as T, param) diff --git a/kxposedhelper/src/main/java/io/ikws4/kxposedhelper/utilities/KXBroadcastReceiver.kt b/kxposedhelper/src/main/java/io/ikws4/kxposedhelper/utilities/KXBroadcastReceiver.kt index b84634e..e0d0621 100644 --- a/kxposedhelper/src/main/java/io/ikws4/kxposedhelper/utilities/KXBroadcastReceiver.kt +++ b/kxposedhelper/src/main/java/io/ikws4/kxposedhelper/utilities/KXBroadcastReceiver.kt @@ -5,9 +5,7 @@ import android.content.Context import android.content.Intent import android.content.IntentFilter -abstract class KXBroadcastReceiver : BroadcastReceiver() { - - abstract val intentFilter: IntentFilter +open class KXBroadcastReceiver(private val intentFilter: IntentFilter) : BroadcastReceiver() { private var listener: OnReceiveListener? = null diff --git a/kxposedhelper/src/main/java/io/ikws4/kxposedhelper/utilities/KXSharedPreferences.kt b/kxposedhelper/src/main/java/io/ikws4/kxposedhelper/utilities/KXSharedPreferences.kt index f9f8d55..8c522ed 100644 --- a/kxposedhelper/src/main/java/io/ikws4/kxposedhelper/utilities/KXSharedPreferences.kt +++ b/kxposedhelper/src/main/java/io/ikws4/kxposedhelper/utilities/KXSharedPreferences.kt @@ -4,7 +4,7 @@ import android.content.ContentResolver import android.net.Uri import android.os.Bundle -class KXSharedPreferences( +open class KXSharedPreferences( private val contentResolver: ContentResolver, private val prefName: String ) { private val uri = diff --git a/kxposedhelper/src/main/java/io/ikws4/kxposedhelper/utilities/KXSharedPreferencesProvider.kt b/kxposedhelper/src/main/java/io/ikws4/kxposedhelper/utilities/KXSharedPreferencesProvider.kt index 8d366de..4e4b8ac 100644 --- a/kxposedhelper/src/main/java/io/ikws4/kxposedhelper/utilities/KXSharedPreferencesProvider.kt +++ b/kxposedhelper/src/main/java/io/ikws4/kxposedhelper/utilities/KXSharedPreferencesProvider.kt @@ -8,7 +8,7 @@ import android.database.Cursor import android.net.Uri import android.os.Bundle -class KXSharedPreferencesProvider : ContentProvider() { +open class KXSharedPreferencesProvider : ContentProvider() { private var sharedPreferences: SharedPreferences? = null