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
1e94f0a0
Commit
1e94f0a0
authored
Feb 03, 2019
by
topjohnwu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Some minor adjustments
parent
e39d2567
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
13 additions
and
11 deletions
+13
-11
RepoDatabaseHelper.java
...ava/com/topjohnwu/magisk/database/RepoDatabaseHelper.java
+0
-1
FlashZip.java
...re/src/main/java/com/topjohnwu/magisk/tasks/FlashZip.java
+2
-1
MagiskFragment.java
...l/java/com/topjohnwu/magisk/fragments/MagiskFragment.java
+6
-5
DownloadApp.java
...src/full/java/com/topjohnwu/magisk/utils/DownloadApp.java
+2
-2
PatchAPK.java
app/src/full/java/com/topjohnwu/magisk/utils/PatchAPK.java
+2
-2
fragment_magisk.xml
app/src/full/res/layout/fragment_magisk.xml
+1
-0
No files found.
app-core/src/main/java/com/topjohnwu/magisk/database/RepoDatabaseHelper.java
View file @
1e94f0a0
...
...
@@ -8,7 +8,6 @@ import android.database.sqlite.SQLiteOpenHelper;
import
com.topjohnwu.magisk.Config
;
import
com.topjohnwu.magisk.Const
;
import
com.topjohnwu.magisk.container.Repo
;
import
com.topjohnwu.superuser.internal.UiThreadHandler
;
import
java.util.HashSet
;
import
java.util.Set
;
...
...
app-core/src/main/java/com/topjohnwu/magisk/tasks/FlashZip.java
View file @
1e94f0a0
...
...
@@ -35,7 +35,8 @@ public abstract class FlashZip {
private
boolean
unzipAndCheck
()
throws
IOException
{
ZipUtils
.
unzip
(
tmpFile
,
tmpFile
.
getParentFile
(),
"META-INF/com/google/android"
,
true
);
return
ShellUtils
.
fastCmdResult
(
"grep -q '#MAGISK' "
+
new
File
(
tmpFile
.
getParentFile
(),
"updater-script"
));
return
Shell
.
su
(
"grep -q '#MAGISK' "
+
new
File
(
tmpFile
.
getParentFile
(),
"updater-script"
))
.
exec
().
isSuccess
();
}
private
boolean
flash
()
throws
IOException
{
...
...
app/src/full/java/com/topjohnwu/magisk/fragments/MagiskFragment.java
View file @
1e94f0a0
...
...
@@ -30,7 +30,6 @@ import com.topjohnwu.magisk.utils.AppUtils;
import
com.topjohnwu.magisk.utils.Topic
;
import
com.topjohnwu.net.Networking
;
import
com.topjohnwu.superuser.Shell
;
import
com.topjohnwu.superuser.ShellUtils
;
import
java.util.Locale
;
...
...
@@ -254,7 +253,7 @@ public class MagiskFragment extends BaseFragment
private
void
updateCheckUI
()
{
int
image
,
color
;
String
status
;
String
status
,
button
=
""
;
if
(
Config
.
remoteMagiskVersionCode
<
0
)
{
color
=
colorNeutral
;
...
...
@@ -268,12 +267,12 @@ public class MagiskFragment extends BaseFragment
color
=
colorInfo
;
image
=
R
.
drawable
.
ic_update
;
status
=
getString
(
R
.
string
.
magisk_update_title
);
magisk
.
install
.
setText
(
R
.
string
.
update
);
button
=
getString
(
R
.
string
.
update
);
}
else
{
color
=
colorOK
;
image
=
R
.
drawable
.
ic_check_circle
;
status
=
getString
(
R
.
string
.
magisk_up_to_date
);
magisk
.
install
.
setText
(
R
.
string
.
install
);
button
=
getString
(
R
.
string
.
install
);
}
}
if
(
Config
.
magiskVersionCode
>
0
)
{
...
...
@@ -281,6 +280,7 @@ public class MagiskFragment extends BaseFragment
magisk
.
statusIcon
.
setImageResource
(
image
);
magisk
.
statusIcon
.
setColorFilter
(
color
);
magisk
.
status
.
setText
(
status
);
magisk
.
install
.
setText
(
button
);
}
if
(
Config
.
remoteManagerVersionCode
<
0
)
{
...
...
@@ -322,7 +322,8 @@ public class MagiskFragment extends BaseFragment
uninstallButton
.
setVisibility
(
Shell
.
rootAccess
()
?
View
.
VISIBLE
:
View
.
GONE
);
}
if
(!
shownDialog
&&
!
ShellUtils
.
fastCmdResult
(
"env_check"
))
{
if
(!
shownDialog
&&
Config
.
magiskVersionCode
>
0
&&
!
Shell
.
su
(
"env_check"
).
exec
().
isSuccess
())
{
shownDialog
=
true
;
new
EnvFixDialog
(
requireActivity
()).
show
();
}
...
...
app/src/full/java/com/topjohnwu/magisk/utils/DownloadApp.java
View file @
1e94f0a0
...
...
@@ -7,7 +7,7 @@ import com.topjohnwu.magisk.R;
import
com.topjohnwu.magisk.uicomponents.ProgressNotification
;
import
com.topjohnwu.net.Networking
;
import
com.topjohnwu.net.ResponseListener
;
import
com.topjohnwu.superuser.Shell
Utils
;
import
com.topjohnwu.superuser.Shell
;
import
java.io.File
;
...
...
@@ -84,7 +84,7 @@ public class DownloadApp {
Config
.
export
();
// Make it world readable
apk
.
setReadable
(
true
,
false
);
if
(
Shell
Utils
.
fastCmdResult
(
"pm install "
+
apk
))
if
(
Shell
.
su
(
"pm install "
+
apk
).
exec
().
isSuccess
(
))
RootUtils
.
rmAndLaunch
(
app
.
getPackageName
(),
BuildConfig
.
APPLICATION_ID
);
progress
.
dismiss
();
}
...
...
app/src/full/java/com/topjohnwu/magisk/utils/PatchAPK.java
View file @
1e94f0a0
...
...
@@ -10,7 +10,7 @@ import com.topjohnwu.magisk.R;
import
com.topjohnwu.magisk.uicomponents.Notifications
;
import
com.topjohnwu.signing.JarMap
;
import
com.topjohnwu.signing.SignAPK
;
import
com.topjohnwu.superuser.Shell
Utils
;
import
com.topjohnwu.superuser.Shell
;
import
java.io.BufferedOutputStream
;
import
java.io.File
;
...
...
@@ -104,7 +104,7 @@ public class PatchAPK {
// Install the application
repack
.
setReadable
(
true
,
false
);
if
(!
Shell
Utils
.
fastCmdResult
(
"pm install "
+
repack
))
if
(!
Shell
.
su
(
"pm install "
+
repack
).
exec
().
isSuccess
(
))
return
false
;
Config
.
set
(
Config
.
Key
.
SU_MANAGER
,
pkg
);
...
...
app/src/full/res/layout/fragment_magisk.xml
View file @
1e94f0a0
...
...
@@ -79,6 +79,7 @@
android:layout_marginTop=
"4dp"
android:layout_marginRight=
"5dp"
android:layout_marginBottom=
"4dp"
android:visibility=
"gone"
app:cardCornerRadius=
"@dimen/card_corner_radius"
app:cardElevation=
"@dimen/card_elevation"
>
...
...
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