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
baae3592
Commit
baae3592
authored
Sep 20, 2016
by
topjohnwu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Small cleanup
parent
2cdb6b81
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
427 additions
and
459 deletions
+427
-459
build.gradle
app/build.gradle
+4
-3
MagiskFragment.java
app/src/main/java/com/topjohnwu/magisk/MagiskFragment.java
+2
-2
ModulesAdapter.java
app/src/main/java/com/topjohnwu/magisk/ModulesAdapter.java
+2
-1
ModulesFragment.java
app/src/main/java/com/topjohnwu/magisk/ModulesFragment.java
+2
-2
QuickSettingTileService.java
...in/java/com/topjohnwu/magisk/QuickSettingTileService.java
+1
-1
ReposAdapter.java
app/src/main/java/com/topjohnwu/magisk/ReposAdapter.java
+2
-1
ReposFragment.java
app/src/main/java/com/topjohnwu/magisk/ReposFragment.java
+2
-1
WelcomeActivity.java
app/src/main/java/com/topjohnwu/magisk/WelcomeActivity.java
+8
-7
Async.java
app/src/main/java/com/topjohnwu/magisk/utils/Async.java
+379
-0
Utils.java
app/src/main/java/com/topjohnwu/magisk/utils/Utils.java
+24
-440
build.gradle
build.gradle
+1
-1
No files found.
app/build.gradle
View file @
baae3592
...
...
@@ -32,10 +32,11 @@ repositories {
dependencies
{
compile
fileTree
(
include:
[
'*.jar'
],
dir:
'libs'
)
compile
'com.android.support:recyclerview-v7:24.2.
0
'
compile
'com.android.support:cardview-v7:24.2.
0
'
compile
'com.android.support:design:24.2.
0
'
compile
'com.android.support:recyclerview-v7:24.2.
1
'
compile
'com.android.support:cardview-v7:24.2.
1
'
compile
'com.android.support:design:24.2.
1
'
compile
'com.jakewharton:butterknife:8.4.0'
compile
'com.github.michalis-vitos:aFileChooser:master'
compile
'com.google.code.gson:gson:2.7'
annotationProcessor
'com.jakewharton:butterknife-compiler:8.4.0'
}
app/src/main/java/com/topjohnwu/magisk/MagiskFragment.java
View file @
baae3592
...
...
@@ -7,7 +7,6 @@ import android.support.annotation.Nullable;
import
android.support.v4.app.Fragment
;
import
android.support.v4.content.FileProvider
;
import
android.support.v7.app.AlertDialog
;
import
android.text.Html
;
import
android.view.LayoutInflater
;
import
android.view.View
;
import
android.view.ViewGroup
;
...
...
@@ -15,6 +14,7 @@ import android.widget.ImageView;
import
android.widget.ProgressBar
;
import
android.widget.TextView
;
import
com.topjohnwu.magisk.utils.Async
;
import
com.topjohnwu.magisk.utils.Utils
;
import
java.io.File
;
...
...
@@ -112,7 +112,7 @@ public class MagiskFragment extends Fragment {
new
Utils
.
DownloadReceiver
(
getString
(
R
.
string
.
magisk
))
{
@Override
public
void
task
(
File
file
)
{
new
Utils
.
FlashZIP
(
mContext
,
mName
,
file
.
getPath
()).
execute
();
new
Async
.
FlashZIP
(
mContext
,
mName
,
file
.
getPath
()).
execute
();
}
},
Utils
.
magiskLink
,
"latest_magisk.zip"
);
...
...
app/src/main/java/com/topjohnwu/magisk/ModulesAdapter.java
View file @
baae3592
...
...
@@ -21,6 +21,7 @@ import android.widget.LinearLayout;
import
android.widget.TextView
;
import
com.topjohnwu.magisk.module.Module
;
import
com.topjohnwu.magisk.utils.Async
;
import
com.topjohnwu.magisk.utils.Shell
;
import
com.topjohnwu.magisk.utils.Utils
;
import
com.topjohnwu.magisk.utils.WebWindow
;
...
...
@@ -109,7 +110,7 @@ public class ModulesAdapter extends RecyclerView.Adapter<ModulesAdapter.ViewHold
@Override
public
void
task
(
File
file
)
{
Log
.
d
(
"Magisk"
,
"Task firing"
);
new
Utils
.
FlashZIP
(
context
,
mModule
.
getId
(),
file
.
toString
()).
execute
();
new
Async
.
FlashZIP
(
context
,
mModule
.
getId
(),
file
.
toString
()).
execute
();
}
};
String
filename
=
mModule
.
getId
().
replace
(
" "
,
""
)
+
".zip"
;
...
...
app/src/main/java/com/topjohnwu/magisk/ModulesFragment.java
View file @
baae3592
...
...
@@ -16,7 +16,7 @@ import android.widget.CheckBox;
import
android.widget.TextView
;
import
com.topjohnwu.magisk.module.Module
;
import
com.topjohnwu.magisk.utils.
Utils
;
import
com.topjohnwu.magisk.utils.
Async
;
import
java.util.ArrayList
;
import
java.util.List
;
...
...
@@ -44,7 +44,7 @@ public class ModulesFragment extends Fragment {
mSwipeRefreshLayout
.
setOnRefreshListener
(()
->
{
recyclerView
.
setVisibility
(
View
.
GONE
);
new
Utils
.
LoadModules
(
getActivity
()).
execute
();
new
Async
.
LoadModules
(
getActivity
()).
execute
();
new
updateUI
().
execute
();
prefs
.
edit
().
putBoolean
(
"ignoreUpdateAlerts"
,
false
).
apply
();
...
...
app/src/main/java/com/topjohnwu/magisk/QuickSettingTileService.java
View file @
baae3592
...
...
@@ -32,7 +32,7 @@ public class QuickSettingTileService extends TileService {
Icon
iconAuto
=
Icon
.
createWithResource
(
getApplicationContext
(),
R
.
drawable
.
ic_autoroot
);
Tile
tile
=
this
.
getQsTile
();
boolean
autoRootStatus
=
Utils
.
autoRootEnabled
(
getApplicationContext
());
boolean
rootStatus
=
Utils
.
root
Status
();
boolean
rootStatus
=
Utils
.
root
Enabled
();
Log
.
d
(
"Magisk"
,
"QST: Auto and root are "
+
autoRootStatus
+
" and "
+
rootStatus
);
if
(
autoRootStatus
)
{
tile
.
setLabel
(
"Auto-root"
);
...
...
app/src/main/java/com/topjohnwu/magisk/ReposAdapter.java
View file @
baae3592
...
...
@@ -21,6 +21,7 @@ import android.widget.TextView;
import
android.widget.Toast
;
import
com.topjohnwu.magisk.module.Repo
;
import
com.topjohnwu.magisk.utils.Async
;
import
com.topjohnwu.magisk.utils.Utils
;
import
com.topjohnwu.magisk.utils.WebWindow
;
...
...
@@ -150,7 +151,7 @@ public class ReposAdapter extends RecyclerView.Adapter<ReposAdapter.ViewHolder>
@Override
public
void
task
(
File
file
)
{
Log
.
d
(
"Magisk"
,
"Task firing"
);
new
Utils
.
FlashZIP
(
context
,
repo
.
getId
(),
file
.
toString
()).
execute
();
new
Async
.
FlashZIP
(
context
,
repo
.
getId
(),
file
.
toString
()).
execute
();
}
};
String
filename
=
repo
.
getId
().
replace
(
" "
,
""
)
+
".zip"
;
...
...
app/src/main/java/com/topjohnwu/magisk/ReposFragment.java
View file @
baae3592
...
...
@@ -17,6 +17,7 @@ import android.widget.TextView;
import
com.topjohnwu.magisk.module.Repo
;
import
com.topjohnwu.magisk.module.RepoHelper
;
import
com.topjohnwu.magisk.utils.Async
;
import
com.topjohnwu.magisk.utils.Utils
;
import
java.io.File
;
...
...
@@ -133,7 +134,7 @@ public class ReposFragment extends Fragment {
@Override
public
void
task
(
File
file
)
{
Log
.
d
(
"Magisk"
,
"Task firing"
);
new
Utils
.
FlashZIP
(
getActivity
(),
repo
.
getId
(),
file
.
toString
()).
execute
();
new
Async
.
FlashZIP
(
getActivity
(),
repo
.
getId
(),
file
.
toString
()).
execute
();
}
};
String
filename
=
repo
.
getId
().
replace
(
" "
,
""
)
+
".zip"
;
...
...
app/src/main/java/com/topjohnwu/magisk/WelcomeActivity.java
View file @
baae3592
...
...
@@ -24,6 +24,7 @@ import android.view.MenuItem;
import
android.view.View
;
import
com.topjohnwu.magisk.module.RepoHelper
;
import
com.topjohnwu.magisk.utils.Async
;
import
com.topjohnwu.magisk.utils.Utils
;
import
butterknife.BindView
;
...
...
@@ -72,16 +73,16 @@ public class WelcomeActivity extends AppCompatActivity implements NavigationView
}
new
Utils
.
Initialize
(
this
).
execute
(
);
new
Utils
.
CheckUpdates
(
this
).
execute
();
Utils
.
init
(
this
);
new
Async
.
CheckUpdates
(
this
).
execute
();
RepoHelper
.
TaskDelegate
delegate
=
result
->
{
//Do a thing here when we get a result we want
};
new
Utils
.
LoadModules
(
this
).
execute
();
new
Utils
.
LoadRepos
(
this
,
true
,
delegate
).
execute
();
new
Utils
.
LoadRepos
(
this
,
!
prefs
.
contains
(
"hasCachedRepos"
),
delegate
).
executeOnExecutor
(
AsyncTask
.
THREAD_POOL_EXECUTOR
);
new
Utils
.
LoadModules
(
getApplication
()).
execute
();
new
Utils
.
LoadRepos
(
this
,
false
,
delegate
).
execute
();
new
Async
.
LoadModules
(
this
).
execute
();
new
Async
.
LoadRepos
(
this
,
true
,
delegate
).
execute
();
new
Async
.
LoadRepos
(
this
,
!
prefs
.
contains
(
"hasCachedRepos"
),
delegate
).
executeOnExecutor
(
AsyncTask
.
THREAD_POOL_EXECUTOR
);
new
Async
.
LoadModules
(
getApplication
()).
execute
();
new
Async
.
LoadRepos
(
this
,
false
,
delegate
).
execute
();
setSupportActionBar
(
toolbar
);
...
...
app/src/main/java/com/topjohnwu/magisk/utils/Async.java
0 → 100644
View file @
baae3592
This diff is collapsed.
Click to expand it.
app/src/main/java/com/topjohnwu/magisk/utils/Utils.java
View file @
baae3592
This diff is collapsed.
Click to expand it.
build.gradle
View file @
baae3592
...
...
@@ -6,7 +6,7 @@ buildscript {
mavenCentral
()
}
dependencies
{
classpath
'com.android.tools.build:gradle:2.2.0
-rc1
'
classpath
'com.android.tools.build:gradle:2.2.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
...
...
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