Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
M
Magisk
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
Magisk
Commits
5aafc788
Commit
5aafc788
authored
Aug 12, 2019
by
topjohnwu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Cleanup const
parent
0d03833c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
19 deletions
+2
-19
Const.kt
app/src/main/java/com/topjohnwu/magisk/Const.kt
+0
-18
FlashViewModel.kt
...main/java/com/topjohnwu/magisk/ui/flash/FlashViewModel.kt
+2
-1
No files found.
app/src/main/java/com/topjohnwu/magisk/Const.kt
View file @
5aafc788
package
com.topjohnwu.magisk
import
android.os.Environment
import
android.os.Process
import
java.io.File
object
Const
{
const
val
DEBUG_TAG
=
"MagiskManager"
// Paths
const
val
MAGISK_PATH
=
"/sbin/.magisk/img"
@JvmField
val
EXTERNAL_PATH
=
Environment
.
getExternalStoragePublicDirectory
(
Environment
.
DIRECTORY_DOWNLOADS
)
!!
@JvmField
var
MAGISK_DISABLE_FILE
=
File
(
"xxx"
)
const
val
TMP_FOLDER_PATH
=
"/dev/tmp"
const
val
MAGISK_LOG
=
"/cache/magisk.log"
...
...
@@ -27,13 +20,8 @@ object Const {
const
val
ANDROID_MANIFEST
=
"AndroidManifest.xml"
const
val
MAGISK_INSTALL_LOG_FILENAME
=
"magisk_install_log_%s.log"
const
val
MANAGER_CONFIGS
=
".tmp.magisk.config"
@JvmField
val
USER_ID
=
Process
.
myUid
()
/
100000
init
{
EXTERNAL_PATH
.
mkdirs
()
}
object
MagiskVersion
{
const
val
MIN_SUPPORT
=
18000
}
...
...
@@ -59,14 +47,9 @@ object Const {
const
val
TWITTER_URL
=
"https://twitter.com/topjohnwu"
const
val
XDA_THREAD
=
"http://forum.xda-developers.com/showthread.php?t=3432382"
const
val
SOURCE_CODE_URL
=
"https://github.com/topjohnwu/Magisk"
@JvmField
val
BOOTCTL_URL
=
getRaw
(
"9c5dfc1b8245c0b5b524901ef0ff0f8335757b77"
,
"bootctl"
)
const
val
GITHUB_RAW_URL
=
"https://raw.githubusercontent.com/"
const
val
GITHUB_API_URL
=
"https://api.github.com/users/Magisk-Modules-Repo/"
private
fun
getRaw
(
where
:
String
,
name
:
String
)
=
"${GITHUB_RAW_URL}topjohnwu/magisk_files/$where/$name"
}
object
Key
{
...
...
@@ -92,5 +75,4 @@ object Const {
const
val
UNINSTALL
=
"uninstall"
}
}
app/src/main/java/com/topjohnwu/magisk/ui/flash/FlashViewModel.kt
View file @
5aafc788
...
...
@@ -13,6 +13,7 @@ import com.skoumal.teanity.util.DiffObservableList
import
com.skoumal.teanity.util.KObservableField
import
com.skoumal.teanity.viewevents.SnackbarEvent
import
com.topjohnwu.magisk.BR
import
com.topjohnwu.magisk.Config
import
com.topjohnwu.magisk.Const
import
com.topjohnwu.magisk.R
import
com.topjohnwu.magisk.extensions.*
...
...
@@ -90,7 +91,7 @@ class FlashViewModel(
.
map
{
now
}
.
map
{
it
.
toTime
(
timeFormatStandard
)
}
.
map
{
Const
.
MAGISK_INSTALL_LOG_FILENAME
.
format
(
it
)
}
.
map
{
File
(
Con
st
.
EXTERNAL_PATH
,
it
)
}
.
map
{
File
(
Con
fig
.
downloadDirectory
,
it
)
}
.
map
{
file
->
file
.
bufferedWriter
().
use
{
writer
->
logItems
.
forEach
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment