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
3de13a4d
Commit
3de13a4d
authored
Sep 23, 2016
by
d8ahazard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refactor, cleanup, backstack works
parent
3706b53e
Hide whitespace changes
Inline
Side-by-side
Showing
25 changed files
with
242 additions
and
138 deletions
+242
-138
build.gradle
app/build.gradle
+3
-3
AboutActivity.java
app/src/main/java/com/topjohnwu/magisk/AboutActivity.java
+5
-0
AutoRootFragment.java
app/src/main/java/com/topjohnwu/magisk/AutoRootFragment.java
+17
-10
LogFragment.java
app/src/main/java/com/topjohnwu/magisk/LogFragment.java
+6
-0
MagiskFragment.java
app/src/main/java/com/topjohnwu/magisk/MagiskFragment.java
+6
-0
ModulesFragment.java
app/src/main/java/com/topjohnwu/magisk/ModulesFragment.java
+19
-1
ReposFragment.java
app/src/main/java/com/topjohnwu/magisk/ReposFragment.java
+8
-11
RootFragment.java
app/src/main/java/com/topjohnwu/magisk/RootFragment.java
+7
-7
SettingsFragment.java
app/src/main/java/com/topjohnwu/magisk/SettingsFragment.java
+11
-8
WelcomeActivity.java
app/src/main/java/com/topjohnwu/magisk/WelcomeActivity.java
+36
-13
PrivateBroadcastReceiver.java
.../topjohnwu/magisk/receivers/PrivateBroadcastReceiver.java
+1
-1
MonitorService.java
...in/java/com/topjohnwu/magisk/services/MonitorService.java
+3
-5
TileServiceCompat.java
...java/com/topjohnwu/magisk/services/TileServiceCompat.java
+3
-7
TileServiceNewApi.java
...java/com/topjohnwu/magisk/services/TileServiceNewApi.java
+2
-2
ApplicationAdapter.java
...n/java/com/topjohnwu/magisk/utils/ApplicationAdapter.java
+2
-2
Utils.java
app/src/main/java/com/topjohnwu/magisk/utils/Utils.java
+4
-4
auto_root_fragment.xml
app/src/main/res/layout/auto_root_fragment.xml
+2
-2
list_item_app.xml
app/src/main/res/layout/list_item_app.xml
+11
-11
list_item_module.xml
app/src/main/res/layout/list_item_module.xml
+19
-18
list_item_repo.xml
app/src/main/res/layout/list_item_repo.xml
+18
-15
modules_fragment.xml
app/src/main/res/layout/modules_fragment.xml
+44
-17
repos_fragment.xml
app/src/main/res/layout/repos_fragment.xml
+1
-0
drawer.xml
app/src/main/res/menu/drawer.xml
+1
-1
dimens.xml
app/src/main/res/values/dimens.xml
+10
-0
strings.xml
app/src/main/res/values/strings.xml
+3
-0
No files found.
app/build.gradle
View file @
3de13a4d
...
@@ -32,9 +32,9 @@ repositories {
...
@@ -32,9 +32,9 @@ repositories {
dependencies
{
dependencies
{
compile
fileTree
(
include:
[
'*.jar'
],
dir:
'libs'
)
compile
fileTree
(
include:
[
'*.jar'
],
dir:
'libs'
)
compile
'com.android.support:recyclerview-v7:24.2.
0
'
compile
'com.android.support:recyclerview-v7:24.2.
1
'
compile
'com.android.support:cardview-v7:24.2.
0
'
compile
'com.android.support:cardview-v7:24.2.
1
'
compile
'com.android.support:design:24.2.
0
'
compile
'com.android.support:design:24.2.
1
'
compile
'com.github.d8ahazard:BroadcastTileSupportUpdate:master'
compile
'com.github.d8ahazard:BroadcastTileSupportUpdate:master'
compile
'com.jakewharton:butterknife:8.4.0'
compile
'com.jakewharton:butterknife:8.4.0'
compile
'com.github.michalis-vitos:aFileChooser:master'
compile
'com.github.michalis-vitos:aFileChooser:master'
...
...
app/src/main/java/com/topjohnwu/magisk/AboutActivity.java
View file @
3de13a4d
...
@@ -119,6 +119,8 @@ public class AboutActivity extends AppCompatActivity {
...
@@ -119,6 +119,8 @@ public class AboutActivity extends AppCompatActivity {
setFloating
();
setFloating
();
}
}
public
void
setFloating
()
{
public
void
setFloating
()
{
boolean
isTablet
=
getResources
().
getBoolean
(
R
.
bool
.
isTablet
);
boolean
isTablet
=
getResources
().
getBoolean
(
R
.
bool
.
isTablet
);
if
(
isTablet
)
{
if
(
isTablet
)
{
...
@@ -137,6 +139,9 @@ public class AboutActivity extends AppCompatActivity {
...
@@ -137,6 +139,9 @@ public class AboutActivity extends AppCompatActivity {
protected
void
onResume
()
{
protected
void
onResume
()
{
super
.
onResume
();
super
.
onResume
();
setTitle
(
"About"
);
getWindow
().
setStatusBarColor
(
getResources
().
getColor
(
R
.
color
.
primary_dark
));
getWindow
().
setStatusBarColor
(
getResources
().
getColor
(
R
.
color
.
primary_dark
));
}
}
}
}
app/src/main/java/com/topjohnwu/magisk/AutoRootFragment.java
View file @
3de13a4d
...
@@ -10,7 +10,6 @@ import android.os.Bundle;
...
@@ -10,7 +10,6 @@ import android.os.Bundle;
import
android.preference.PreferenceManager
;
import
android.preference.PreferenceManager
;
import
android.support.annotation.Nullable
;
import
android.support.annotation.Nullable
;
import
android.util.Log
;
import
android.util.TypedValue
;
import
android.util.TypedValue
;
import
android.view.LayoutInflater
;
import
android.view.LayoutInflater
;
import
android.view.View
;
import
android.view.View
;
...
@@ -47,12 +46,28 @@ public class AutoRootFragment extends ListFragment {
...
@@ -47,12 +46,28 @@ public class AutoRootFragment extends ListFragment {
}
}
view
.
setPadding
(
horizontalMargin
,
actionBarHeight
,
horizontalMargin
,
verticalMargin
);
view
.
setPadding
(
horizontalMargin
,
actionBarHeight
,
horizontalMargin
,
verticalMargin
);
return
view
;
return
view
;
}
}
@Override
@Override
public
void
onActivityCreated
(
@Nullable
Bundle
savedInstanceState
)
{
public
void
onActivityCreated
(
@Nullable
Bundle
savedInstanceState
)
{
super
.
onActivityCreated
(
savedInstanceState
);
super
.
onActivityCreated
(
savedInstanceState
);
}
@Override
public
void
onResume
()
{
super
.
onResume
();
initializeElements
();
super
.
onResume
();
getActivity
().
setTitle
(
"Auto-toggle"
);
}
private
void
initializeElements
()
{
listView
=
getListView
();
listView
=
getListView
();
packageManager
=
getActivity
().
getPackageManager
();
packageManager
=
getActivity
().
getPackageManager
();
prefs
=
PreferenceManager
.
getDefaultSharedPreferences
(
getActivity
());
prefs
=
PreferenceManager
.
getDefaultSharedPreferences
(
getActivity
());
...
@@ -68,13 +83,6 @@ public class AutoRootFragment extends ListFragment {
...
@@ -68,13 +83,6 @@ public class AutoRootFragment extends ListFragment {
new
LoadApplications
().
execute
();
new
LoadApplications
().
execute
();
}
}
@Override
public
void
onResume
()
{
super
.
onResume
();
new
LoadApplications
().
execute
();
}
@Override
@Override
public
void
onListItemClick
(
ListView
l
,
View
v
,
int
position
,
long
id
)
{
public
void
onListItemClick
(
ListView
l
,
View
v
,
int
position
,
long
id
)
{
Logger
.
dh
(
"Click"
);
Logger
.
dh
(
"Click"
);
...
@@ -128,7 +136,6 @@ public class AutoRootFragment extends ListFragment {
...
@@ -128,7 +136,6 @@ public class AutoRootFragment extends ListFragment {
public
class
CustomComparator
implements
Comparator
<
ApplicationInfo
>
{
public
class
CustomComparator
implements
Comparator
<
ApplicationInfo
>
{
@Override
@Override
public
int
compare
(
ApplicationInfo
o1
,
ApplicationInfo
o2
)
{
public
int
compare
(
ApplicationInfo
o1
,
ApplicationInfo
o2
)
{
packageManager
=
getActivity
().
getPackageManager
();
return
o1
.
loadLabel
(
packageManager
).
toString
().
compareToIgnoreCase
(
o2
.
loadLabel
(
packageManager
).
toString
());
return
o1
.
loadLabel
(
packageManager
).
toString
().
compareToIgnoreCase
(
o2
.
loadLabel
(
packageManager
).
toString
());
}
}
}
}
...
@@ -140,7 +147,7 @@ public class AutoRootFragment extends ListFragment {
...
@@ -140,7 +147,7 @@ public class AutoRootFragment extends ListFragment {
protected
Void
doInBackground
(
Void
...
params
)
{
protected
Void
doInBackground
(
Void
...
params
)
{
applist
=
checkForLaunchIntent
(
packageManager
.
getInstalledApplications
(
PackageManager
.
GET_META_DATA
));
applist
=
checkForLaunchIntent
(
packageManager
.
getInstalledApplications
(
PackageManager
.
GET_META_DATA
));
listadaptor
=
new
ApplicationAdapter
(
getActivity
(),
listadaptor
=
new
ApplicationAdapter
(
getActivity
(),
R
.
layout
.
app_list_row
,
applist
);
R
.
layout
.
list_item_app
,
applist
);
return
null
;
return
null
;
}
}
...
...
app/src/main/java/com/topjohnwu/magisk/LogFragment.java
View file @
3de13a4d
...
@@ -56,6 +56,12 @@ public class LogFragment extends Fragment {
...
@@ -56,6 +56,12 @@ public class LogFragment extends Fragment {
setHasOptionsMenu
(
true
);
setHasOptionsMenu
(
true
);
}
}
@Override
public
void
onResume
()
{
super
.
onResume
();
getActivity
().
setTitle
(
"Log"
);
}
@Override
@Override
public
View
onCreateView
(
LayoutInflater
inflater
,
ViewGroup
container
,
Bundle
savedInstanceState
)
{
public
View
onCreateView
(
LayoutInflater
inflater
,
ViewGroup
container
,
Bundle
savedInstanceState
)
{
View
view
=
inflater
.
inflate
(
R
.
layout
.
log_fragment
,
container
,
false
);
View
view
=
inflater
.
inflate
(
R
.
layout
.
log_fragment
,
container
,
false
);
...
...
app/src/main/java/com/topjohnwu/magisk/MagiskFragment.java
View file @
3de13a4d
...
@@ -64,6 +64,12 @@ public class MagiskFragment extends Fragment {
...
@@ -64,6 +64,12 @@ public class MagiskFragment extends Fragment {
return
v
;
return
v
;
}
}
@Override
public
void
onResume
()
{
super
.
onResume
();
getActivity
().
setTitle
(
"Magisk"
);
}
private
class
updateUI
extends
AsyncTask
<
Void
,
Void
,
Void
>
{
private
class
updateUI
extends
AsyncTask
<
Void
,
Void
,
Void
>
{
@Override
@Override
...
...
app/src/main/java/com/topjohnwu/magisk/ModulesFragment.java
View file @
3de13a4d
package
com
.
topjohnwu
.
magisk
;
package
com
.
topjohnwu
.
magisk
;
import
android.app.Fragment
;
import
android.app.Fragment
;
import
android.content.Intent
;
import
android.content.SharedPreferences
;
import
android.content.SharedPreferences
;
import
android.os.AsyncTask
;
import
android.os.AsyncTask
;
import
android.os.Bundle
;
import
android.os.Bundle
;
import
android.preference.PreferenceManager
;
import
android.preference.PreferenceManager
;
import
android.support.annotation.Nullable
;
import
android.support.annotation.Nullable
;
import
android.support.design.widget.FloatingActionButton
;
import
android.support.design.widget.Snackbar
;
import
android.support.design.widget.Snackbar
;
import
android.support.v4.widget.SwipeRefreshLayout
;
import
android.support.v4.widget.SwipeRefreshLayout
;
...
@@ -16,6 +18,7 @@ import android.view.ViewGroup;
...
@@ -16,6 +18,7 @@ import android.view.ViewGroup;
import
android.widget.CheckBox
;
import
android.widget.CheckBox
;
import
android.widget.TextView
;
import
android.widget.TextView
;
import
com.ipaulpro.afilechooser.utils.FileUtils
;
import
com.topjohnwu.magisk.module.Module
;
import
com.topjohnwu.magisk.module.Module
;
import
com.topjohnwu.magisk.utils.Async
;
import
com.topjohnwu.magisk.utils.Async
;
...
@@ -29,9 +32,11 @@ public class ModulesFragment extends Fragment {
...
@@ -29,9 +32,11 @@ public class ModulesFragment extends Fragment {
@BindView
(
R
.
id
.
swipeRefreshLayout
)
SwipeRefreshLayout
mSwipeRefreshLayout
;
@BindView
(
R
.
id
.
swipeRefreshLayout
)
SwipeRefreshLayout
mSwipeRefreshLayout
;
@BindView
(
R
.
id
.
recyclerView
)
RecyclerView
recyclerView
;
@BindView
(
R
.
id
.
recyclerView
)
RecyclerView
recyclerView
;
@BindView
(
R
.
id
.
empty_rv
)
TextView
emptyTv
;
@BindView
(
R
.
id
.
empty_rv
)
TextView
emptyTv
;
private
static
final
int
FETCH_ZIP_CODE
=
2
;
private
SharedPreferences
prefs
;
private
SharedPreferences
prefs
;
public
static
List
<
Module
>
listModules
=
new
ArrayList
<>();
public
static
List
<
Module
>
listModules
=
new
ArrayList
<>();
@BindView
(
R
.
id
.
fab
)
FloatingActionButton
fabio
;
@Nullable
@Nullable
@Override
@Override
...
@@ -40,7 +45,14 @@ public class ModulesFragment extends Fragment {
...
@@ -40,7 +45,14 @@ public class ModulesFragment extends Fragment {
ButterKnife
.
bind
(
this
,
viewMain
);
ButterKnife
.
bind
(
this
,
viewMain
);
fabio
.
setOnClickListener
(
v
->
{
Intent
getContentIntent
=
FileUtils
.
createGetContentIntent
(
null
);
getContentIntent
.
setType
(
"application/zip"
);
Intent
fileIntent
=
Intent
.
createChooser
(
getContentIntent
,
"Select a file"
);
startActivityForResult
(
fileIntent
,
FETCH_ZIP_CODE
);
});
prefs
=
PreferenceManager
.
getDefaultSharedPreferences
(
getActivity
());
prefs
=
PreferenceManager
.
getDefaultSharedPreferences
(
getActivity
());
mSwipeRefreshLayout
.
setOnRefreshListener
(()
->
{
mSwipeRefreshLayout
.
setOnRefreshListener
(()
->
{
...
@@ -64,6 +76,12 @@ public class ModulesFragment extends Fragment {
...
@@ -64,6 +76,12 @@ public class ModulesFragment extends Fragment {
return
viewMain
;
return
viewMain
;
}
}
@Override
public
void
onResume
()
{
super
.
onResume
();
getActivity
().
setTitle
(
"Modules"
);
}
private
class
updateUI
extends
AsyncTask
<
Void
,
Void
,
Void
>
{
private
class
updateUI
extends
AsyncTask
<
Void
,
Void
,
Void
>
{
@Override
@Override
...
...
app/src/main/java/com/topjohnwu/magisk/ReposFragment.java
View file @
3de13a4d
package
com
.
topjohnwu
.
magisk
;
package
com
.
topjohnwu
.
magisk
;
import
android.app.Fragment
;
import
android.content.DialogInterface
;
import
android.content.DialogInterface
;
import
android.content.SharedPreferences
;
import
android.content.SharedPreferences
;
import
android.os.Bundle
;
import
android.os.Bundle
;
import
android.preference.PreferenceManager
;
import
android.preference.PreferenceManager
;
import
android.support.annotation.Nullable
;
import
android.support.annotation.Nullable
;
import
android.app.Fragment
;
import
android.support.v4.widget.SwipeRefreshLayout
;
import
android.support.v4.widget.SwipeRefreshLayout
;
import
android.support.v7.app.AlertDialog
;
import
android.support.v7.app.AlertDialog
;
import
android.support.v7.widget.RecyclerView
;
import
android.support.v7.widget.RecyclerView
;
...
@@ -59,7 +59,7 @@ public class ReposFragment extends Fragment {
...
@@ -59,7 +59,7 @@ public class ReposFragment extends Fragment {
swipeRefreshLayout
.
setOnRefreshListener
(()
->
{
swipeRefreshLayout
.
setOnRefreshListener
(()
->
{
this
.
LoadRepo
(
true
);
this
.
LoadRepo
(
true
);
ignoreAlertUpdate
=
false
;
ignoreAlertUpdate
=
false
;
prefs
.
edit
().
putBoolean
(
"ignoreUpdateAlerts"
,
false
).
apply
();
prefs
.
edit
().
putBoolean
(
"ignoreUpdateAlerts"
,
false
).
apply
();
});
});
LoadRepo
(
false
);
LoadRepo
(
false
);
...
@@ -76,6 +76,7 @@ public class ReposFragment extends Fragment {
...
@@ -76,6 +76,7 @@ public class ReposFragment extends Fragment {
return
view
;
return
view
;
}
}
@Override
@Override
public
void
onStart
()
{
public
void
onStart
()
{
super
.
onStart
();
super
.
onStart
();
...
@@ -98,7 +99,7 @@ public class ReposFragment extends Fragment {
...
@@ -98,7 +99,7 @@ public class ReposFragment extends Fragment {
super
.
onAttachFragment
(
childFragment
);
super
.
onAttachFragment
(
childFragment
);
}
}
private
void
LoadRepo
(
boolean
doReload
)
{
private
void
LoadRepo
(
boolean
doReload
)
{
RepoHelper
.
TaskDelegate
taskDelegate
=
result
->
{
RepoHelper
.
TaskDelegate
taskDelegate
=
result
->
{
if
(
result
.
equals
(
"Complete"
))
{
if
(
result
.
equals
(
"Complete"
))
{
Log
.
d
(
"Magisk"
,
"ReposFragment, got delegate"
);
Log
.
d
(
"Magisk"
,
"ReposFragment, got delegate"
);
...
@@ -111,7 +112,7 @@ public class ReposFragment extends Fragment {
...
@@ -111,7 +112,7 @@ public class ReposFragment extends Fragment {
}
}
};
};
Log
.
d
(
"Magisk"
,
"ReposFragment, LoadRepo called"
);
Log
.
d
(
"Magisk"
,
"ReposFragment, LoadRepo called"
);
new
Async
.
LoadRepos
(
getActivity
());
new
Async
.
LoadRepos
(
getActivity
());
}
}
...
@@ -158,9 +159,10 @@ public class ReposFragment extends Fragment {
...
@@ -158,9 +159,10 @@ public class ReposFragment extends Fragment {
public
void
onResume
()
{
public
void
onResume
()
{
super
.
onResume
();
super
.
onResume
();
LoadRepo
(
false
);
LoadRepo
(
false
);
getActivity
().
setTitle
(
"Magisk"
);
}
}
protected
List
<
Repo
>
listRepos
()
{
protected
List
<
Repo
>
listRepos
()
{
...
@@ -168,7 +170,7 @@ public class ReposFragment extends Fragment {
...
@@ -168,7 +170,7 @@ public class ReposFragment extends Fragment {
}
}
private
void
UpdateUI
()
{
private
void
UpdateUI
()
{
Log
.
d
(
"Magisk"
,
"ReposFragment: UpdateUI Called, size is "
+
listRepos
().
size
());
Log
.
d
(
"Magisk"
,
"ReposFragment: UpdateUI Called, size is "
+
listRepos
().
size
());
if
(
listRepos
().
size
()
==
0
)
{
if
(
listRepos
().
size
()
==
0
)
{
emptyTv
.
setVisibility
(
View
.
VISIBLE
);
emptyTv
.
setVisibility
(
View
.
VISIBLE
);
...
@@ -187,9 +189,4 @@ public class ReposFragment extends Fragment {
...
@@ -187,9 +189,4 @@ public class ReposFragment extends Fragment {
}
}
}
}
app/src/main/java/com/topjohnwu/magisk/RootFragment.java
View file @
3de13a4d
...
@@ -95,7 +95,7 @@ public class RootFragment extends Fragment implements Receiver {
...
@@ -95,7 +95,7 @@ public class RootFragment extends Fragment implements Receiver {
view
=
inflater
.
inflate
(
R
.
layout
.
root_fragment
,
container
,
false
);
view
=
inflater
.
inflate
(
R
.
layout
.
root_fragment
,
container
,
false
);
ButterKnife
.
bind
(
this
,
view
);
ButterKnife
.
bind
(
this
,
view
);
prefs
=
PreferenceManager
.
getDefaultSharedPreferences
(
getActivity
());
prefs
=
PreferenceManager
.
getDefaultSharedPreferences
(
getActivity
());
autoRootStatus
=
prefs
.
getBoolean
(
"autoRootEnable"
,
false
);
autoRootStatus
=
Utils
.
autoToggleEnabled
(
getActivity
()
);
if
(
autoRootStatus
)
{
if
(
autoRootStatus
)
{
if
(!
Utils
.
hasServicePermission
(
getActivity
()))
{
if
(!
Utils
.
hasServicePermission
(
getActivity
()))
{
...
@@ -114,7 +114,7 @@ public class RootFragment extends Fragment implements Receiver {
...
@@ -114,7 +114,7 @@ public class RootFragment extends Fragment implements Receiver {
autoRootToggle
.
setOnClickListener
(
toggle
->
{
autoRootToggle
.
setOnClickListener
(
toggle
->
{
if
(!
Utils
.
hasServicePermission
(
getActivity
()))
{
if
(!
Utils
.
hasServicePermission
(
getActivity
()))
{
Intent
intent
=
new
Intent
(
android
.
provider
.
Settings
.
ACTION_ACCESSIBILITY_SETTINGS
);
Intent
intent
=
new
Intent
(
android
.
provider
.
Settings
.
ACTION_ACCESSIBILITY_SETTINGS
);
Toast
.
makeText
(
getActivity
(),
"Please enable accessibility access for Magisk's auto-toggle feature to work."
,
Toast
.
LENGTH_LONG
).
show
();
Toast
.
makeText
(
getActivity
(),
"Please enable accessibility access for Magisk's auto-toggle feature to work."
,
Toast
.
LENGTH_LONG
).
show
();
startActivityForResult
(
intent
,
100
);
startActivityForResult
(
intent
,
100
);
}
else
{
}
else
{
ToggleAutoRoot
(
autoRootToggle
.
isChecked
());
ToggleAutoRoot
(
autoRootToggle
.
isChecked
());
...
@@ -155,7 +155,7 @@ public class RootFragment extends Fragment implements Receiver {
...
@@ -155,7 +155,7 @@ public class RootFragment extends Fragment implements Receiver {
ToggleAutoRoot
(
true
);
ToggleAutoRoot
(
true
);
}
else
{
}
else
{
autoRootToggle
.
setChecked
(
false
);
autoRootToggle
.
setChecked
(
false
);
Snackbar
.
make
(
view
,
"Auto-root
disabled, permissions required."
,
Snackbar
.
LENGTH_LONG
).
show
();
Snackbar
.
make
(
view
,
getActivity
().
getString
(
R
.
string
.
auto_toggle
)
+
"
disabled, permissions required."
,
Snackbar
.
LENGTH_LONG
).
show
();
}
}
}
else
if
(
requestCode
==
420
)
{
}
else
if
(
requestCode
==
420
)
{
...
@@ -166,9 +166,7 @@ public class RootFragment extends Fragment implements Receiver {
...
@@ -166,9 +166,7 @@ public class RootFragment extends Fragment implements Receiver {
private
void
ToggleAutoRoot
(
boolean
toggleState
)
{
private
void
ToggleAutoRoot
(
boolean
toggleState
)
{
autoRootStatus
=
toggleState
;
autoRootStatus
=
toggleState
;
SharedPreferences
.
Editor
editor
=
prefs
.
edit
();
Utils
.
toggleAutoRoot
(
toggleState
,
getActivity
());
editor
.
putBoolean
(
"autoRootEnable"
,
(
toggleState
));
editor
.
apply
();
if
(
toggleState
)
{
if
(
toggleState
)
{
Intent
myIntent
=
new
Intent
(
getActivity
(),
MonitorService
.
class
);
Intent
myIntent
=
new
Intent
(
getActivity
(),
MonitorService
.
class
);
getActivity
().
startService
(
myIntent
);
getActivity
().
startService
(
myIntent
);
...
@@ -191,6 +189,8 @@ public class RootFragment extends Fragment implements Receiver {
...
@@ -191,6 +189,8 @@ public class RootFragment extends Fragment implements Receiver {
@Override
@Override
public
void
onResume
()
{
public
void
onResume
()
{
super
.
onResume
();
super
.
onResume
();
getActivity
().
setTitle
(
"Root"
);
new
updateUI
().
execute
();
new
updateUI
().
execute
();
}
}
...
@@ -206,7 +206,7 @@ public class RootFragment extends Fragment implements Receiver {
...
@@ -206,7 +206,7 @@ public class RootFragment extends Fragment implements Receiver {
// Make sure static block invoked
// Make sure static block invoked
Shell
.
rootAccess
();
Shell
.
rootAccess
();
// Set up Tile on UI Refresh
// Set up Tile on UI Refresh
if
(
PrefHelper
.
CheckBool
(
"enable_quicktile"
,
getActivity
()))
{
if
(
PrefHelper
.
CheckBool
(
"enable_quicktile"
,
getActivity
()))
{
Utils
.
SetupQuickSettingsTile
(
getActivity
());
Utils
.
SetupQuickSettingsTile
(
getActivity
());
}
}
return
null
;
return
null
;
...
...
app/src/main/java/com/topjohnwu/magisk/SettingsFragment.java
View file @
3de13a4d
package
com
.
topjohnwu
.
magisk
;
package
com
.
topjohnwu
.
magisk
;
import
android.content.SharedPreferences
;
import
android.os.Bundle
;
import
android.os.Bundle
;
import
android.preference.CheckBoxPreference
;
import
android.preference.CheckBoxPreference
;
import
android.preference.Preference
;
import
android.preference.Preference
;
import
android.preference.PreferenceFragment
;
import
android.preference.PreferenceFragment
;
import
android.preference.PreferenceManager
;
import
android.util.TypedValue
;
import
android.util.TypedValue
;
import
android.view.LayoutInflater
;
import
android.view.LayoutInflater
;
import
android.view.View
;
import
android.view.View
;
import
android.view.ViewGroup
;
import
android.view.ViewGroup
;
import
android.widget.Toast
;
import
com.topjohnwu.magisk.utils.Utils
;
import
com.topjohnwu.magisk.utils.Utils
;
...
@@ -33,6 +30,12 @@ public class SettingsFragment extends PreferenceFragment {
...
@@ -33,6 +30,12 @@ public class SettingsFragment extends PreferenceFragment {
addPreferencesFromResource
(
R
.
xml
.
uisettings
);
addPreferencesFromResource
(
R
.
xml
.
uisettings
);
}
}
@Override
public
void
onResume
()
{
super
.
onResume
();
getActivity
().
setTitle
(
"Settings"
);
}
@Override
@Override
public
View
onCreateView
(
LayoutInflater
inflater
,
ViewGroup
container
,
Bundle
savedInstanceState
)
{
public
View
onCreateView
(
LayoutInflater
inflater
,
ViewGroup
container
,
Bundle
savedInstanceState
)
{
View
view
=
super
.
onCreateView
(
inflater
,
container
,
savedInstanceState
);
View
view
=
super
.
onCreateView
(
inflater
,
container
,
savedInstanceState
);
...
@@ -55,11 +58,11 @@ public class SettingsFragment extends PreferenceFragment {
...
@@ -55,11 +58,11 @@ public class SettingsFragment extends PreferenceFragment {
Preference
.
OnPreferenceClickListener
preferenceClickListener
=
preference
->
{
Preference
.
OnPreferenceClickListener
preferenceClickListener
=
preference
->
{
if
(
preference
==
quickTilePreference
)
{
if
(
preference
==
quickTilePreference
)
{
boolean
isChecked
=
quickTilePreference
.
isChecked
();
boolean
isChecked
=
quickTilePreference
.
isChecked
();
if
(
isChecked
)
{
if
(
isChecked
)
{
Utils
.
installTile
(
getActivity
());
Utils
.
installTile
(
getActivity
());
}
else
{
}
else
{
Utils
.
uninstallTile
(
getActivity
());
Utils
.
uninstallTile
(
getActivity
());
}
}
}
}
if
(
preference
==
devLogPreference
)
{
if
(
preference
==
devLogPreference
)
{
...
...
app/src/main/java/com/topjohnwu/magisk/WelcomeActivity.java
View file @
3de13a4d
...
@@ -2,6 +2,8 @@ package com.topjohnwu.magisk;
...
@@ -2,6 +2,8 @@ package com.topjohnwu.magisk;
import
android.Manifest
;
import
android.Manifest
;
import
android.app.Fragment
;
import
android.app.Fragment
;
import
android.app.FragmentManager
;
import
android.app.FragmentTransaction
;
import
android.content.Intent
;
import
android.content.Intent
;
import
android.content.SharedPreferences
;
import
android.content.SharedPreferences
;
import
android.content.pm.PackageManager
;
import
android.content.pm.PackageManager
;
...
@@ -13,9 +15,7 @@ import android.preference.PreferenceManager;
...
@@ -13,9 +15,7 @@ import android.preference.PreferenceManager;
import
android.support.annotation.IdRes
;
import
android.support.annotation.IdRes
;
import
android.support.annotation.NonNull
;
import
android.support.annotation.NonNull
;
import
android.support.design.widget.NavigationView
;
import
android.support.design.widget.NavigationView
;
import
android.support.v4.app.ActivityCompat
;
import
android.support.v4.app.ActivityCompat
;
import
android.app.FragmentTransaction
;
import
android.support.v4.view.GravityCompat
;
import
android.support.v4.view.GravityCompat
;
import
android.support.v4.widget.DrawerLayout
;
import
android.support.v4.widget.DrawerLayout
;
import
android.support.v7.app.ActionBarDrawerToggle
;
import
android.support.v7.app.ActionBarDrawerToggle
;
...
@@ -25,8 +25,9 @@ import android.view.MenuItem;
...
@@ -25,8 +25,9 @@ import android.view.MenuItem;
import
android.view.View
;
import
android.view.View
;
import
com.topjohnwu.magisk.module.RepoHelper
;
import
com.topjohnwu.magisk.module.RepoHelper
;
import
com.topjohnwu.magisk.utils.Async
;
import
com.topjohnwu.magisk.services.MonitorService
;
import
com.topjohnwu.magisk.services.MonitorService
;
import
com.topjohnwu.magisk.utils.Async
;
import
com.topjohnwu.magisk.utils.Logger
;
import
com.topjohnwu.magisk.utils.Utils
;
import
com.topjohnwu.magisk.utils.Utils
;
import
butterknife.BindView
;
import
butterknife.BindView
;
...
@@ -37,6 +38,7 @@ public class WelcomeActivity extends AppCompatActivity implements NavigationView
...
@@ -37,6 +38,7 @@ public class WelcomeActivity extends AppCompatActivity implements NavigationView
private
static
final
String
SELECTED_ITEM_ID
=
"SELECTED_ITEM_ID"
;
private
static
final
String
SELECTED_ITEM_ID
=
"SELECTED_ITEM_ID"
;
private
final
Handler
mDrawerHandler
=
new
Handler
();
private
final
Handler
mDrawerHandler
=
new
Handler
();
private
String
currentTitle
;
@BindView
(
R
.
id
.
toolbar
)
@BindView
(
R
.
id
.
toolbar
)
Toolbar
toolbar
;
Toolbar
toolbar
;
...
@@ -54,15 +56,14 @@ public class WelcomeActivity extends AppCompatActivity implements NavigationView
...
@@ -54,15 +56,14 @@ public class WelcomeActivity extends AppCompatActivity implements NavigationView
setContentView
(
R
.
layout
.
activity_welcome
);
setContentView
(
R
.
layout
.
activity_welcome
);
ButterKnife
.
bind
(
this
);
ButterKnife
.
bind
(
this
);
// Startups
// Startups
PreferenceManager
.
setDefaultValues
(
this
,
R
.
xml
.
defaultpref
,
false
);
PreferenceManager
.
setDefaultValues
(
this
,
R
.
xml
.
defaultpref
,
false
);
SharedPreferences
prefs
=
PreferenceManager
.
getDefaultSharedPreferences
(
this
);
SharedPreferences
prefs
=
PreferenceManager
.
getDefaultSharedPreferences
(
this
);
if
(
prefs
.
contains
(
"autoRootEnable"
))
{
if
(
Utils
.
autoToggleEnabled
(
getApplicationContext
()))
{
if
(
prefs
.
getBoolean
(
"autoRootEnable"
,
false
))
{
if
(!
Utils
.
isMyServiceRunning
(
MonitorService
.
class
,
getApplicationContext
()))
{
if
(!
Utils
.
isMyServiceRunning
(
MonitorService
.
class
,
getApplicationContext
()))
{
Intent
myIntent
=
new
Intent
(
getApplication
(),
MonitorService
.
class
);
Intent
myIntent
=
new
Intent
(
getApplication
(),
MonitorService
.
class
);
getApplication
().
startService
(
myIntent
);
getApplication
().
startService
(
myIntent
);
}
}
}
}
}
Utils
.
SetupQuickSettingsTile
(
getApplicationContext
());
Utils
.
SetupQuickSettingsTile
(
getApplicationContext
());
...
@@ -73,6 +74,8 @@ public class WelcomeActivity extends AppCompatActivity implements NavigationView
...
@@ -73,6 +74,8 @@ public class WelcomeActivity extends AppCompatActivity implements NavigationView
}
}
Utils
.
init
(
this
);
Utils
.
init
(
this
);
new
Async
.
CheckUpdates
(
this
).
execute
();
new
Async
.
CheckUpdates
(
this
).
execute
();
RepoHelper
.
TaskDelegate
delegate
=
result
->
{
RepoHelper
.
TaskDelegate
delegate
=
result
->
{
...
@@ -114,6 +117,7 @@ public class WelcomeActivity extends AppCompatActivity implements NavigationView
...
@@ -114,6 +117,7 @@ public class WelcomeActivity extends AppCompatActivity implements NavigationView
}
}
}
}
@Override
@Override
protected
void
onDestroy
()
{
protected
void
onDestroy
()
{
super
.
onDestroy
();
super
.
onDestroy
();
...
@@ -129,11 +133,23 @@ public class WelcomeActivity extends AppCompatActivity implements NavigationView
...
@@ -129,11 +133,23 @@ public class WelcomeActivity extends AppCompatActivity implements NavigationView
@Override
@Override
public
void
onBackPressed
()
{
public
void
onBackPressed
()
{
if
(
drawer
.
isDrawerOpen
(
GravityCompat
.
START
))
{
if
(
drawer
.
isDrawerOpen
(
GravityCompat
.
START
))
{
drawer
.
closeDrawer
(
GravityCompat
.
START
);
drawer
.
closeDrawer
(
GravityCompat
.
START
);
}
else
{
}
else
{
super
.
onBackPressed
();
int
backStackEntryCount
=
getFragmentManager
().
getBackStackEntryCount
();
Logger
.
dh
(
"Welcomeactivity: Entrycount is "
+
backStackEntryCount
);
if
(
backStackEntryCount
>=
2
)
{
super
.
onBackPressed
();
}
else
{
finish
();
}
}
}
}
}
@Override
@Override
...
@@ -146,7 +162,11 @@ public class WelcomeActivity extends AppCompatActivity implements NavigationView
...
@@ -146,7 +162,11 @@ public class WelcomeActivity extends AppCompatActivity implements NavigationView
return
true
;
return
true
;
}
}
@Override
protected
void
onResume
()
{
super
.
onResume
();
setTitle
(
currentTitle
);
}
public
void
navigate
(
final
int
itemId
)
{
public
void
navigate
(
final
int
itemId
)
{
Fragment
navFragment
=
null
;
Fragment
navFragment
=
null
;
...
@@ -163,7 +183,7 @@ public class WelcomeActivity extends AppCompatActivity implements NavigationView
...
@@ -163,7 +183,7 @@ public class WelcomeActivity extends AppCompatActivity implements NavigationView
navFragment
=
new
RootFragment
();
navFragment
=
new
RootFragment
();
break
;
break
;
case
R
.
id
.
autoroot
:
case
R
.
id
.
autoroot
:
setTitle
(
R
.
string
.
auto_
root
);
setTitle
(
R
.
string
.
auto_
toggle
);
tag
=
"ic_autoroot"
;
tag
=
"ic_autoroot"
;
navFragment
=
new
AutoRootFragment
();
navFragment
=
new
AutoRootFragment
();
break
;
break
;
...
@@ -193,12 +213,15 @@ public class WelcomeActivity extends AppCompatActivity implements NavigationView
...
@@ -193,12 +213,15 @@ public class WelcomeActivity extends AppCompatActivity implements NavigationView
}
}
if
(
navFragment
!=
null
)
{
if
(
navFragment
!=
null
)
{
FragmentTransaction
transaction
=
getFragmentManager
().
beginTransaction
();
FragmentTransaction
transaction
=
getFragmentManager
().
beginTransaction
();
transaction
.
setCustomAnimations
(
android
.
R
.
animator
.
fade_in
,
android
.
R
.
animator
.
fade_out
);
transaction
.
setCustomAnimations
(
android
.
R
.
animator
.
fade_in
,
android
.
R
.
animator
.
fade_out
);
try
{
try
{
toolbar
.
setElevation
(
navFragment
instanceof
ModulesFragment
?
0
:
10
);
toolbar
.
setElevation
(
navFragment
instanceof
ModulesFragment
?
0
:
10
);
currentTitle
=
getTitle
().
toString
();
transaction
.
replace
(
R
.
id
.
content_frame
,
navFragment
,
tag
).
commit
();
transaction
.
replace
(
R
.
id
.
content_frame
,
navFragment
,
tag
).
addToBackStack
(
currentTitle
).
commit
();
}
catch
(
IllegalStateException
ignored
)
{
}
catch
(
IllegalStateException
ignored
)
{
}
}
}
}
...
...
app/src/main/java/com/topjohnwu/magisk/receivers/PrivateBroadcastReceiver.java
View file @
3de13a4d
...
@@ -21,7 +21,7 @@ public final class PrivateBroadcastReceiver extends BroadcastReceiver {
...
@@ -21,7 +21,7 @@ public final class PrivateBroadcastReceiver extends BroadcastReceiver {
final
String
action
=
intent
.
getAction
();
final
String
action
=
intent
.
getAction
();
Log
.
d
(
"Magisk"
,
"Broadcast Receiver, Made it this far! We're trying to "
+
action
);
Log
.
d
(
"Magisk"
,
"Broadcast Receiver, Made it this far! We're trying to "
+
action
);
if
(
ACTION_AUTOROOT
.
equals
(
action
))
{
if
(
ACTION_AUTOROOT
.
equals
(
action
))
{
Utils
.
toggleAutoRoot
(!
Utils
.
auto
Root
Enabled
(
context
),
context
);
Utils
.
toggleAutoRoot
(!
Utils
.
auto
Toggle
Enabled
(
context
),
context
);
}
}
if
(
ACTION_ENABLEROOT
.
equals
(
action
))
{
if
(
ACTION_ENABLEROOT
.
equals
(
action
))
{
Utils
.
toggleAutoRoot
(
false
,
context
);
Utils
.
toggleAutoRoot
(
false
,
context
);
...
...
app/src/main/java/com/topjohnwu/magisk/services/MonitorService.java
View file @
3de13a4d
...
@@ -25,7 +25,7 @@ import com.topjohnwu.magisk.utils.Utils;
...
@@ -25,7 +25,7 @@ import com.topjohnwu.magisk.utils.Utils;
import
java.util.Set
;
import
java.util.Set
;
public
class
MonitorService
extends
AccessibilityService
{
public
class
MonitorService
extends
AccessibilityService
{
private
static
final
String
TAG
=
"M
agisk
"
;
private
static
final
String
TAG
=
"M
onitorService
"
;
private
Boolean
disableroot
;
private
Boolean
disableroot
;
@Override
@Override
...
@@ -70,10 +70,8 @@ public class MonitorService extends AccessibilityService {
...
@@ -70,10 +70,8 @@ public class MonitorService extends AccessibilityService {
if
(
isActivity
)
{
if
(
isActivity
)
{
Logger
.
dh
(
"MonitorService: CurrentActivity: "
+
componentName
.
getPackageName
());
Logger
.
dh
(
"MonitorService: CurrentActivity: "
+
componentName
.
getPackageName
());
String
mPackage
=
componentName
.
getPackageName
();
String
mPackage
=
componentName
.
getPackageName
();
SharedPreferences
prefs
=
PreferenceManager
.
getDefaultSharedPreferences
(
getApplicationContext
());
SharedPreferences
prefs
=
PreferenceManager
.
getDefaultSharedPreferences
(
getApplicationContext
());
if
(
prefs
.
getBoolean
(
"autoRootEnable"
,
false
))
{
if
(
Utils
.
autoToggleEnabled
(
getApplicationContext
()))
{
Set
<
String
>
setBlackList
=
prefs
.
getStringSet
(
"auto_blacklist"
,
null
);
Set
<
String
>
setBlackList
=
prefs
.
getStringSet
(
"auto_blacklist"
,
null
);
if
(
setBlackList
!=
null
)
{
if
(
setBlackList
!=
null
)
{
...
@@ -153,7 +151,7 @@ public class MonitorService extends AccessibilityService {
...
@@ -153,7 +151,7 @@ public class MonitorService extends AccessibilityService {
new
NotificationCompat
.
Builder
(
getApplicationContext
())
new
NotificationCompat
.
Builder
(
getApplicationContext
())
.
setSmallIcon
(
disableroot
?
R
.
drawable
.
ic_stat_notification_autoroot_off
:
R
.
drawable
.
ic_stat_notification_autoroot_on
)
.
setSmallIcon
(
disableroot
?
R
.
drawable
.
ic_stat_notification_autoroot_off
:
R
.
drawable
.
ic_stat_notification_autoroot_on
)
.
setContentIntent
(
pendingIntent
)
.
setContentIntent
(
pendingIntent
)
.
setContentTitle
(
"Auto-root
status changed"
)
.
setContentTitle
(
getApplicationContext
().
getString
(
R
.
string
.
auto_toggle
)
+
"
status changed"
)
.
setContentText
(
rootMessage
);
.
setContentText
(
rootMessage
);
int
mNotificationId
=
1
;
int
mNotificationId
=
1
;
mNotifyMgr
.
notify
(
mNotificationId
,
mBuilder
.
build
());
mNotifyMgr
.
notify
(
mNotificationId
,
mBuilder
.
build
());
...
...
app/src/main/java/com/topjohnwu/magisk/services/TileServiceCompat.java
View file @
3de13a4d
...
@@ -7,15 +7,11 @@ import android.content.Intent;
...
@@ -7,15 +7,11 @@ import android.content.Intent;
import
android.content.IntentFilter
;
import
android.content.IntentFilter
;
import
android.content.pm.PackageManager
;
import
android.content.pm.PackageManager
;
import
android.os.IBinder
;
import
android.os.IBinder
;
import
android.service.quicksettings.Tile
;
import
com.kcoppock.broadcasttilesupport.BroadcastTileIntentBuilder
;
import
com.kcoppock.broadcasttilesupport.BroadcastTileIntentBuilder
;
import
com.topjohnwu.magisk.utils.Shell
;
import
com.topjohnwu.magisk.R
;
import
com.topjohnwu.magisk.R
;
import
com.topjohnwu.magisk.utils.Utils
;
import
com.topjohnwu.magisk.utils.Utils
;
import
java.util.List
;
public
class
TileServiceCompat
extends
Service
{
public
class
TileServiceCompat
extends
Service
{
private
static
BroadcastReceiver
clickTileReceiver
;
private
static
BroadcastReceiver
clickTileReceiver
;
...
@@ -46,7 +42,7 @@ public class TileServiceCompat extends Service {
...
@@ -46,7 +42,7 @@ public class TileServiceCompat extends Service {
@Override
@Override
public
int
onStartCommand
(
Intent
intent
,
int
flags
,
int
startId
)
{
public
int
onStartCommand
(
Intent
intent
,
int
flags
,
int
startId
)
{
root
=
Utils
.
rootEnabled
();
root
=
Utils
.
rootEnabled
();
autoRoot
=
Utils
.
auto
Root
Enabled
(
getApplicationContext
());
autoRoot
=
Utils
.
auto
Toggle
Enabled
(
getApplicationContext
());
updateTile
();
updateTile
();
return
super
.
onStartCommand
(
intent
,
flags
,
startId
);
return
super
.
onStartCommand
(
intent
,
flags
,
startId
);
}
}
...
@@ -80,7 +76,7 @@ public class TileServiceCompat extends Service {
...
@@ -80,7 +76,7 @@ public class TileServiceCompat extends Service {
private
void
onLongClick
()
{
private
void
onLongClick
()
{
Intent
it
=
new
Intent
(
Intent
.
ACTION_CLOSE_SYSTEM_DIALOGS
);
Intent
it
=
new
Intent
(
Intent
.
ACTION_CLOSE_SYSTEM_DIALOGS
);
sendBroadcast
(
it
);
sendBroadcast
(
it
);
Utils
.
toggleAutoRoot
(!
Utils
.
auto
Root
Enabled
(
getApplicationContext
()),
getApplicationContext
());
Utils
.
toggleAutoRoot
(!
Utils
.
auto
Toggle
Enabled
(
getApplicationContext
()),
getApplicationContext
());
}
}
public
static
boolean
openApp
(
Context
context
,
String
packageName
)
{
public
static
boolean
openApp
(
Context
context
,
String
packageName
)
{
...
@@ -99,7 +95,7 @@ public class TileServiceCompat extends Service {
...
@@ -99,7 +95,7 @@ public class TileServiceCompat extends Service {
private
void
updateTile
()
{
private
void
updateTile
()
{
BroadcastTileIntentBuilder
broadcastTileIntentBuilder
=
new
BroadcastTileIntentBuilder
(
this
,
TILE_ID
);
BroadcastTileIntentBuilder
broadcastTileIntentBuilder
=
new
BroadcastTileIntentBuilder
(
this
,
TILE_ID
);
if
(
autoRoot
)
{
if
(
autoRoot
)
{
broadcastTileIntentBuilder
.
setLabel
(
"Auto-root"
);
broadcastTileIntentBuilder
.
setLabel
(
getApplicationContext
().
getString
(
R
.
string
.
auto_toggle
)
);
broadcastTileIntentBuilder
.
setIconResource
(
R
.
drawable
.
ic_autoroot_white
);
broadcastTileIntentBuilder
.
setIconResource
(
R
.
drawable
.
ic_autoroot_white
);
}
else
{
}
else
{
...
...
app/src/main/java/com/topjohnwu/magisk/services/TileServiceNewApi.java
View file @
3de13a4d
...
@@ -42,12 +42,12 @@ public class TileServiceNewApi extends android.service.quicksettings.TileService
...
@@ -42,12 +42,12 @@ public class TileServiceNewApi extends android.service.quicksettings.TileService
Icon
iconRoot
=
Icon
.
createWithResource
(
getApplicationContext
(),
R
.
drawable
.
root
);
Icon
iconRoot
=
Icon
.
createWithResource
(
getApplicationContext
(),
R
.
drawable
.
root
);
Icon
iconAuto
=
Icon
.
createWithResource
(
getApplicationContext
(),
R
.
drawable
.
ic_autoroot
);
Icon
iconAuto
=
Icon
.
createWithResource
(
getApplicationContext
(),
R
.
drawable
.
ic_autoroot
);
Tile
tile
=
this
.
getQsTile
();
Tile
tile
=
this
.
getQsTile
();
boolean
autoRootStatus
=
Utils
.
auto
Root
Enabled
(
getApplicationContext
());
boolean
autoRootStatus
=
Utils
.
auto
Toggle
Enabled
(
getApplicationContext
());
boolean
rootStatus
=
Utils
.
rootEnabled
();
boolean
rootStatus
=
Utils
.
rootEnabled
();
int
rootsStatus
=
Utils
.
CheckRootsState
(
getApplicationContext
());
int
rootsStatus
=
Utils
.
CheckRootsState
(
getApplicationContext
());
Log
.
d
(
"Magisk"
,
"QST: Auto and root are "
+
autoRootStatus
+
" and "
+
rootStatus
+
Utils
.
CheckRootsState
(
getApplicationContext
()));
Log
.
d
(
"Magisk"
,
"QST: Auto and root are "
+
autoRootStatus
+
" and "
+
rootStatus
+
Utils
.
CheckRootsState
(
getApplicationContext
()));
if
(
rootsStatus
==
2
)
{
if
(
rootsStatus
==
2
)
{
tile
.
setLabel
(
"Auto-root"
);
tile
.
setLabel
(
getApplicationContext
().
getString
(
R
.
string
.
auto_toggle
)
);
tile
.
setIcon
(
iconAuto
);
tile
.
setIcon
(
iconAuto
);
tile
.
setState
(
Tile
.
STATE_ACTIVE
);
tile
.
setState
(
Tile
.
STATE_ACTIVE
);
...
...
app/src/main/java/com/topjohnwu/magisk/utils/ApplicationAdapter.java
View file @
3de13a4d
...
@@ -55,7 +55,7 @@ public class ApplicationAdapter extends ArrayAdapter<ApplicationInfo> {
...
@@ -55,7 +55,7 @@ public class ApplicationAdapter extends ArrayAdapter<ApplicationInfo> {
if
(
null
==
view
)
{
if
(
null
==
view
)
{
LayoutInflater
layoutInflater
=
(
LayoutInflater
)
context
LayoutInflater
layoutInflater
=
(
LayoutInflater
)
context
.
getSystemService
(
Context
.
LAYOUT_INFLATER_SERVICE
);
.
getSystemService
(
Context
.
LAYOUT_INFLATER_SERVICE
);
view
=
layoutInflater
.
inflate
(
R
.
layout
.
app_list_row
,
null
);
view
=
layoutInflater
.
inflate
(
R
.
layout
.
list_item_app
,
null
);
}
}
ApplicationInfo
applicationInfo
=
appsList
.
get
(
position
);
ApplicationInfo
applicationInfo
=
appsList
.
get
(
position
);
...
@@ -81,7 +81,7 @@ public class ApplicationAdapter extends ArrayAdapter<ApplicationInfo> {
...
@@ -81,7 +81,7 @@ public class ApplicationAdapter extends ArrayAdapter<ApplicationInfo> {
if
(
null
==
view
)
{
if
(
null
==
view
)
{
LayoutInflater
layoutInflater
=
(
LayoutInflater
)
context
LayoutInflater
layoutInflater
=
(
LayoutInflater
)
context
.
getSystemService
(
Context
.
LAYOUT_INFLATER_SERVICE
);
.
getSystemService
(
Context
.
LAYOUT_INFLATER_SERVICE
);
view
=
layoutInflater
.
inflate
(
R
.
layout
.
app_list_row
,
null
);
view
=
layoutInflater
.
inflate
(
R
.
layout
.
list_item_app
,
null
);
}
}
ApplicationInfo
applicationInfo
=
appsList
.
get
(
position
);
ApplicationInfo
applicationInfo
=
appsList
.
get
(
position
);
if
(
null
!=
applicationInfo
)
{
if
(
null
!=
applicationInfo
)
{
...
...
app/src/main/java/com/topjohnwu/magisk/utils/Utils.java
View file @
3de13a4d
...
@@ -97,9 +97,9 @@ public class Utils {
...
@@ -97,9 +97,9 @@ public class Utils {
return
Boolean
.
parseBoolean
(
ret
.
get
(
0
));
return
Boolean
.
parseBoolean
(
ret
.
get
(
0
));
}
}
public
static
boolean
auto
Root
Enabled
(
Context
context
)
{
public
static
boolean
auto
Toggle
Enabled
(
Context
context
)
{
SharedPreferences
preferences
=
PreferenceManager
.
getDefaultSharedPreferences
(
context
);
SharedPreferences
preferences
=
PreferenceManager
.
getDefaultSharedPreferences
(
context
);
Log
.
d
(
"Magisk"
,
"
AutoRootEnableCheck is "
+
preferences
.
getBoolean
(
"autoRootEnable"
,
false
));
Log
ger
.
dh
(
"Utils:
AutoRootEnableCheck is "
+
preferences
.
getBoolean
(
"autoRootEnable"
,
false
));
return
PreferenceManager
.
getDefaultSharedPreferences
(
context
).
getBoolean
(
"autoRootEnable"
,
false
);
return
PreferenceManager
.
getDefaultSharedPreferences
(
context
).
getBoolean
(
"autoRootEnable"
,
false
);
}
}
...
@@ -232,7 +232,7 @@ public class Utils {
...
@@ -232,7 +232,7 @@ public class Utils {
int
mIcon
;
int
mIcon
;
switch
(
mRootsState
)
{
switch
(
mRootsState
)
{
case
2
:
case
2
:
mLabelString
=
"Auto-root"
;
mLabelString
=
mContext
.
getString
(
R
.
string
.
auto_toggle
)
;
mIcon
=
mAutoRootIcon
;
mIcon
=
mAutoRootIcon
;
intent
=
autoBroadcast
;
intent
=
autoBroadcast
;
break
;
break
;
...
@@ -360,7 +360,7 @@ public class Utils {
...
@@ -360,7 +360,7 @@ public class Utils {
// 0 for root disabled, 1 for root enabled (no auto), 2 for auto-root
// 0 for root disabled, 1 for root enabled (no auto), 2 for auto-root
public
static
int
CheckRootsState
(
Context
mContext
)
{
public
static
int
CheckRootsState
(
Context
mContext
)
{
if
(
auto
Root
Enabled
(
mContext
))
{
if
(
auto
Toggle
Enabled
(
mContext
))
{
return
2
;
return
2
;
}
else
{
}
else
{
if
(
rootEnabled
())
{
if
(
rootEnabled
())
{
...
...
app/src/main/res/layout/auto_root_fragment.xml
View file @
3de13a4d
...
@@ -6,9 +6,9 @@
...
@@ -6,9 +6,9 @@
<ListView
android:id=
"@android:id/list"
<ListView
android:id=
"@android:id/list"
android:divider=
"@android:color/transparent"
android:divider=
"@android:color/transparent"
android:dividerHeight=
"
5.0sp
"
android:dividerHeight=
"
@dimen/card_divider_space
"
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:layout_height=
"match_parent"
android:layout_margin=
"
15
dp"
/>
android:layout_margin=
"
6
dp"
/>
</LinearLayout>
</LinearLayout>
\ No newline at end of file
app/src/main/res/layout/
app_list_row
.xml
→
app/src/main/res/layout/
list_item_app
.xml
View file @
3de13a4d
...
@@ -2,29 +2,29 @@
...
@@ -2,29 +2,29 @@
<android.support.v7.widget.CardView
xmlns:android=
"http://schemas.android.com/apk/res/android"
<android.support.v7.widget.CardView
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:card_view=
"http://schemas.android.com/apk/res-auto"
xmlns:card_view=
"http://schemas.android.com/apk/res-auto"
style=
"@style/Base.CardView"
android:layout_width=
"fill_parent"
android:layout_width=
"fill_parent"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center"
android:layout_gravity=
"center"
android:layout_marginBottom=
"3dip
"
android:layout_marginBottom=
"@dimen/card_vertical_margin
"
android:layout_marginLeft=
"8dip
"
android:layout_marginStart=
"@dimen/card_horizontal_margin
"
android:layout_marginRight=
"8dip
"
android:layout_marginEnd=
"@dimen/card_horizontal_margin
"
android:layout_marginTop=
"3dip
"
android:layout_marginTop=
"@dimen/card_vertical_margin
"
android:background=
"?android:attr/selectableItemBackground"
android:background=
"?android:attr/selectableItemBackground"
card_view:cardCornerRadius=
"2dp"
android:minHeight=
"?android:attr/listPreferredItemHeight"
card_view:cardElevation=
"2dp"
>
card_view:cardCornerRadius=
"@dimen/card_corner_radius"
card_view:cardElevation=
"@dimen/card_elevation"
>
<RelativeLayout
<RelativeLayout
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"fill_parent"
android:layout_height=
"fill_parent"
android:layout_gravity=
"center_vertical"
android:layout_gravity=
"center_vertical"
android:padding=
"
10dp
"
>
android:padding=
"
@dimen/card_layout_padding
"
>
<ImageView
xmlns:android=
"http://schemas.android.com/apk/res/android"
<ImageView
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:id=
"@+id/app_icon"
android:id=
"@+id/app_icon"
android:layout_width=
"
50dp
"
android:layout_width=
"
@dimen/card_appicon_size
"
android:layout_height=
"
50dp
"
android:layout_height=
"
@dimen/card_appicon_size
"
android:layout_centerVertical=
"true"
android:layout_centerVertical=
"true"
android:scaleType=
"centerCrop"
/>
android:scaleType=
"centerCrop"
/>
...
@@ -34,7 +34,7 @@
...
@@ -34,7 +34,7 @@
android:layout_width=
"fill_parent"
android:layout_width=
"fill_parent"
android:layout_height=
"fill_parent"
android:layout_height=
"fill_parent"
android:orientation=
"vertical"
android:orientation=
"vertical"
android:paddingEnd=
"
50dp
"
android:paddingEnd=
"
@dimen/card_appicon_size
"
android:paddingStart=
"65dp"
android:paddingStart=
"65dp"
android:gravity=
"center_horizontal"
android:gravity=
"center_horizontal"
android:layout_alignBottom=
"@+id/app_icon"
android:layout_alignBottom=
"@+id/app_icon"
...
...
app/src/main/res/layout/list_item_module.xml
View file @
3de13a4d
...
@@ -5,24 +5,25 @@
...
@@ -5,24 +5,25 @@
android:layout_width=
"fill_parent"
android:layout_width=
"fill_parent"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center"
android:layout_gravity=
"center"
android:layout_marginBottom=
"
3dip
"
android:layout_marginBottom=
"
@dimen/card_vertical_margin
"
android:layout_margin
Left=
"8dip
"
android:layout_margin
Start=
"@dimen/card_horizontal_margin
"
android:layout_margin
Right=
"8dip
"
android:layout_margin
End=
"@dimen/card_horizontal_margin
"
android:layout_marginTop=
"
3dip
"
android:layout_marginTop=
"
@dimen/card_vertical_margin
"
android:background=
"?android:attr/selectableItemBackground"
android:background=
"?android:attr/selectableItemBackground"
android:minHeight=
"?android:attr/listPreferredItemHeight"
android:minHeight=
"?android:attr/listPreferredItemHeight"
card_view:cardCornerRadius=
"
2dp
"
card_view:cardCornerRadius=
"
@dimen/card_corner_radius
"
card_view:cardElevation=
"
2dp
"
>
card_view:cardElevation=
"
@dimen/card_elevation
"
>
<RelativeLayout
<RelativeLayout
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:padding=
"10dp"
android:minHeight=
"?android:attr/listPreferredItemHeight"
android:padding=
"@dimen/card_layout_padding"
android:layout_gravity=
"center_vertical"
>
android:layout_gravity=
"center_vertical"
>
<TextView
<TextView
android:id=
"@+id/title"
android:id=
"@+id/title"
android:layout_width=
"
300dip
"
android:layout_width=
"
@dimen/card_textview_width
"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_alignParentStart=
"true"
android:layout_alignParentStart=
"true"
android:layout_alignParentTop=
"true"
android:layout_alignParentTop=
"true"
...
@@ -56,7 +57,7 @@
...
@@ -56,7 +57,7 @@
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:focusable=
"false"
android:focusable=
"false"
android:gravity=
"center"
android:gravity=
"center"
android:padding=
"
3dp
"
android:padding=
"
@dimen/checkbox_padding
"
android:src=
"@drawable/ic_menu_overflow_material"
android:src=
"@drawable/ic_menu_overflow_material"
tools:ignore=
"ContentDescription"
/>
tools:ignore=
"ContentDescription"
/>
...
@@ -67,7 +68,7 @@
...
@@ -67,7 +68,7 @@
android:layout_marginBottom=
"0dp"
android:layout_marginBottom=
"0dp"
android:focusable=
"false"
android:focusable=
"false"
android:gravity=
"center"
android:gravity=
"center"
android:padding=
"
3dp
"
android:padding=
"
@dimen/checkbox_padding
"
android:src=
"@drawable/ic_delete"
android:src=
"@drawable/ic_delete"
tools:ignore=
"ContentDescription"
/>
tools:ignore=
"ContentDescription"
/>
...
@@ -87,7 +88,7 @@
...
@@ -87,7 +88,7 @@
<!--/>-->
<!--/>-->
<TextView
<TextView
android:id=
"@+id/description"
android:id=
"@+id/description"
android:layout_width=
"
300dip
"
android:layout_width=
"
@dimen/card_textview_width
"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_alignParentStart=
"true"
android:layout_alignParentStart=
"true"
android:layout_below=
"@id/version_name"
android:layout_below=
"@id/version_name"
...
@@ -112,7 +113,7 @@
...
@@ -112,7 +113,7 @@
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_alignParentStart=
"true"
android:layout_alignParentStart=
"true"
android:layout_below=
"@id/description"
android:layout_below=
"@id/description"
android:minHeight=
"
100dp
"
android:minHeight=
"
@dimen/min_rowheight
"
android:orientation=
"vertical"
android:orientation=
"vertical"
>
>
...
@@ -147,8 +148,8 @@
...
@@ -147,8 +148,8 @@
android:id=
"@+id/changeLog"
android:id=
"@+id/changeLog"
android:layout_width=
"wrap_content"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginEnd=
"
10dp
"
android:layout_marginEnd=
"
@dimen/card_imageview_margin
"
android:layout_marginStart=
"
10dp
"
android:layout_marginStart=
"
@dimen/card_imageview_margin
"
android:backgroundTint=
"@color/icon_grey"
android:backgroundTint=
"@color/icon_grey"
android:background=
"@drawable/ic_changelog"
/>
android:background=
"@drawable/ic_changelog"
/>
...
@@ -156,8 +157,8 @@
...
@@ -156,8 +157,8 @@
android:id=
"@+id/authorLink"
android:id=
"@+id/authorLink"
android:layout_width=
"wrap_content"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginEnd=
"
10dp
"
android:layout_marginEnd=
"
@dimen/card_imageview_margin
"
android:layout_marginStart=
"
10dp
"
android:layout_marginStart=
"
@dimen/card_imageview_margin
"
android:backgroundTint=
"@color/icon_grey"
android:backgroundTint=
"@color/icon_grey"
android:background=
"@drawable/ic_author"
/>
android:background=
"@drawable/ic_author"
/>
...
@@ -165,8 +166,8 @@
...
@@ -165,8 +166,8 @@
android:id=
"@+id/supportLink"
android:id=
"@+id/supportLink"
android:layout_width=
"wrap_content"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_marginEnd=
"
10dp
"
android:layout_marginEnd=
"
@dimen/card_imageview_margin
"
android:layout_marginStart=
"
10dp
"
android:layout_marginStart=
"
@dimen/card_imageview_margin
"
android:backgroundTint=
"@color/icon_grey"
android:backgroundTint=
"@color/icon_grey"
android:background=
"@drawable/ic_support"
/>
android:background=
"@drawable/ic_support"
/>
...
...
app/src/main/res/layout/list_item_repo.xml
View file @
3de13a4d
...
@@ -5,18 +5,21 @@
...
@@ -5,18 +5,21 @@
android:layout_width=
"fill_parent"
android:layout_width=
"fill_parent"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center"
android:layout_gravity=
"center"
android:layout_margin=
"8dp"
android:layout_marginBottom=
"@dimen/card_vertical_margin"
android:background=
"?android:attr/selectableItemBackground"
android:layout_marginStart=
"@dimen/card_horizontal_margin"
android:minHeight=
"?android:attr/listPreferredItemHeight"
android:layout_marginEnd=
"@dimen/card_horizontal_margin"
card_view:cardCornerRadius=
"2dp"
android:layout_marginTop=
"@dimen/card_vertical_margin"
card_view:cardElevation=
"2dp"
>
android:background=
"?android:attr/selectableItemBackground"
android:minHeight=
"?android:attr/listPreferredItemHeight"
card_view:cardCornerRadius=
"@dimen/card_corner_radius"
card_view:cardElevation=
"@dimen/card_elevation"
>
<RelativeLayout
<RelativeLayout
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:minHeight=
"?android:attr/listPreferredItemHeight"
android:minHeight=
"?android:attr/listPreferredItemHeight"
android:padding=
"10dp
"
>
android:padding=
"@dimen/card_layout_padding
"
>
<RelativeLayout
<RelativeLayout
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
...
@@ -26,7 +29,7 @@
...
@@ -26,7 +29,7 @@
<TextView
<TextView
android:id=
"@+id/title"
android:id=
"@+id/title"
android:layout_width=
"
300dip
"
android:layout_width=
"
@dimen/card_textview_width
"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:singleLine=
"false"
android:singleLine=
"false"
android:textAppearance=
"?android:attr/textAppearanceMedium"
android:textAppearance=
"?android:attr/textAppearanceMedium"
...
@@ -119,24 +122,24 @@
...
@@ -119,24 +122,24 @@
android:id=
"@+id/changeLog"
android:id=
"@+id/changeLog"
android:layout_width=
"wrap_content"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_margin
Start=
"10dp
"
android:layout_margin
End=
"@dimen/card_imageview_margin
"
android:layout_margin
End=
"10dp
"
android:layout_margin
Start=
"@dimen/card_imageview_margin
"
android:backgroundTint=
"@color/icon_grey"
android:backgroundTint=
"@color/icon_grey"
android:background=
"@drawable/ic_changelog"
/>
android:background=
"@drawable/ic_changelog"
/>
<ImageView
<ImageView
android:id=
"@+id/authorLink"
android:id=
"@+id/authorLink"
android:layout_width=
"wrap_content"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_margin
Start=
"10dp
"
android:layout_margin
End=
"@dimen/card_imageview_margin
"
android:layout_margin
End=
"10dp
"
android:layout_margin
Start=
"@dimen/card_imageview_margin
"
android:backgroundTint=
"@color/icon_grey"
android:backgroundTint=
"@color/icon_grey"
android:background=
"@drawable/ic_author"
/>
android:background=
"@drawable/ic_author"
/>
<ImageView
<ImageView
android:id=
"@+id/supportLink"
android:id=
"@+id/supportLink"
android:layout_width=
"wrap_content"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_margin
Start=
"10dp
"
android:layout_margin
End=
"@dimen/card_imageview_margin
"
android:layout_margin
End=
"10dp
"
android:layout_margin
Start=
"@dimen/card_imageview_margin
"
android:backgroundTint=
"@color/icon_grey"
android:backgroundTint=
"@color/icon_grey"
android:background=
"@drawable/ic_support"
/>
android:background=
"@drawable/ic_support"
/>
...
@@ -156,8 +159,8 @@
...
@@ -156,8 +159,8 @@
android:focusable=
"false"
android:focusable=
"false"
android:visibility=
"gone"
android:visibility=
"gone"
android:gravity=
"end"
android:gravity=
"end"
android:layout_margin
Start=
"10dp
"
android:layout_margin
End=
"@dimen/card_imageview_margin
"
android:layout_margin
End=
"10dp
"
android:layout_margin
Start=
"@dimen/card_imageview_margin
"
/>
/>
</RelativeLayout>
</RelativeLayout>
...
...
app/src/main/res/layout/modules_fragment.xml
View file @
3de13a4d
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<android.support.v4.widget.SwipeRefreshLayout
<android.support.v4.widget.SwipeRefreshLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:app=
"http://schemas.android.com/apk/res-auto"
xmlns:app=
"http://schemas.android.com/apk/res-auto"
android:id=
"@+id/swipeRefreshLayout"
android:id=
"@+id/swipeRefreshLayout"
...
@@ -8,24 +9,50 @@
...
@@ -8,24 +9,50 @@
android:layout_marginTop=
"?attr/actionBarSize"
android:layout_marginTop=
"?attr/actionBarSize"
android:orientation=
"vertical"
>
android:orientation=
"vertical"
>
<android.support.v7.widget.RecyclerView
android:id=
"@+id/recyclerView"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:clipToPadding=
"false"
android:paddingBottom=
"60dip"
app:layoutManager=
"android.support.v7.widget.LinearLayoutManager"
/>
<TextView
<android.support.design.widget.CoordinatorLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
android:id=
"@+id/empty_rv"
xmlns:app=
"http://schemas.android.com/apk/res-auto"
android:id=
"@+id/llayout"
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:layout_height=
"wrap_content"
android:layout_gravity=
"center"
android:layout_marginTop=
"?attr/actionBarSize"
android:fontFamily=
"sans-serif-light"
android:orientation=
"vertical"
>
android:gravity=
"center"
android:text=
"@string/no_modules_found"
<android.support.v7.widget.RecyclerView
android:textSize=
"20sp"
android:id=
"@+id/recyclerView"
android:textStyle=
"italic"
android:layout_width=
"match_parent"
android:visibility=
"gone"
/>
android:layout_height=
"match_parent"
android:clipToPadding=
"false"
android:dividerHeight=
"@dimen/card_divider_space"
android:paddingBottom=
"60dip"
app:layoutManager=
"android.support.v7.widget.LinearLayoutManager"
/>
<TextView
android:id=
"@+id/empty_rv"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:layout_gravity=
"center"
android:fontFamily=
"sans-serif-light"
android:gravity=
"center"
android:text=
"@string/no_modules_found"
android:textSize=
"20sp"
android:textStyle=
"italic"
android:visibility=
"gone"
/>
<android.support.design.widget.FloatingActionButton
android:id=
"@+id/fab"
android:layout_width=
"56dp"
android:layout_height=
"56dp"
android:layout_margin=
"16dp"
android:baselineAlignBottom=
"false"
android:clickable=
"true"
android:src=
"@drawable/ic_add"
app:layout_anchorGravity=
"bottom|center_horizontal"
app:layout_anchor=
"@+id/empty_rv"
android:layout_gravity=
"top|center_horizontal"
/>
</android.support.design.widget.CoordinatorLayout>
</android.support.v4.widget.SwipeRefreshLayout>
</android.support.v4.widget.SwipeRefreshLayout>
\ No newline at end of file
app/src/main/res/layout/repos_fragment.xml
View file @
3de13a4d
...
@@ -11,6 +11,7 @@
...
@@ -11,6 +11,7 @@
android:id=
"@+id/recyclerView"
android:id=
"@+id/recyclerView"
android:layout_width=
"match_parent"
android:layout_width=
"match_parent"
android:layout_height=
"match_parent"
android:layout_height=
"match_parent"
android:dividerHeight=
"@dimen/card_divider_space"
app:layoutManager=
"android.support.v7.widget.LinearLayoutManager"
/>
app:layoutManager=
"android.support.v7.widget.LinearLayoutManager"
/>
<TextView
<TextView
...
...
app/src/main/res/menu/drawer.xml
View file @
3de13a4d
...
@@ -18,7 +18,7 @@
...
@@ -18,7 +18,7 @@
<item
<item
android:id=
"@+id/autoroot"
android:id=
"@+id/autoroot"
android:icon=
"@drawable/ic_autoroot"
android:icon=
"@drawable/ic_autoroot"
android:title=
"@string/auto_
root
"
/>
android:title=
"@string/auto_
toggle
"
/>
<item
<item
android:id=
"@+id/modules"
android:id=
"@+id/modules"
...
...
app/src/main/res/values/dimens.xml
View file @
3de13a4d
...
@@ -3,4 +3,14 @@
...
@@ -3,4 +3,14 @@
<dimen
name=
"floating_height"
>
650dp
</dimen>
<dimen
name=
"floating_height"
>
650dp
</dimen>
<dimen
name=
"floating_width"
>
500dp
</dimen>
<dimen
name=
"floating_width"
>
500dp
</dimen>
<dimen
name=
"min_rowheight"
>
100dp
</dimen>
<dimen
name=
"min_rowheight"
>
100dp
</dimen>
<dimen
name=
"card_divider_space"
>
5sp
</dimen>
<dimen
name=
"card_horizontal_margin"
>
8dip
</dimen>
<dimen
name=
"card_vertical_margin"
>
3dip
</dimen>
<dimen
name=
"card_corner_radius"
>
2dp
</dimen>
<dimen
name=
"card_elevation"
>
2dp
</dimen>
<dimen
name=
"card_layout_padding"
>
10dp
</dimen>
<dimen
name=
"card_textview_width"
>
300dip
</dimen>
<dimen
name=
"checkbox_padding"
>
3dp
</dimen>
<dimen
name=
"card_imageview_margin"
>
10dp
</dimen>
<dimen
name=
"card_appicon_size"
>
50dp
</dimen>
</resources>
</resources>
\ No newline at end of file
app/src/main/res/values/strings.xml
View file @
3de13a4d
...
@@ -121,4 +121,7 @@
...
@@ -121,4 +121,7 @@
<string
name=
"settings_development_category"
>
Development
</string>
<string
name=
"settings_development_category"
>
Development
</string>
<string
name=
"settings_hide_root_notification_summary"
>
When checked, auto-root notifications will not be displayed.
</string>
<string
name=
"settings_hide_root_notification_summary"
>
When checked, auto-root notifications will not be displayed.
</string>
<string
name=
"settings_hide_root_notification_title"
>
Hide auto-root notifications
</string>
<string
name=
"settings_hide_root_notification_title"
>
Hide auto-root notifications
</string>
<!--General Use -->
<string
name=
"auto_toggle"
>
Auto-toggle
</string>
</resources>
</resources>
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