Skip to content

Commit 883325d

Browse files
committed
Added new GitHub proxy url
1 parent 6fe1f05 commit 883325d

4 files changed

Lines changed: 29 additions & 9 deletions

File tree

app/src/main/java/com/fankes/miui/notify/const/ConstFactory.kt

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,11 @@ object PackageName {
3636
*/
3737
object IconRuleSourceSyncType {
3838

39-
/** GitHub Raw (代理) */
40-
const val GITHUB_RAW_PROXY = 1000
39+
/** GitHub Raw (代理 - GitHub Proxy) */
40+
const val GITHUB_RAW_PROXY_1 = 500
41+
42+
/** GitHub Raw (代理 - 7ED Services) */
43+
const val GITHUB_RAW_PROXY_2 = 1000
4144

4245
/** GitHub Raw (直连) */
4346
const val GITHUB_RAW_DIRECT = 2000

app/src/main/java/com/fankes/miui/notify/data/ConfigData.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ object ConfigData {
8585
val NOTIFY_ICONS_DATA = PrefsData("_notify_icon_datas", "")
8686

8787
/** 通知图标优化名单同步方式 */
88-
val ICON_RULE_SOURCE_SYNC_TYPE = PrefsData("_rule_source_sync_way", IconRuleSourceSyncType.GITHUB_RAW_PROXY)
88+
val ICON_RULE_SOURCE_SYNC_TYPE = PrefsData("_rule_source_sync_way", IconRuleSourceSyncType.GITHUB_RAW_PROXY_1)
8989

9090
/** 通知图标优化名单同步地址 */
9191
val ICON_RULE_SOURCE_SYNC_CUSTOM_URL = PrefsData("_rule_source_sync_way_custom_url", "")

app/src/main/java/com/fankes/miui/notify/utils/tool/IconRuleManagerTool.kt

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -67,12 +67,15 @@ object IconRuleManagerTool {
6767
/** 当前规则的通知图标颜色 */
6868
private const val OS_COLOR = 0xFFE06818.toInt()
6969

70-
/** 同步地址 - GitHub Raw (代理) */
71-
private const val SYNC_PROXY_URL = "https://raw.githubusercontentS.com/fankes/AndroidNotifyIconAdapt/main"
72-
7370
/** 同步地址 - GitHub Raw (直连) */
7471
private const val SYNC_DIRECT_URL = "https://raw.githubusercontent.com/fankes/AndroidNotifyIconAdapt/main"
7572

73+
/** 同步地址 - GitHub Raw (代理 - GitHub Proxy) */
74+
private const val SYNC_PROXY_1_URL = "https://ghproxy.com/$SYNC_DIRECT_URL"
75+
76+
/** 同步地址 - GitHub Raw (代理 - 7ED Services) */
77+
private const val SYNC_PROXY_2_URL = "https://raw.githubusercontentS.com/fankes/AndroidNotifyIconAdapt/main"
78+
7679
/** 云端规则展示地址 (OS) */
7780
private const val RULES_TRAVELER_OS_URL = "https://fankes.github.io/AndroidNotifyIconAdapt/?notify-rules-miui"
7881

@@ -104,13 +107,19 @@ object IconRuleManagerTool {
104107
}
105108
binding.sourceFromTextLin.isVisible = sourceType == IconRuleSourceSyncType.CUSTOM_URL
106109
binding.sourceTravelerLin.isVisible = sourceType != IconRuleSourceSyncType.CUSTOM_URL
107-
binding.sourceRadio1.isChecked = sourceType == IconRuleSourceSyncType.GITHUB_RAW_PROXY
110+
binding.sourceRadio0.isChecked = sourceType == IconRuleSourceSyncType.GITHUB_RAW_PROXY_1
111+
binding.sourceRadio1.isChecked = sourceType == IconRuleSourceSyncType.GITHUB_RAW_PROXY_2
108112
binding.sourceRadio2.isChecked = sourceType == IconRuleSourceSyncType.GITHUB_RAW_DIRECT
109113
binding.sourceRadio3.isChecked = sourceType == IconRuleSourceSyncType.CUSTOM_URL
114+
binding.sourceRadio0.setOnClickListener {
115+
binding.sourceFromTextLin.isVisible = false
116+
binding.sourceTravelerLin.isVisible = true
117+
sourceType = IconRuleSourceSyncType.GITHUB_RAW_PROXY_1
118+
}
110119
binding.sourceRadio1.setOnClickListener {
111120
binding.sourceFromTextLin.isVisible = false
112121
binding.sourceTravelerLin.isVisible = true
113-
sourceType = IconRuleSourceSyncType.GITHUB_RAW_PROXY
122+
sourceType = IconRuleSourceSyncType.GITHUB_RAW_PROXY_2
114123
}
115124
binding.sourceRadio2.setOnClickListener {
116125
binding.sourceFromTextLin.isVisible = false
@@ -189,7 +198,8 @@ object IconRuleManagerTool {
189198
callback: () -> Unit
190199
) {
191200
when (sourceType) {
192-
IconRuleSourceSyncType.GITHUB_RAW_PROXY -> onRefreshing(context, SYNC_PROXY_URL, callback)
201+
IconRuleSourceSyncType.GITHUB_RAW_PROXY_1 -> onRefreshing(context, SYNC_PROXY_1_URL, callback)
202+
IconRuleSourceSyncType.GITHUB_RAW_PROXY_2 -> onRefreshing(context, SYNC_PROXY_2_URL, callback)
193203
IconRuleSourceSyncType.GITHUB_RAW_DIRECT -> onRefreshing(context, SYNC_DIRECT_URL, callback)
194204
IconRuleSourceSyncType.CUSTOM_URL ->
195205
if (customUrl.isNotBlank())

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,13 @@
2424
android:layout_width="match_parent"
2525
android:layout_height="wrap_content">
2626

27+
<com.google.android.material.radiobutton.MaterialRadioButton
28+
android:id="@+id/source_radio_0"
29+
android:layout_width="wrap_content"
30+
android:layout_height="wrap_content"
31+
android:text="GitHub Raw (GitHub Proxy)"
32+
app:buttonTint="@color/colorPrimaryAccent" />
33+
2734
<com.google.android.material.radiobutton.MaterialRadioButton
2835
android:id="@+id/source_radio_1"
2936
android:layout_width="wrap_content"

0 commit comments

Comments
 (0)