From 1cca6b939ca4b61afa1fdb57382c4ac1e5c86f8b Mon Sep 17 00:00:00 2001
From: Nullptr <52071314+Dr-TSNG@users.noreply.github.com>
Date: Fri, 18 Mar 2022 19:44:52 +0800
Subject: [PATCH] About
---
.../main/java/icu/nullptr/twifucker/hook/activity/Main.kt | 2 +-
.../main/java/icu/nullptr/twifucker/ui/SettingsDialog.kt | 6 ++++++
app/src/main/res/values/strings.xml | 2 ++
app/src/main/res/xml/settings_dialog.xml | 4 ++++
4 files changed, 13 insertions(+), 1 deletion(-)
diff --git a/app/src/main/java/icu/nullptr/twifucker/hook/activity/Main.kt b/app/src/main/java/icu/nullptr/twifucker/hook/activity/Main.kt
index 5eb419a..1d8181a 100644
--- a/app/src/main/java/icu/nullptr/twifucker/hook/activity/Main.kt
+++ b/app/src/main/java/icu/nullptr/twifucker/hook/activity/Main.kt
@@ -13,7 +13,7 @@ fun mainActivityHook() {
name == "onResume"
}.hookAfter { param ->
Log.d("MainActivity onResume")
- if (modulePrefs.getBoolean("first_run", true)) {
+ if (BuildConfig.DEBUG || modulePrefs.getBoolean("first_run", true)) {
SettingsDialog(param.thisObject as Activity)
modulePrefs.edit().putBoolean("first_run", false).apply()
}
diff --git a/app/src/main/java/icu/nullptr/twifucker/ui/SettingsDialog.kt b/app/src/main/java/icu/nullptr/twifucker/ui/SettingsDialog.kt
index a5dbcb2..3ee476e 100644
--- a/app/src/main/java/icu/nullptr/twifucker/ui/SettingsDialog.kt
+++ b/app/src/main/java/icu/nullptr/twifucker/ui/SettingsDialog.kt
@@ -5,7 +5,9 @@ package icu.nullptr.twifucker.ui
import android.app.Activity
import android.app.AlertDialog
import android.content.Context
+import android.content.Intent
import android.content.SharedPreferences
+import android.net.Uri
import android.os.Bundle
import android.preference.Preference
import android.preference.PreferenceFragment
@@ -28,6 +30,10 @@ class SettingsDialog(context: Context) : AlertDialog.Builder(context) {
preferenceManager.sharedPreferencesName = PREFS_NAME
addPreferencesFromResource(R.xml.settings_dialog)
prefs = preferenceManager.sharedPreferences
+ findPreference("about").setOnPreferenceClickListener {
+ activity.startActivity(Intent(Intent.ACTION_VIEW, Uri.parse("https://github.com/Dr-TSNG/TwiFucker")))
+ true
+ }
}
override fun onPreferenceChange(p0: Preference?, p1: Any?): Boolean {
diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml
index dec53df..b7379d9 100644
--- a/app/src/main/res/values/strings.xml
+++ b/app/src/main/res/values/strings.xml
@@ -8,6 +8,7 @@
Main
Extra
+ TwiFucker by Nullptr
Show Toast on Start
Disable Promoted Content
Disable Promoted User
@@ -16,6 +17,7 @@
Disable Who to Follow
Disable Topics to Follow
+ Visit the GitHub page for more support
You can find this page through settings/additional/version
home/profile/search timeline
home/profile/search timeline
diff --git a/app/src/main/res/xml/settings_dialog.xml b/app/src/main/res/xml/settings_dialog.xml
index 1943da8..822ef9a 100644
--- a/app/src/main/res/xml/settings_dialog.xml
+++ b/app/src/main/res/xml/settings_dialog.xml
@@ -1,6 +1,10 @@
+