Skip to content

Commit

Permalink
Remove unused
Browse files Browse the repository at this point in the history
  • Loading branch information
arm64v8a authored and purofle committed Oct 31, 2023
1 parent 51889ed commit 5dc09ca
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 69 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 @@ -36,9 +36,7 @@ import io.nekohasekai.sagernet.group.GroupInterfaceAdapter
import io.nekohasekai.sagernet.group.GroupUpdater
import io.nekohasekai.sagernet.ktx.*
import io.nekohasekai.sagernet.widget.ListHolderListener
import libcore.Libcore
import moe.matsuri.nb4a.utils.Util
import java.text.SimpleDateFormat
import java.util.*

class MainActivity : ThemedActivity(),
Expand Down Expand Up @@ -465,42 +463,4 @@ class MainActivity : ThemedActivity(),
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/NekoBoxForAndroid/releases"
)
}
.setNegativeButton(android.R.string.cancel, null)
.setCancelable(false)
.show()
}
}

}
4 changes: 0 additions & 4 deletions libcore/box.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,10 +118,6 @@ func NewSingBoxInstance(config string) (b *BoxInstance, err error) {
func (b *BoxInstance) Start() (err error) {
defer device.DeferPanicToError("box.Start", func(err_ error) { err = err_ })

if outdated != "" {
return errors.New(outdated)
}

if b.state == 0 {
b.state = 1
return b.Box.Start()
Expand Down
20 changes: 0 additions & 20 deletions libcore/date.go

This file was deleted.

5 changes: 0 additions & 5 deletions libcore/nb4a.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import (
"path/filepath"
"runtime"
"strings"
"time"
_ "unsafe"

"log"
Expand Down Expand Up @@ -72,10 +71,6 @@ func InitCore(process, cachePath, internalAssets, externalAssets string,
externalAssetsPath = externalAssets
internalAssetsPath = internalAssets

if time.Now().Unix() >= GetExpireTime() {
outdated = "Your version is too old! Please update!! 版本太旧,请升级!"
}

// certs
pem, err := os.ReadFile(externalAssetsPath + "ca.pem")
if err == nil {
Expand Down

0 comments on commit 5dc09ca

Please sign in to comment.