Skip to content

Commit 8ac8ac4

Browse files
various upgrades
Signed-off-by: androidacy-user <opensource@androidacy.com>
1 parent 573e54a commit 8ac8ac4

7 files changed

Lines changed: 724 additions & 639 deletions

File tree

.github/workflows/dependencies.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,8 @@ on:
33
push:
44
branches:
55
- master # run the action on your projects default branch
6-
pull_request:
7-
branches:
8-
- master # run the action on your projects default branch
6+
paths-ignore:
7+
- '**.md'
98

109
jobs:
1110
build:

app/src/main/java/com/fox2code/mmm/AppUpdateManager.kt

Lines changed: 3 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,10 @@ import com.fox2code.mmm.utils.io.Files.Companion.write
44
import com.fox2code.mmm.utils.io.net.Http.Companion.doHttpGet
55
import org.json.JSONObject
66
import timber.log.Timber
7-
import java.io.BufferedReader
87
import java.io.File
98
import java.io.FileInputStream
109
import java.io.IOException
1110
import java.io.InputStream
12-
import java.io.InputStreamReader
1311
import java.nio.charset.StandardCharsets
1412

1513
// See https://docs.github.com/en/rest/reference/repos#releases
@@ -96,55 +94,19 @@ class AppUpdateManager private constructor() {
9694
return if (!BuildConfig.ENABLE_AUTO_UPDATER || BuildConfig.DEBUG) false else peekShouldUpdate()
9795
}
9896

97+
@Suppress("UNUSED_PARAMETER")
9998
@Throws(IOException::class)
10099
private fun parseCompatibilityFlags(inputStream: InputStream) {
101100
compatDataId.clear()
102-
val bufferedReader = BufferedReader(InputStreamReader(inputStream, StandardCharsets.UTF_8))
103-
var line: String
104-
while (bufferedReader.readLine().also { line = it } != null) {
105-
line = line.trim { it <= ' ' }
106-
if (line.isEmpty() || line.startsWith("#")) continue
107-
val i = line.indexOf('/')
108-
if (i == -1) continue
109-
var value = 0
110-
for (arg in line.substring(i + 1).split(",".toRegex()).dropLastWhile { it.isEmpty() }
111-
.toTypedArray()) {
112-
when (arg) {
113-
"lowQuality" -> value = value or FLAG_COMPAT_LOW_QUALITY
114-
"noExt" -> value = value or FLAG_COMPAT_NO_EXT
115-
"magiskCmd" -> value = value or FLAG_COMPAT_MAGISK_CMD
116-
"need32bit" -> value = value or FLAG_COMPAT_NEED_32BIT
117-
"malware" -> value = value or FLAG_COMPAT_MALWARE
118-
"noANSI" -> value = value or FLAG_COMPAT_NO_ANSI
119-
"forceANSI" -> value = value or FLAG_COMPAT_FORCE_ANSI
120-
"forceHide" -> value = value or FLAG_COMPAT_FORCE_HIDE
121-
"mmtReborn" -> value = value or FLAG_COMPAT_MMT_REBORN
122-
"wrapper" -> value = value or FLAG_COMPAT_ZIP_WRAPPER
123-
else -> {
124-
run {}
125-
value = value or FLAG_COMPAT_LOW_QUALITY
126-
value = value or FLAG_COMPAT_NO_EXT
127-
value = value or FLAG_COMPAT_MAGISK_CMD
128-
value = value or FLAG_COMPAT_NEED_32BIT
129-
value = value or FLAG_COMPAT_MALWARE
130-
value = value or FLAG_COMPAT_NO_ANSI
131-
value = value or FLAG_COMPAT_FORCE_ANSI
132-
value = value or FLAG_COMPAT_FORCE_HIDE
133-
value = value or FLAG_COMPAT_MMT_REBORN
134-
value = value or FLAG_COMPAT_ZIP_WRAPPER
135-
}
136-
}
137-
}
138-
compatDataId[line.substring(0, i)] = value
139-
}
140-
bufferedReader.close()
101+
Timber.d("Not implemented")
141102
}
142103

143104
fun getCompatibilityFlags(moduleId: String): Int {
144105
val compatFlags = compatDataId[moduleId]
145106
return compatFlags ?: 0
146107
}
147108

109+
@Suppress("MemberVisibilityCanBePrivate")
148110
companion object {
149111
const val FLAG_COMPAT_LOW_QUALITY = 0x0001
150112
const val FLAG_COMPAT_NO_EXT = 0x0002

0 commit comments

Comments
 (0)