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
28d7a7a6
Commit
28d7a7a6
authored
Feb 01, 2019
by
topjohnwu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update libsu
parent
da13b5db
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
15 additions
and
16 deletions
+15
-16
build.gradle
app-core/build.gradle
+1
-1
App.java
app-core/src/main/java/com/topjohnwu/magisk/App.java
+0
-4
RepoDatabaseHelper.java
...ava/com/topjohnwu/magisk/database/RepoDatabaseHelper.java
+2
-2
FlashZip.java
...re/src/main/java/com/topjohnwu/magisk/tasks/FlashZip.java
+2
-1
MagiskInstaller.java
...main/java/com/topjohnwu/magisk/tasks/MagiskInstaller.java
+2
-1
Topic.java
app-core/src/main/java/com/topjohnwu/magisk/utils/Topic.java
+2
-2
Utils.java
app-core/src/main/java/com/topjohnwu/magisk/utils/Utils.java
+3
-2
FlashActivity.java
app/src/full/java/com/topjohnwu/magisk/FlashActivity.java
+3
-2
BaseActivity.java
...ll/java/com/topjohnwu/magisk/components/BaseActivity.java
+0
-1
No files found.
app-core/build.gradle
View file @
28d7a7a6
...
...
@@ -15,7 +15,7 @@ dependencies {
api
project
(
':signing'
)
api
'org.kamranzafar:jtar:2.3'
def
libsuVersion
=
'
2.2.0
'
def
libsuVersion
=
'
d99f481563
'
api
"com.github.topjohnwu.libsu:core:${libsuVersion}"
api
"com.github.topjohnwu.libsu:io:${libsuVersion}"
}
app-core/src/main/java/com/topjohnwu/magisk/App.java
View file @
28d7a7a6
...
...
@@ -3,9 +3,6 @@ package com.topjohnwu.magisk;
import
android.content.Context
;
import
android.content.SharedPreferences
;
import
android.content.res.Configuration
;
import
android.content.res.Resources
;
import
android.os.Handler
;
import
android.os.Looper
;
import
android.preference.PreferenceManager
;
import
com.topjohnwu.magisk.core.BuildConfig
;
...
...
@@ -20,7 +17,6 @@ import com.topjohnwu.superuser.Shell;
public
class
App
extends
ContainerApp
{
public
static
App
self
;
public
static
Handler
mainHandler
=
new
Handler
(
Looper
.
getMainLooper
());
public
boolean
init
=
false
;
// Global resources
...
...
app-core/src/main/java/com/topjohnwu/magisk/database/RepoDatabaseHelper.java
View file @
28d7a7a6
...
...
@@ -5,10 +5,10 @@ import android.database.Cursor;
import
android.database.sqlite.SQLiteDatabase
;
import
android.database.sqlite.SQLiteOpenHelper
;
import
com.topjohnwu.magisk.App
;
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
;
...
...
@@ -127,7 +127,7 @@ public class RepoDatabaseHelper extends SQLiteOpenHelper {
private
void
notifyAdapter
()
{
if
(
adapterCb
!=
null
)
{
App
.
mainHandler
.
post
(
adapterCb
);
UiThreadHandler
.
run
(
adapterCb
);
}
}
}
app-core/src/main/java/com/topjohnwu/magisk/tasks/FlashZip.java
View file @
28d7a7a6
...
...
@@ -9,6 +9,7 @@ import com.topjohnwu.magisk.utils.Utils;
import
com.topjohnwu.magisk.utils.ZipUtils
;
import
com.topjohnwu.superuser.Shell
;
import
com.topjohnwu.superuser.ShellUtils
;
import
com.topjohnwu.superuser.internal.UiThreadHandler
;
import
java.io.BufferedInputStream
;
import
java.io.BufferedOutputStream
;
...
...
@@ -76,7 +77,7 @@ public abstract class FlashZip {
}
catch
(
IOException
ignored
)
{}
Shell
.
su
(
"cd /"
,
"rm -rf "
+
tmpFile
.
getParent
()
+
" "
+
Const
.
TMP_FOLDER_PATH
).
submit
();
boolean
finalSuccess
=
success
;
App
.
mainHandler
.
post
(()
->
onResult
(
finalSuccess
));
UiThreadHandler
.
run
(()
->
onResult
(
finalSuccess
));
});
}
...
...
app-core/src/main/java/com/topjohnwu/magisk/tasks/MagiskInstaller.java
View file @
28d7a7a6
...
...
@@ -17,6 +17,7 @@ import com.topjohnwu.signing.SignBoot;
import
com.topjohnwu.superuser.Shell
;
import
com.topjohnwu.superuser.ShellUtils
;
import
com.topjohnwu.superuser.internal.NOPList
;
import
com.topjohnwu.superuser.internal.UiThreadHandler
;
import
com.topjohnwu.superuser.io.SuFile
;
import
com.topjohnwu.superuser.io.SuFileInputStream
;
import
com.topjohnwu.superuser.io.SuFileOutputStream
;
...
...
@@ -309,7 +310,7 @@ public abstract class MagiskInstaller {
public
void
exec
()
{
AsyncTask
.
THREAD_POOL_EXECUTOR
.
execute
(()
->
{
boolean
b
=
operations
();
App
.
mainHandler
.
post
(()
->
onResult
(
b
));
UiThreadHandler
.
run
(()
->
onResult
(
b
));
});
}
...
...
app-core/src/main/java/com/topjohnwu/magisk/utils/Topic.java
View file @
28d7a7a6
package
com
.
topjohnwu
.
magisk
.
utils
;
import
com.topjohnwu.
magisk.App
;
import
com.topjohnwu.
superuser.internal.UiThreadHandler
;
import
java.lang.annotation.Retention
;
import
java.lang.annotation.RetentionPolicy
;
...
...
@@ -64,7 +64,7 @@ public class Topic {
topicList
[
topic
].
published
=
true
;
}
for
(
Subscriber
sub
:
topicList
[
topic
].
subscribers
)
{
App
.
mainHandler
.
post
(()
->
sub
.
onPublish
(
topic
,
results
));
UiThreadHandler
.
run
(()
->
sub
.
onPublish
(
topic
,
results
));
}
}
...
...
app-core/src/main/java/com/topjohnwu/magisk/utils/Utils.java
View file @
28d7a7a6
...
...
@@ -20,6 +20,7 @@ import com.topjohnwu.magisk.container.Module;
import
com.topjohnwu.magisk.container.ValueSortedMap
;
import
com.topjohnwu.net.Networking
;
import
com.topjohnwu.superuser.Shell
;
import
com.topjohnwu.superuser.internal.UiThreadHandler
;
import
com.topjohnwu.superuser.io.SuFile
;
import
java.util.Locale
;
...
...
@@ -28,11 +29,11 @@ import java.util.Map;
public
class
Utils
{
public
static
void
toast
(
CharSequence
msg
,
int
duration
)
{
App
.
mainHandler
.
post
(()
->
Toast
.
makeText
(
App
.
self
,
msg
,
duration
).
show
());
UiThreadHandler
.
run
(()
->
Toast
.
makeText
(
App
.
self
,
msg
,
duration
).
show
());
}
public
static
void
toast
(
int
resId
,
int
duration
)
{
App
.
mainHandler
.
post
(()
->
Toast
.
makeText
(
App
.
self
,
resId
,
duration
).
show
());
UiThreadHandler
.
run
(()
->
Toast
.
makeText
(
App
.
self
,
resId
,
duration
).
show
());
}
public
static
String
dlString
(
String
url
)
{
...
...
app/src/full/java/com/topjohnwu/magisk/FlashActivity.java
View file @
28d7a7a6
...
...
@@ -15,6 +15,7 @@ import com.topjohnwu.magisk.tasks.MagiskInstaller;
import
com.topjohnwu.magisk.utils.Utils
;
import
com.topjohnwu.superuser.CallbackList
;
import
com.topjohnwu.superuser.Shell
;
import
com.topjohnwu.superuser.internal.UiThreadHandler
;
import
java.io.File
;
import
java.io.FileWriter
;
...
...
@@ -180,7 +181,7 @@ public class FlashActivity extends BaseActivity {
@Override
public
String
set
(
int
i
,
String
s
)
{
String
ret
=
super
.
set
(
i
,
s
);
App
.
mainHandler
.
post
(
this
::
updateUI
);
UiThreadHandler
.
run
(
this
::
updateUI
);
return
ret
;
}
}
...
...
@@ -212,7 +213,7 @@ public class FlashActivity extends BaseActivity {
@Override
protected
void
onResult
(
boolean
success
)
{
if
(
success
)
App
.
mainH
andler
.
postDelayed
(
Shell
.
su
(
"pm uninstall "
+
getPackageName
())::
exec
,
3000
);
UiThreadHandler
.
h
andler
.
postDelayed
(
Shell
.
su
(
"pm uninstall "
+
getPackageName
())::
exec
,
3000
);
else
super
.
onResult
(
false
);
}
...
...
app/src/full/java/com/topjohnwu/magisk/components/BaseActivity.java
View file @
28d7a7a6
...
...
@@ -4,7 +4,6 @@ import android.Manifest;
import
android.content.Context
;
import
android.content.Intent
;
import
android.content.pm.PackageManager
;
import
android.content.res.Configuration
;
import
android.os.Bundle
;
import
android.view.WindowManager
;
import
android.widget.Toast
;
...
...
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