add request ua & add tile long press action
This commit is contained in:
4 files changed
+18
-1
No files matched your search
@@ -26,6 +26,9 @@
|
||||
<category android:name="android.intent.category.LAUNCHER" />
|
||||
<category android:name="android.intent.category.DEFAULT" />
|
||||
</intent-filter>
|
||||
<intent-filter>
|
||||
<action android:name="android.service.quicksettings.action.QS_TILE_PREFERENCES" />
|
||||
</intent-filter>
|
||||
</activity>
|
||||
<activity
|
||||
android:name=".ApkBrokenActivity"
|
||||
|
||||
@@ -22,3 +22,7 @@ func Reset() {
|
||||
profile.LoadDefault()
|
||||
tunnel.DefaultManager.ResetStatistic()
|
||||
}
|
||||
|
||||
func SetApplicationVersion(version string) {
|
||||
profile.ApplicationVersion = version
|
||||
}
|
||||
@@ -15,6 +15,8 @@ import (
|
||||
"github.com/Dreamacro/clash/tunnel"
|
||||
)
|
||||
|
||||
var ApplicationVersion = "Unknown"
|
||||
|
||||
const defaultFileMode = 0600
|
||||
|
||||
var client = &http.Client{
|
||||
@@ -45,7 +47,14 @@ var client = &http.Client{
|
||||
}
|
||||
|
||||
func DownloadAndCheck(url, output, baseDir string) error {
|
||||
response, err := client.Get(url)
|
||||
request, err := http.NewRequest("GET", url, nil)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
request.Header.Set("User-Agent", "ClashForAndroid/"+ApplicationVersion)
|
||||
|
||||
response, err := client.Do(request)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
@@ -31,6 +31,7 @@ object Clash {
|
||||
|
||||
Bridge.loadMMDB(bytes)
|
||||
Bridge.setHome(context.cacheDir.absolutePath)
|
||||
Bridge.setApplicationVersion(BuildConfig.VERSION_NAME)
|
||||
Bridge.reset()
|
||||
|
||||
Log.d("MMDB loaded ${bytes.size}")
|
||||
|
||||
Reference in new issue
Block a user