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
c1a0f520
Commit
c1a0f520
authored
Sep 29, 2017
by
topjohnwu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Prevent flash screen close when tapping outside
parent
773c24b7
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
41 additions
and
45 deletions
+41
-45
FlashActivity.java
app/src/main/java/com/topjohnwu/magisk/FlashActivity.java
+33
-1
FlashZip.java
app/src/main/java/com/topjohnwu/magisk/asyncs/FlashZip.java
+3
-3
InstallMagisk.java
.../main/java/com/topjohnwu/magisk/asyncs/InstallMagisk.java
+5
-5
AdaptiveList.java
...rc/main/java/com/topjohnwu/magisk/utils/AdaptiveList.java
+0
-36
No files found.
app/src/main/java/com/topjohnwu/magisk/FlashActivity.java
View file @
c1a0f520
...
@@ -16,9 +16,9 @@ import android.widget.TextView;
...
@@ -16,9 +16,9 @@ import android.widget.TextView;
import
com.topjohnwu.magisk.asyncs.FlashZip
;
import
com.topjohnwu.magisk.asyncs.FlashZip
;
import
com.topjohnwu.magisk.asyncs.InstallMagisk
;
import
com.topjohnwu.magisk.asyncs.InstallMagisk
;
import
com.topjohnwu.magisk.components.Activity
;
import
com.topjohnwu.magisk.components.Activity
;
import
com.topjohnwu.magisk.utils.AdaptiveList
;
import
com.topjohnwu.magisk.utils.Shell
;
import
com.topjohnwu.magisk.utils.Shell
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.List
;
import
butterknife.BindView
;
import
butterknife.BindView
;
...
@@ -63,6 +63,7 @@ public class FlashActivity extends Activity {
...
@@ -63,6 +63,7 @@ public class FlashActivity extends Activity {
ab
.
setTitle
(
R
.
string
.
flashing
);
ab
.
setTitle
(
R
.
string
.
flashing
);
}
}
setFloating
();
setFloating
();
setFinishOnTouchOutside
(
false
);
if
(!
Shell
.
rootAccess
())
if
(!
Shell
.
rootAccess
())
reboot
.
setVisibility
(
View
.
GONE
);
reboot
.
setVisibility
(
View
.
GONE
);
...
@@ -148,4 +149,35 @@ public class FlashActivity extends Activity {
...
@@ -148,4 +149,35 @@ public class FlashActivity extends Activity {
ButterKnife
.
bind
(
this
,
itemView
);
ButterKnife
.
bind
(
this
,
itemView
);
}
}
}
}
public
static
class
AdaptiveList
<
E
>
extends
ArrayList
<
E
>
{
private
Runnable
callback
;
private
RecyclerView
mView
;
public
AdaptiveList
(
RecyclerView
v
)
{
mView
=
v
;
}
public
void
updateView
()
{
mView
.
getAdapter
().
notifyDataSetChanged
();
mView
.
scrollToPosition
(
mView
.
getAdapter
().
getItemCount
()
-
1
);
}
public
void
setCallback
(
Runnable
cb
)
{
callback
=
cb
;
}
public
boolean
add
(
E
e
)
{
boolean
ret
=
super
.
add
(
e
);
if
(
ret
)
{
if
(
callback
==
null
)
{
updateView
();
}
else
{
callback
.
run
();
}
}
return
ret
;
}
}
}
}
app/src/main/java/com/topjohnwu/magisk/asyncs/FlashZip.java
View file @
c1a0f520
...
@@ -4,9 +4,9 @@ import android.app.Activity;
...
@@ -4,9 +4,9 @@ import android.app.Activity;
import
android.net.Uri
;
import
android.net.Uri
;
import
android.text.TextUtils
;
import
android.text.TextUtils
;
import
com.topjohnwu.magisk.FlashActivity
;
import
com.topjohnwu.magisk.MagiskManager
;
import
com.topjohnwu.magisk.MagiskManager
;
import
com.topjohnwu.magisk.R
;
import
com.topjohnwu.magisk.R
;
import
com.topjohnwu.magisk.utils.AdaptiveList
;
import
com.topjohnwu.magisk.utils.Utils
;
import
com.topjohnwu.magisk.utils.Utils
;
import
com.topjohnwu.magisk.utils.ZipUtils
;
import
com.topjohnwu.magisk.utils.ZipUtils
;
...
@@ -24,9 +24,9 @@ public class FlashZip extends ParallelTask<Void, Void, Integer> {
...
@@ -24,9 +24,9 @@ public class FlashZip extends ParallelTask<Void, Void, Integer> {
private
Uri
mUri
;
private
Uri
mUri
;
private
File
mCachedFile
;
private
File
mCachedFile
;
private
AdaptiveList
<
String
>
mList
;
private
FlashActivity
.
AdaptiveList
<
String
>
mList
;
public
FlashZip
(
Activity
context
,
Uri
uri
,
AdaptiveList
<
String
>
list
)
{
public
FlashZip
(
Activity
context
,
Uri
uri
,
FlashActivity
.
AdaptiveList
<
String
>
list
)
{
super
(
context
);
super
(
context
);
mUri
=
uri
;
mUri
=
uri
;
mList
=
list
;
mList
=
list
;
...
...
app/src/main/java/com/topjohnwu/magisk/asyncs/InstallMagisk.java
View file @
c1a0f520
...
@@ -6,8 +6,8 @@ import android.os.Build;
...
@@ -6,8 +6,8 @@ import android.os.Build;
import
android.os.Environment
;
import
android.os.Environment
;
import
android.text.TextUtils
;
import
android.text.TextUtils
;
import
com.topjohnwu.magisk.FlashActivity
;
import
com.topjohnwu.magisk.MagiskManager
;
import
com.topjohnwu.magisk.MagiskManager
;
import
com.topjohnwu.magisk.utils.AdaptiveList
;
import
com.topjohnwu.magisk.utils.Shell
;
import
com.topjohnwu.magisk.utils.Shell
;
import
com.topjohnwu.magisk.utils.TarEntry
;
import
com.topjohnwu.magisk.utils.TarEntry
;
import
com.topjohnwu.magisk.utils.Utils
;
import
com.topjohnwu.magisk.utils.Utils
;
...
@@ -34,12 +34,12 @@ public class InstallMagisk extends ParallelTask<Void, Void, Boolean> {
...
@@ -34,12 +34,12 @@ public class InstallMagisk extends ParallelTask<Void, Void, Boolean> {
private
static
final
int
DIRECT_MODE
=
1
;
private
static
final
int
DIRECT_MODE
=
1
;
private
Uri
mBootImg
,
mZip
;
private
Uri
mBootImg
,
mZip
;
private
AdaptiveList
<
String
>
mList
;
private
FlashActivity
.
AdaptiveList
<
String
>
mList
;
private
String
mBootLocation
;
private
String
mBootLocation
;
private
boolean
mKeepEnc
,
mKeepVerity
;
private
boolean
mKeepEnc
,
mKeepVerity
;
private
int
mode
;
private
int
mode
;
private
InstallMagisk
(
Activity
context
,
AdaptiveList
<
String
>
list
,
Uri
zip
,
boolean
enc
,
boolean
verity
)
{
private
InstallMagisk
(
Activity
context
,
FlashActivity
.
AdaptiveList
<
String
>
list
,
Uri
zip
,
boolean
enc
,
boolean
verity
)
{
super
(
context
);
super
(
context
);
mList
=
list
;
mList
=
list
;
mZip
=
zip
;
mZip
=
zip
;
...
@@ -47,13 +47,13 @@ public class InstallMagisk extends ParallelTask<Void, Void, Boolean> {
...
@@ -47,13 +47,13 @@ public class InstallMagisk extends ParallelTask<Void, Void, Boolean> {
mKeepVerity
=
verity
;
mKeepVerity
=
verity
;
}
}
public
InstallMagisk
(
Activity
context
,
AdaptiveList
<
String
>
list
,
Uri
zip
,
boolean
enc
,
boolean
verity
,
Uri
boot
)
{
public
InstallMagisk
(
Activity
context
,
FlashActivity
.
AdaptiveList
<
String
>
list
,
Uri
zip
,
boolean
enc
,
boolean
verity
,
Uri
boot
)
{
this
(
context
,
list
,
zip
,
enc
,
verity
);
this
(
context
,
list
,
zip
,
enc
,
verity
);
mBootImg
=
boot
;
mBootImg
=
boot
;
mode
=
PATCH_MODE
;
mode
=
PATCH_MODE
;
}
}
public
InstallMagisk
(
Activity
context
,
AdaptiveList
<
String
>
list
,
Uri
zip
,
boolean
enc
,
boolean
verity
,
String
boot
)
{
public
InstallMagisk
(
Activity
context
,
FlashActivity
.
AdaptiveList
<
String
>
list
,
Uri
zip
,
boolean
enc
,
boolean
verity
,
String
boot
)
{
this
(
context
,
list
,
zip
,
enc
,
verity
);
this
(
context
,
list
,
zip
,
enc
,
verity
);
mBootLocation
=
boot
;
mBootLocation
=
boot
;
mode
=
DIRECT_MODE
;
mode
=
DIRECT_MODE
;
...
...
app/src/main/java/com/topjohnwu/magisk/utils/AdaptiveList.java
deleted
100644 → 0
View file @
773c24b7
package
com
.
topjohnwu
.
magisk
.
utils
;
import
android.support.v7.widget.RecyclerView
;
import
java.util.ArrayList
;
public
class
AdaptiveList
<
E
>
extends
ArrayList
<
E
>
{
private
Runnable
callback
;
private
RecyclerView
mView
;
public
AdaptiveList
(
RecyclerView
v
)
{
mView
=
v
;
}
public
void
updateView
()
{
mView
.
getAdapter
().
notifyDataSetChanged
();
mView
.
scrollToPosition
(
mView
.
getAdapter
().
getItemCount
()
-
1
);
}
public
void
setCallback
(
Runnable
cb
)
{
callback
=
cb
;
}
public
boolean
add
(
E
e
)
{
boolean
ret
=
super
.
add
(
e
);
if
(
ret
)
{
if
(
callback
==
null
)
{
updateView
();
}
else
{
callback
.
run
();
}
}
return
ret
;
}
}
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