mirror of
https://github.com/MatsuriDayo/NekoBoxForAndroid.git
synced 2025-12-19 06:30:05 +08:00
update
This commit is contained in:
parent
2f8e37e93b
commit
abcf912a53
@ -17,6 +17,7 @@
|
|||||||
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
|
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
|
||||||
<uses-permission android:name="android.permission.WAKE_LOCK" />
|
<uses-permission android:name="android.permission.WAKE_LOCK" />
|
||||||
<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
|
<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
|
||||||
|
<uses-permission android:name="android.permission.EXPAND_STATUS_BAR" />
|
||||||
|
|
||||||
<uses-permission
|
<uses-permission
|
||||||
android:name="android.permission.QUERY_ALL_PACKAGES"
|
android:name="android.permission.QUERY_ALL_PACKAGES"
|
||||||
|
|||||||
@ -22,6 +22,7 @@ import kotlinx.coroutines.sync.Mutex
|
|||||||
import kotlinx.coroutines.sync.withLock
|
import kotlinx.coroutines.sync.withLock
|
||||||
import libcore.Libcore
|
import libcore.Libcore
|
||||||
import moe.matsuri.nb4a.Protocols
|
import moe.matsuri.nb4a.Protocols
|
||||||
|
import moe.matsuri.nb4a.utils.Util
|
||||||
import java.net.UnknownHostException
|
import java.net.UnknownHostException
|
||||||
|
|
||||||
class BaseService {
|
class BaseService {
|
||||||
@ -52,6 +53,7 @@ class BaseService {
|
|||||||
Action.RESET_UPSTREAM_CONNECTIONS -> runOnDefaultDispatcher {
|
Action.RESET_UPSTREAM_CONNECTIONS -> runOnDefaultDispatcher {
|
||||||
Libcore.resetAllConnections(true)
|
Libcore.resetAllConnections(true)
|
||||||
runOnMainDispatcher {
|
runOnMainDispatcher {
|
||||||
|
Util.collapseStatusBar(ctx)
|
||||||
Toast.makeText(ctx, "Reset upstream connections done", Toast.LENGTH_SHORT)
|
Toast.makeText(ctx, "Reset upstream connections done", Toast.LENGTH_SHORT)
|
||||||
.show()
|
.show()
|
||||||
}
|
}
|
||||||
|
|||||||
@ -22,15 +22,16 @@ fun SingBoxOptions.DNSRule_DefaultOptions.makeSingBoxRule(list: List<String>) {
|
|||||||
if (it.startsWith("geosite:")) {
|
if (it.startsWith("geosite:")) {
|
||||||
geosite.plusAssign(it.removePrefix("geosite:"))
|
geosite.plusAssign(it.removePrefix("geosite:"))
|
||||||
} else if (it.startsWith("full:")) {
|
} else if (it.startsWith("full:")) {
|
||||||
domain.plusAssign(it.removePrefix("full:"))
|
domain.plusAssign(it.removePrefix("full:").lowercase())
|
||||||
} else if (it.startsWith("domain:")) {
|
} else if (it.startsWith("domain:")) {
|
||||||
domain_suffix.plusAssign(it.removePrefix("domain:"))
|
domain_suffix.plusAssign(it.removePrefix("domain:").lowercase())
|
||||||
} else if (it.startsWith("regexp:")) {
|
} else if (it.startsWith("regexp:")) {
|
||||||
domain_regex.plusAssign(it.removePrefix("regexp:"))
|
domain_regex.plusAssign(it.removePrefix("regexp:").lowercase())
|
||||||
} else if (it.startsWith("keyword:")) {
|
} else if (it.startsWith("keyword:")) {
|
||||||
domain_keyword.plusAssign(it.removePrefix("keyword:"))
|
domain_keyword.plusAssign(it.removePrefix("keyword:").lowercase())
|
||||||
} else {
|
} else {
|
||||||
domain.plusAssign(it)
|
// https://github.com/SagerNet/sing-box/commit/5d41e328d4a9f7549dd27f11b4ccc43710a73664
|
||||||
|
domain.plusAssign(it.lowercase())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (geosite?.isEmpty() == true) geosite = null
|
if (geosite?.isEmpty() == true) geosite = null
|
||||||
@ -73,15 +74,16 @@ fun SingBoxOptions.Rule_DefaultOptions.makeSingBoxRule(list: List<String>, isIP:
|
|||||||
if (it.startsWith("geosite:")) {
|
if (it.startsWith("geosite:")) {
|
||||||
geosite.plusAssign(it.removePrefix("geosite:"))
|
geosite.plusAssign(it.removePrefix("geosite:"))
|
||||||
} else if (it.startsWith("full:")) {
|
} else if (it.startsWith("full:")) {
|
||||||
domain.plusAssign(it.removePrefix("full:"))
|
domain.plusAssign(it.removePrefix("full:").lowercase())
|
||||||
} else if (it.startsWith("domain:")) {
|
} else if (it.startsWith("domain:")) {
|
||||||
domain_suffix.plusAssign(it.removePrefix("domain:"))
|
domain_suffix.plusAssign(it.removePrefix("domain:").lowercase())
|
||||||
} else if (it.startsWith("regexp:")) {
|
} else if (it.startsWith("regexp:")) {
|
||||||
domain_regex.plusAssign(it.removePrefix("regexp:"))
|
domain_regex.plusAssign(it.removePrefix("regexp:").lowercase())
|
||||||
} else if (it.startsWith("keyword:")) {
|
} else if (it.startsWith("keyword:")) {
|
||||||
domain_keyword.plusAssign(it.removePrefix("keyword:"))
|
domain_keyword.plusAssign(it.removePrefix("keyword:").lowercase())
|
||||||
} else {
|
} else {
|
||||||
domain.plusAssign(it)
|
// https://github.com/SagerNet/sing-box/commit/5d41e328d4a9f7549dd27f11b4ccc43710a73664
|
||||||
|
domain.plusAssign(it.lowercase())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (ip_cidr?.isEmpty() == true) ip_cidr = null
|
if (ip_cidr?.isEmpty() == true) ip_cidr = null
|
||||||
|
|||||||
@ -1,6 +1,7 @@
|
|||||||
package moe.matsuri.nb4a.utils
|
package moe.matsuri.nb4a.utils
|
||||||
|
|
||||||
import android.annotation.SuppressLint
|
import android.annotation.SuppressLint
|
||||||
|
import android.content.Context
|
||||||
import android.util.Base64
|
import android.util.Base64
|
||||||
import java.io.ByteArrayOutputStream
|
import java.io.ByteArrayOutputStream
|
||||||
import java.text.SimpleDateFormat
|
import java.text.SimpleDateFormat
|
||||||
@ -128,4 +129,14 @@ object Util {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@SuppressLint("WrongConstant")
|
||||||
|
fun collapseStatusBar(context: Context) {
|
||||||
|
try {
|
||||||
|
val statusBarManager = context.getSystemService("statusbar")
|
||||||
|
val collapse = statusBarManager.javaClass.getMethod("collapsePanels")
|
||||||
|
collapse.invoke(statusBarManager)
|
||||||
|
} catch (_: Exception) {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -490,7 +490,6 @@
|
|||||||
<string-array name="xtls_flow_value" translatable="false">
|
<string-array name="xtls_flow_value" translatable="false">
|
||||||
<item></item>
|
<item></item>
|
||||||
<item>xtls-rprx-vision</item>
|
<item>xtls-rprx-vision</item>
|
||||||
<item>xtls-rprx-vision-udp443</item>
|
|
||||||
</string-array>
|
</string-array>
|
||||||
|
|
||||||
<string-array name="box_shadowsocks_plugins" translatable="false">
|
<string-array name="box_shadowsocks_plugins" translatable="false">
|
||||||
|
|||||||
@ -8,9 +8,9 @@ require (
|
|||||||
github.com/matsuridayo/libneko v0.0.0-20230315005352-9d7e3f3a79d1
|
github.com/matsuridayo/libneko v0.0.0-20230315005352-9d7e3f3a79d1
|
||||||
github.com/matsuridayo/sing-box-extra v0.0.0-20230331092806-0c9ba905d3d7
|
github.com/matsuridayo/sing-box-extra v0.0.0-20230331092806-0c9ba905d3d7
|
||||||
github.com/miekg/dns v1.1.53
|
github.com/miekg/dns v1.1.53
|
||||||
github.com/sagernet/sing v0.2.1
|
github.com/sagernet/sing v0.2.2-0.20230402035613-6d63c1a7dca5
|
||||||
github.com/sagernet/sing-box v1.2.2-0.20230331082908-4db7eb9d9e78
|
github.com/sagernet/sing-box v1.2.3-0.20230402040603-f8be48401998
|
||||||
github.com/sagernet/sing-dns v0.1.5-0.20230331013337-06044a57b1da
|
github.com/sagernet/sing-dns v0.1.5-0.20230402033314-a752be02978d
|
||||||
github.com/sagernet/sing-tun v0.1.4-0.20230326080954-8848c0e4cbab
|
github.com/sagernet/sing-tun v0.1.4-0.20230326080954-8848c0e4cbab
|
||||||
github.com/ulikunitz/xz v0.5.10
|
github.com/ulikunitz/xz v0.5.10
|
||||||
golang.org/x/mobile v0.0.0-20220722155234-aaac322e2105
|
golang.org/x/mobile v0.0.0-20220722155234-aaac322e2105
|
||||||
@ -94,4 +94,4 @@ require (
|
|||||||
|
|
||||||
// replace github.com/matsuridayo/sing-box-extra => ../../sing-box-extra
|
// replace github.com/matsuridayo/sing-box-extra => ../../sing-box-extra
|
||||||
|
|
||||||
replace github.com/sagernet/sing-dns => github.com/matsuridayo/sing-dns v0.0.0-20230331094727-dbe6239660c6
|
replace github.com/sagernet/sing-dns => github.com/matsuridayo/sing-dns v0.0.0-20230402050810-781b80b9110f
|
||||||
|
|||||||
@ -92,8 +92,8 @@ github.com/matsuridayo/libneko v0.0.0-20230315005352-9d7e3f3a79d1 h1:+FflyEuq2hn
|
|||||||
github.com/matsuridayo/libneko v0.0.0-20230315005352-9d7e3f3a79d1/go.mod h1:IRO07Queptz/rGFvEW+3Hmwpx7MCup6WiDs4p5jMt4g=
|
github.com/matsuridayo/libneko v0.0.0-20230315005352-9d7e3f3a79d1/go.mod h1:IRO07Queptz/rGFvEW+3Hmwpx7MCup6WiDs4p5jMt4g=
|
||||||
github.com/matsuridayo/sing-box-extra v0.0.0-20230331092806-0c9ba905d3d7 h1:ooWjy/4SzEa0CIGpihuI5AiLDUl5F1/5xK+/wCm3mdg=
|
github.com/matsuridayo/sing-box-extra v0.0.0-20230331092806-0c9ba905d3d7 h1:ooWjy/4SzEa0CIGpihuI5AiLDUl5F1/5xK+/wCm3mdg=
|
||||||
github.com/matsuridayo/sing-box-extra v0.0.0-20230331092806-0c9ba905d3d7/go.mod h1:fC8s/F9U7qveKsU2675YaidrqgpDvLeRsubva5PU68Q=
|
github.com/matsuridayo/sing-box-extra v0.0.0-20230331092806-0c9ba905d3d7/go.mod h1:fC8s/F9U7qveKsU2675YaidrqgpDvLeRsubva5PU68Q=
|
||||||
github.com/matsuridayo/sing-dns v0.0.0-20230331094727-dbe6239660c6 h1:H9/j4VScNW5seGI/URXG/8BkBOp07gYXRLCjPZjIZgA=
|
github.com/matsuridayo/sing-dns v0.0.0-20230402050810-781b80b9110f h1:BqIt3G/NXyTLao96ouiK6XIvzt0U7gAi2u6FeN88b0c=
|
||||||
github.com/matsuridayo/sing-dns v0.0.0-20230331094727-dbe6239660c6/go.mod h1:8x+rlRnPE/5/IagjlAUqR9TceRYRL2WyqmP5QYK3dkI=
|
github.com/matsuridayo/sing-dns v0.0.0-20230402050810-781b80b9110f/go.mod h1:69PNSHyEmXdjf6C+bXBOdr2GQnPeEyWjIzo/MV8gmz8=
|
||||||
github.com/mholt/acmez v1.1.0 h1:IQ9CGHKOHokorxnffsqDvmmE30mDenO1lptYZ1AYkHY=
|
github.com/mholt/acmez v1.1.0 h1:IQ9CGHKOHokorxnffsqDvmmE30mDenO1lptYZ1AYkHY=
|
||||||
github.com/mholt/acmez v1.1.0/go.mod h1:zwo5+fbLLTowAX8o8ETfQzbDtwGEXnPhkmGdKIP+bgs=
|
github.com/mholt/acmez v1.1.0/go.mod h1:zwo5+fbLLTowAX8o8ETfQzbDtwGEXnPhkmGdKIP+bgs=
|
||||||
github.com/miekg/dns v1.1.53 h1:ZBkuHr5dxHtB1caEOlZTLPo7D3L3TWckgUUs/RHfDxw=
|
github.com/miekg/dns v1.1.53 h1:ZBkuHr5dxHtB1caEOlZTLPo7D3L3TWckgUUs/RHfDxw=
|
||||||
@ -132,10 +132,10 @@ github.com/sagernet/reality v0.0.0-20230323230523-5fa25e693e7f h1:plVtFF9NVw5Py4
|
|||||||
github.com/sagernet/reality v0.0.0-20230323230523-5fa25e693e7f/go.mod h1:B8lp4WkQ1PwNnrVMM6KyuFR20pU8jYBD+A4EhJovEXU=
|
github.com/sagernet/reality v0.0.0-20230323230523-5fa25e693e7f/go.mod h1:B8lp4WkQ1PwNnrVMM6KyuFR20pU8jYBD+A4EhJovEXU=
|
||||||
github.com/sagernet/sing v0.0.0-20220817130738-ce854cda8522/go.mod h1:QVsS5L/ZA2Q5UhQwLrn0Trw+msNd/NPGEhBKR/ioWiY=
|
github.com/sagernet/sing v0.0.0-20220817130738-ce854cda8522/go.mod h1:QVsS5L/ZA2Q5UhQwLrn0Trw+msNd/NPGEhBKR/ioWiY=
|
||||||
github.com/sagernet/sing v0.1.8/go.mod h1:jt1w2u7lJQFFSGLiRrRIs5YWmx4kAPfWuOejuDW9qMk=
|
github.com/sagernet/sing v0.1.8/go.mod h1:jt1w2u7lJQFFSGLiRrRIs5YWmx4kAPfWuOejuDW9qMk=
|
||||||
github.com/sagernet/sing v0.2.1 h1:r0STYeyfKBBtoAHsBtW1dQonxG+3Qidde7/1VAMhdn8=
|
github.com/sagernet/sing v0.2.2-0.20230402035613-6d63c1a7dca5 h1:UB1vAmu7/4ya2FzX2lwIAs0bRPcWQPY5kSCBK4RLi2g=
|
||||||
github.com/sagernet/sing v0.2.1/go.mod h1:9uHswk2hITw8leDbiLS/xn0t9nzBcbePxzm9PJhwdlw=
|
github.com/sagernet/sing v0.2.2-0.20230402035613-6d63c1a7dca5/go.mod h1:9uHswk2hITw8leDbiLS/xn0t9nzBcbePxzm9PJhwdlw=
|
||||||
github.com/sagernet/sing-box v1.2.2-0.20230331082908-4db7eb9d9e78 h1:cD7wdW7Ikoq3cxZXx4mlg7hF2o1/4ACTPdYx/bdUt7A=
|
github.com/sagernet/sing-box v1.2.3-0.20230402040603-f8be48401998 h1:WMHMHVEkzjUvnGDJcn27cV9Zvj/r02J5O5bd5nXLqos=
|
||||||
github.com/sagernet/sing-box v1.2.2-0.20230331082908-4db7eb9d9e78/go.mod h1:zN6q9zAw2CNAzSm7aw2Skc0s2Lv/Z8XB2IjtsyA54+Y=
|
github.com/sagernet/sing-box v1.2.3-0.20230402040603-f8be48401998/go.mod h1:6MoNX9YTqbC8UzEOSQcEA5vPe35JjtKisUg7838LJYo=
|
||||||
github.com/sagernet/sing-shadowsocks v0.2.0 h1:ILDWL7pwWfkPLEbviE/MyCgfjaBmJY/JVVY+5jhSb58=
|
github.com/sagernet/sing-shadowsocks v0.2.0 h1:ILDWL7pwWfkPLEbviE/MyCgfjaBmJY/JVVY+5jhSb58=
|
||||||
github.com/sagernet/sing-shadowsocks v0.2.0/go.mod h1:ysYzszRLpNzJSorvlWRMuzU6Vchsp7sd52q+JNY4axw=
|
github.com/sagernet/sing-shadowsocks v0.2.0/go.mod h1:ysYzszRLpNzJSorvlWRMuzU6Vchsp7sd52q+JNY4axw=
|
||||||
github.com/sagernet/sing-shadowtls v0.1.0 h1:05MYce8aR5xfKIn+y7xRFsdKhKt44QZTSEQW+lG5IWQ=
|
github.com/sagernet/sing-shadowtls v0.1.0 h1:05MYce8aR5xfKIn+y7xRFsdKhKt44QZTSEQW+lG5IWQ=
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user