Skip to content

Commit

Permalink
update icon
Browse files Browse the repository at this point in the history
  • Loading branch information
arm64v8a committed Mar 20, 2023
1 parent 27f7cdd commit 8efc0e7
Show file tree
Hide file tree
Showing 20 changed files with 5 additions and 71 deletions.
40 changes: 0 additions & 40 deletions app/src/main/java/io/nekohasekai/sagernet/ui/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ import io.nekohasekai.sagernet.group.GroupUpdater
import io.nekohasekai.sagernet.ktx.*
import io.nekohasekai.sagernet.widget.ListHolderListener
import kotlinx.coroutines.launch
import libcore.Libcore
import moe.matsuri.nya.utils.Util
import java.text.SimpleDateFormat
import java.util.*
Expand Down Expand Up @@ -491,43 +490,4 @@ class MainActivity : ThemedActivity(),
supportFragmentManager.findFragmentById(R.id.fragment_holder) as? ToolbarFragment
return fragment != null && fragment.onKeyDown(keyCode, event)
}

@SuppressLint("SimpleDateFormat")
override fun onResume() {
super.onResume()

val sdf = SimpleDateFormat("yyyy-MM-dd")
val now = System.currentTimeMillis()
val expire = Libcore.getExpireTime() * 1000
val dateExpire = Date(expire)
val build = Libcore.getBuildTime() * 1000
val dateBuild = Date(build)

var text: String? = null
if (now > expire) {
text = getString(
R.string.please_update_force, sdf.format(dateBuild), sdf.format(dateExpire)
)
} else if (now > (expire - 2592000000)) {
// 30 days remind :D
text = getString(
R.string.please_update, sdf.format(dateBuild), sdf.format(dateExpire)
)
}


if (text != null) {
MaterialAlertDialogBuilder(this@MainActivity).setTitle(R.string.insecure)
.setMessage(text)
.setPositiveButton(R.string.action_download) { _, _ ->
launchCustomTab(
"https://github.com/MatsuriDayo/Matsuri/releases"
)
}
.setNegativeButton(android.R.string.cancel, null)
.setCancelable(false)
.show()
}
}

}
5 changes: 5 additions & 0 deletions app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@color/ic_launcher_background"/>
<foreground android:drawable="@mipmap/ic_launcher_foreground"/>
</adaptive-icon>
Binary file modified app/src/main/res/mipmap-hdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified app/src/main/res/mipmap-hdpi/ic_launcher_foreground.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified app/src/main/res/mipmap-mdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified app/src/main/res/mipmap-mdpi/ic_launcher_foreground.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified app/src/main/res/mipmap-xhdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified app/src/main/res/mipmap-xhdpi/ic_launcher_foreground.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified app/src/main/res/mipmap-xxhdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified app/src/main/res/mipmap-xxhdpi/ic_launcher_foreground.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified app/src/main/res/mipmap-xxxhdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified app/src/main/res/mipmap-xxxhdpi/ic_launcher_foreground.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 0 additions & 7 deletions libcore/core.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import (
"os"
"path/filepath"
"strings"
"time"
)

func Setenv(key, value string) error {
Expand Down Expand Up @@ -58,12 +57,6 @@ func InitCore(internalAssets string, externalAssets string, prefix string, useOf
setupV2rayFileSystem(internalAssets, externalAssets)
setupResolvers()

if time.Now().Unix() >= GetExpireTime() {
outdated = "Your version is too old! Please update!! 版本太旧,请升级!"
} else if time.Now().Unix() < (GetBuildTime() - 86400) {
outdated = "Wrong system time! 系统时间错误!"
}

// Extract assets
if isBgProcess {
extractV2RayAssets(useOfficial)
Expand Down
19 changes: 0 additions & 19 deletions libcore/date.go

This file was deleted.

5 changes: 0 additions & 5 deletions libcore/v2ray.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package libcore

import (
"context"
"errors"
"fmt"
"log"
"strings"
Expand Down Expand Up @@ -40,10 +39,6 @@ func NewV2rayInstance() *V2RayInstance {
}

func (instance *V2RayInstance) LoadConfig(content string) error {
if outdated != "" {
return errors.New(outdated)
}

instance.access.Lock()
defer instance.access.Unlock()

Expand Down

0 comments on commit 8efc0e7

Please sign in to comment.