Skip to content

Commit 43aff6f

Browse files
committed
chore(ui): remove dead upstream links; trim About screen
- Drawer: remove the 'Document' item (opened the abandoned matsuridayo.github.io). - About: remove the 'Project' card (upstream GitHub + Telegram), the Donate button, and the bundled GPL license text block. Keep the useful bits (app version, update checks, sing-box version, plugins, battery-optimization). Repoint the version item's\n link to our own releases page. - Missing-plugin dialog: drop the 'Learn more' button (pointed at the abandoned\n matsuridayo plugin docs) and fix a latent bug where Cancel was registered as a second\n setNeutralButton and silently overridden — Cancel is now a proper negative button. The LICENSE file remains in the repo (GPL compliance); only the in-app display is\nremoved. No attribution/disclaimer text added.
1 parent ed61a81 commit 43aff6f

4 files changed

Lines changed: 2 additions & 96 deletions

File tree

app/src/main/java/io/nekohasekai/sagernet/ui/AboutFragment.kt

Lines changed: 1 addition & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import android.os.Build
88
import android.os.Bundle
99
import android.os.PowerManager
1010
import android.provider.Settings
11-
import android.text.util.Linkify
1211
import android.view.View
1312
import android.widget.Toast
1413
import androidx.activity.result.component1
@@ -22,7 +21,6 @@ import com.danielstone.materialaboutlibrary.model.MaterialAboutCard
2221
import com.danielstone.materialaboutlibrary.model.MaterialAboutList
2322
import io.nekohasekai.sagernet.BuildConfig
2423
import io.nekohasekai.sagernet.R
25-
import io.nekohasekai.sagernet.databinding.LayoutAboutBinding
2624
import io.nekohasekai.sagernet.ktx.*
2725
import io.nekohasekai.sagernet.plugin.PluginManager.loadString
2826
import io.nekohasekai.sagernet.utils.PackageCache
@@ -41,22 +39,12 @@ class AboutFragment : ToolbarFragment(R.layout.layout_about) {
4139
override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
4240
super.onViewCreated(view, savedInstanceState)
4341

44-
val binding = LayoutAboutBinding.bind(view)
45-
4642
ViewCompat.setOnApplyWindowInsetsListener(view, ListListener)
4743
toolbar.setTitle(R.string.menu_about)
4844

4945
parentFragmentManager.beginTransaction()
5046
.replace(R.id.about_fragment_holder, AboutContent())
5147
.commitAllowingStateLoss()
52-
53-
runOnDefaultDispatcher {
54-
val license = view.context.assets.open("LICENSE").bufferedReader().readText()
55-
onMainDispatcher {
56-
binding.license.text = license
57-
Linkify.addLinks(binding.license, Linkify.EMAIL_ADDRESSES or Linkify.WEB_URLS)
58-
}
59-
}
6048
}
6149

6250
class AboutContent : MaterialAboutFragment() {
@@ -83,7 +71,7 @@ class AboutFragment : ToolbarFragment(R.layout.layout_about) {
8371
.subText(SagerNet.appVersionNameForDisplay)
8472
.setOnClickAction {
8573
requireContext().launchCustomTab(
86-
"https://github.com/MatsuriDayo/NekoBoxForAndroid/releases"
74+
"https://github.com/hawkff/NekoBoxForAndroid/releases"
8775
)
8876
}
8977
.build())
@@ -108,17 +96,6 @@ class AboutFragment : ToolbarFragment(R.layout.layout_about) {
10896
.subText(Libcore.versionBox())
10997
.setOnClickAction { }
11098
.build())
111-
.addItem(
112-
MaterialAboutActionItem.Builder()
113-
.icon(R.drawable.ic_baseline_card_giftcard_24)
114-
.text(R.string.donate)
115-
.subText(R.string.donate_info)
116-
.setOnClickAction {
117-
requireContext().launchCustomTab(
118-
"https://matsuridayo.github.io/index_docs/#donate"
119-
)
120-
}
121-
.build())
12299
.apply {
123100
PackageCache.awaitLoadSync()
124101
for ((_, pkg) in PackageCache.installedPluginPackages) {
@@ -173,32 +150,6 @@ class AboutFragment : ToolbarFragment(R.layout.layout_about) {
173150
}
174151
}
175152
.build())
176-
.addCard(
177-
MaterialAboutCard.Builder()
178-
.outline(true)
179-
.title(R.string.project)
180-
.addItem(
181-
MaterialAboutActionItem.Builder()
182-
.icon(R.drawable.ic_baseline_sanitizer_24)
183-
.text(R.string.github)
184-
.setOnClickAction {
185-
requireContext().launchCustomTab(
186-
"https://github.com/MatsuriDayo/NekoBoxForAndroid"
187-
188-
)
189-
}
190-
.build())
191-
.addItem(
192-
MaterialAboutActionItem.Builder()
193-
.icon(R.drawable.ic_qu_shadowsocks_foreground)
194-
.text(R.string.telegram)
195-
.setOnClickAction {
196-
requireContext().launchCustomTab(
197-
"https://t.me/MatsuriDayo"
198-
)
199-
}
200-
.build())
201-
.build())
202153
.build()
203154

204155
}

