Skip to content

Commit

Permalink
fix extractV2RayAssets
Browse files Browse the repository at this point in the history
  • Loading branch information
arm64v8a committed Feb 11, 2023
1 parent ebd5616 commit 81993b8
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions libcore/assets_android.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,21 +76,16 @@ func extractAssetName(name string, useOfficialAssets bool) error {
return err
}

doExtract := false
fileMissing := false
var doExtract bool

if _, err := os.Stat(dir + version); err != nil {
fileMissing = true
} else if _, err := os.Stat(dstName); err != nil {
fileMissing = true
}

if fileMissing {
if _, err := os.Stat(dstName); err != nil {
// assetFileMissing
doExtract = true
} else if useOfficialAssets || !replaceable {
// 官方源升级
b, err := ioutil.ReadFile(dir + version)
if err != nil {
// versionFileMissing
doExtract = true
_ = os.RemoveAll(version)
} else {
Expand Down

0 comments on commit 81993b8

Please sign in to comment.