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
1e09ccb4
Commit
1e09ccb4
authored
Sep 17, 2016
by
topjohnwu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update FlashZip
parent
11e1d04d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
23 deletions
+17
-23
ModulesFragment.java
app/src/main/java/com/topjohnwu/magisk/ModulesFragment.java
+4
-10
Utils.java
app/src/main/java/com/topjohnwu/magisk/utils/Utils.java
+13
-13
No files found.
app/src/main/java/com/topjohnwu/magisk/ModulesFragment.java
View file @
1e09ccb4
...
@@ -43,14 +43,10 @@ public class ModulesFragment extends Fragment {
...
@@ -43,14 +43,10 @@ public class ModulesFragment extends Fragment {
private
static
final
int
FETCH_ZIP_CODE
=
2
;
private
static
final
int
FETCH_ZIP_CODE
=
2
;
public
static
List
<
Module
>
listModules
=
new
ArrayList
<>();
public
static
List
<
Module
>
listModules
=
new
ArrayList
<>();
public
static
List
<
Module
>
listModulesCache
=
new
ArrayList
<>();
public
static
List
<
Module
>
listModulesCache
=
new
ArrayList
<>();
@BindView
(
R
.
id
.
progressBar
)
@BindView
(
R
.
id
.
progressBar
)
ProgressBar
progressBar
;
ProgressBar
progressBar
;
@BindView
(
R
.
id
.
fab
)
FloatingActionButton
fabio
;
@BindView
(
R
.
id
.
fab
)
@BindView
(
R
.
id
.
pager
)
ViewPager
viewPager
;
FloatingActionButton
fabio
;
@BindView
(
R
.
id
.
tab_layout
)
TabLayout
tabLayout
;
@BindView
(
R
.
id
.
pager
)
ViewPager
viewPager
;
@BindView
(
R
.
id
.
tab_layout
)
TabLayout
tabLayout
;
private
int
viewPagePosition
;
private
int
viewPagePosition
;
private
RepoHelper
.
TaskDelegate
mTaskDelegate
;
private
RepoHelper
.
TaskDelegate
mTaskDelegate
;
...
@@ -69,12 +65,10 @@ public class ModulesFragment extends Fragment {
...
@@ -69,12 +65,10 @@ public class ModulesFragment extends Fragment {
});
});
new
Utils
.
LoadModules
(
getActivity
()).
execute
();
mTaskDelegate
=
result
->
{
mTaskDelegate
=
result
->
{
if
(
result
.
equals
(
"OK"
))
{
if
(
result
.
equals
(
"OK"
))
{
RefreshUI
();
RefreshUI
();
}
}
};
};
new
updateUI
().
execute
();
new
updateUI
().
execute
();
...
...
app/src/main/java/com/topjohnwu/magisk/utils/Utils.java
View file @
1e09ccb4
...
@@ -517,13 +517,13 @@ public class Utils {
...
@@ -517,13 +517,13 @@ public class Utils {
final
String
docId
=
DocumentsContract
.
getDocumentId
(
mUri
);
final
String
docId
=
DocumentsContract
.
getDocumentId
(
mUri
);
Log
.
d
(
"Magisk"
,
"Utils: FlashZip Running, "
+
docId
+
" and "
+
mUri
.
toString
());
Log
.
d
(
"Magisk"
,
"Utils: FlashZip Running, "
+
docId
+
" and "
+
mUri
.
toString
());
String
[]
split
=
docId
.
split
(
":"
);
if
(
docId
.
contains
(
":"
))
mName
=
split
[
1
];
mName
=
docId
.
split
(
":"
)
[
1
];
if
(
mName
.
contains
(
"/"
))
{
else
mName
=
docId
;
split
=
mName
.
split
(
"/"
);
if
(
mName
.
contains
(
"/"
))
}
mName
=
mName
.
substring
(
mName
.
lastIndexOf
(
'/'
)
+
1
);
if
(
split
[
1
]
.
contains
(
".zip"
))
{
if
(
mName
.
contains
(
".zip"
))
{
file
=
mContext
.
getFilesDir
()
+
"/"
+
split
[
1
]
;
file
=
mContext
.
getFilesDir
()
+
"/"
+
mName
;
Log
.
d
(
"Magisk"
,
"Utils: FlashZip running for uRI "
+
mUri
.
toString
());
Log
.
d
(
"Magisk"
,
"Utils: FlashZip running for uRI "
+
mUri
.
toString
());
}
else
{
}
else
{
Log
.
e
(
"Magisk"
,
"Utils: error parsing Zipfile "
+
mUri
.
getPath
());
Log
.
e
(
"Magisk"
,
"Utils: error parsing Zipfile "
+
mUri
.
getPath
());
...
@@ -587,6 +587,7 @@ public class Utils {
...
@@ -587,6 +587,7 @@ public class Utils {
protected
Boolean
doInBackground
(
Void
...
voids
)
{
protected
Boolean
doInBackground
(
Void
...
voids
)
{
if
(
mPath
!=
null
)
{
if
(
mPath
!=
null
)
{
Log
.
e
(
"Magisk"
,
"Utils: Error, flashZIP called without a valid zip file to flash."
);
Log
.
e
(
"Magisk"
,
"Utils: Error, flashZIP called without a valid zip file to flash."
);
progress
.
dismiss
();
this
.
cancel
(
true
);
this
.
cancel
(
true
);
return
false
;
return
false
;
}
}
...
@@ -594,11 +595,11 @@ public class Utils {
...
@@ -594,11 +595,11 @@ public class Utils {
return
false
;
return
false
;
}
else
{
}
else
{
ret
=
Shell
.
su
(
ret
=
Shell
.
su
(
"rm -rf /d
ata
/tmp"
,
"rm -rf /d
ev
/tmp"
,
"mkdir -p /d
ata
/tmp"
,
"mkdir -p /d
ev
/tmp"
,
"cp -af "
+
mPath
+
" /d
ata
/tmp/install.zip"
,
"cp -af "
+
mPath
+
" /d
ev
/tmp/install.zip"
,
"unzip -o /d
ata/tmp/install.zip META-INF/com/google/android/* -d /data
/tmp"
,
"unzip -o /d
ev/tmp/install.zip META-INF/com/google/android/* -d /dev
/tmp"
,
"BOOTMODE=true sh /d
ata/tmp/META-INF/com/google/android/update-binary dummy 1 /data
/tmp/install.zip"
,
"BOOTMODE=true sh /d
ev/tmp/META-INF/com/google/android/update-binary dummy 1 /dev
/tmp/install.zip"
,
"if [ $? -eq 0 ]; then echo true; else echo false; fi"
"if [ $? -eq 0 ]; then echo true; else echo false; fi"
);
);
return
ret
!=
null
&&
Boolean
.
parseBoolean
(
ret
.
get
(
ret
.
size
()
-
1
));
return
ret
!=
null
&&
Boolean
.
parseBoolean
(
ret
.
get
(
ret
.
size
()
-
1
));
...
@@ -608,7 +609,6 @@ public class Utils {
...
@@ -608,7 +609,6 @@ public class Utils {
@Override
@Override
protected
void
onPostExecute
(
Boolean
result
)
{
protected
void
onPostExecute
(
Boolean
result
)
{
super
.
onPostExecute
(
result
);
super
.
onPostExecute
(
result
);
Shell
.
su
(
"rm -rf /data/tmp"
);
if
(
deleteFileAfter
)
{
if
(
deleteFileAfter
)
{
Shell
.
su
(
"rm -rf "
+
mPath
);
Shell
.
su
(
"rm -rf "
+
mPath
);
Log
.
d
(
"Magisk"
,
"Utils: Deleting file "
+
mPath
);
Log
.
d
(
"Magisk"
,
"Utils: Deleting file "
+
mPath
);
...
...
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