app/src/main/java/io/nekohasekai/sagernet/ui/MainActivity.kt

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -294,10 +294,7 @@ class MainActivity : ThemedActivity(),
294294
.setPositiveButton(R.string.action_download) { _, _ ->
295295
showDownloadDialog(pluginEntity)
296296
}
297-
.setNeutralButton(android.R.string.cancel, null)
298-
.setNeutralButton(R.string.action_learn_more) { _, _ ->
299-
launchCustomTab("https://matsuridayo.github.io/nb4a-plugin/")
300-
}
297+
.setNegativeButton(android.R.string.cancel, null)
301298
.show()
302299
}
303300

@@ -366,11 +363,6 @@ class MainActivity : ThemedActivity(),
366363
R.id.nav_traffic -> displayFragment(WebviewFragment())
367364
R.id.nav_tools -> displayFragment(ToolsFragment())
368365
R.id.nav_logcat -> displayFragment(LogcatFragment())
369-
R.id.nav_faq -> {
370-
launchCustomTab("https://matsuridayo.github.io/")
371-
return false
372-
}
373-
374366
R.id.nav_about -> displayFragment(AboutFragment())
375367

376368
else -> return false

app/src/main/res/layout/layout_about.xml

Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -58,39 +58,6 @@
5858
android:layout_width="match_parent"
5959
android:layout_height="match_parent" />
6060

61-
<com.google.android.material.card.MaterialCardView
62-
android:layout_width="match_parent"
63-
android:layout_height="wrap_content"
64-
android:layout_marginLeft="8dp"
65-
android:layout_marginRight="8dp"
66-
android:layout_marginBottom="8dp">
67-
68-
<LinearLayout
69-
android:layout_width="match_parent"
70-
android:layout_height="wrap_content"
71-
android:orientation="vertical"
72-
android:padding="16dp">
73-
74-
<TextView
75-
android:layout_width="wrap_content"
76-
android:layout_height="wrap_content"
77-
android:text="@string/license"
78-
android:textAppearance="?attr/textAppearanceSubtitle2" />
79-
80-
<TextView
81-
android:id="@+id/license"
82-
android:layout_width="wrap_content"
83-
android:layout_height="wrap_content"
84-
android:layout_marginTop="16dp"
85-
android:textAppearance="?attr/textAppearanceBody2"
86-
android:textColor="?android:textColorSecondary"
87-
android:textIsSelectable="true"
88-
android:textSize="12sp" />
89-
90-
</LinearLayout>
91-
92-
</com.google.android.material.card.MaterialCardView>
93-
9461
</LinearLayout>
9562

9663
</androidx.core.widget.NestedScrollView>

app/src/main/res/menu/main_drawer_menu.xml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,6 @@
4343
<group
4444
android:id="@+id/about"
4545
android:checkableBehavior="single">
46-
<item
47-
android:id="@+id/nav_faq"
48-
android:icon="@drawable/ic_device_data_usage"
49-
android:title="@string/document" />
5046
<item
5147
android:id="@+id/nav_about"
5248
android:icon="@drawable/ic_baseline_info_24"

0 commit comments

Comments
 (0)