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
e94219c5
Commit
e94219c5
authored
Feb 21, 2017
by
topjohnwu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add notification settings
parent
8ed9634a
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
22 additions
and
21 deletions
+22
-21
build.gradle
app/build.gradle
+4
-4
MagiskManager.java
app/src/main/java/com/topjohnwu/magisk/MagiskManager.java
+3
-0
StatusFragment.java
app/src/main/java/com/topjohnwu/magisk/StatusFragment.java
+3
-16
CheckUpdates.java
...c/main/java/com/topjohnwu/magisk/asyncs/CheckUpdates.java
+2
-1
UpdateCheckService.java
...ava/com/topjohnwu/magisk/services/UpdateCheckService.java
+1
-0
strings.xml
app/src/main/res/values-zh-rTW/strings.xml
+2
-0
strings.xml
app/src/main/res/values/strings.xml
+2
-0
app_settings.xml
app/src/main/res/xml/app_settings.xml
+5
-0
No files found.
app/build.gradle
View file @
e94219c5
...
@@ -47,10 +47,10 @@ repositories {
...
@@ -47,10 +47,10 @@ repositories {
dependencies
{
dependencies
{
compile
fileTree
(
include:
[
'*.jar'
],
dir:
'libs'
)
compile
fileTree
(
include:
[
'*.jar'
],
dir:
'libs'
)
compile
'com.android.support:recyclerview-v7:25.
1.1
'
compile
'com.android.support:recyclerview-v7:25.
2.0
'
compile
'com.android.support:cardview-v7:25.
1.1
'
compile
'com.android.support:cardview-v7:25.
2.0
'
compile
'com.android.support:design:25.
1.1
'
compile
'com.android.support:design:25.
2.0
'
compile
'com.android.support:support-v4:25.
1.1
'
compile
'com.android.support:support-v4:25.
2.0
'
compile
'com.jakewharton:butterknife:8.5.1'
compile
'com.jakewharton:butterknife:8.5.1'
compile
'com.github.clans:fab:1.6.4'
compile
'com.github.clans:fab:1.6.4'
compile
'com.thoughtbot:expandablerecyclerview:1.4'
compile
'com.thoughtbot:expandablerecyclerview:1.4'
...
...
app/src/main/java/com/topjohnwu/magisk/MagiskManager.java
View file @
e94219c5
...
@@ -63,6 +63,7 @@ public class MagiskManager extends Application {
...
@@ -63,6 +63,7 @@ public class MagiskManager extends Application {
public
boolean
magiskHide
;
public
boolean
magiskHide
;
public
boolean
isDarkTheme
;
public
boolean
isDarkTheme
;
public
boolean
updateNotification
;
public
int
suRequestTimeout
;
public
int
suRequestTimeout
;
public
int
suLogTimeout
=
14
;
public
int
suLogTimeout
=
14
;
public
int
suAccessState
;
public
int
suAccessState
;
...
@@ -92,6 +93,7 @@ public class MagiskManager extends Application {
...
@@ -92,6 +93,7 @@ public class MagiskManager extends Application {
devLogging
=
prefs
.
getBoolean
(
"developer_logging"
,
false
);
devLogging
=
prefs
.
getBoolean
(
"developer_logging"
,
false
);
shellLogging
=
prefs
.
getBoolean
(
"shell_logging"
,
false
);
shellLogging
=
prefs
.
getBoolean
(
"shell_logging"
,
false
);
magiskHide
=
prefs
.
getBoolean
(
"magiskhide"
,
false
);
magiskHide
=
prefs
.
getBoolean
(
"magiskhide"
,
false
);
updateNotification
=
prefs
.
getBoolean
(
"notification"
,
true
);
// Always start a new root shell manually, just for safety
// Always start a new root shell manually, just for safety
Shell
.
init
();
Shell
.
init
();
updateMagiskInfo
();
updateMagiskInfo
();
...
@@ -101,6 +103,7 @@ public class MagiskManager extends Application {
...
@@ -101,6 +103,7 @@ public class MagiskManager extends Application {
prefs
.
edit
()
prefs
.
edit
()
.
putBoolean
(
"dark_theme"
,
isDarkTheme
)
.
putBoolean
(
"dark_theme"
,
isDarkTheme
)
.
putBoolean
(
"magiskhide"
,
magiskHide
)
.
putBoolean
(
"magiskhide"
,
magiskHide
)
.
putBoolean
(
"notification"
,
updateNotification
)
.
putBoolean
(
"busybox"
,
Utils
.
commandExists
(
"busybox"
))
.
putBoolean
(
"busybox"
,
Utils
.
commandExists
(
"busybox"
))
.
putBoolean
(
"hosts"
,
new
File
(
"/magisk/.core/hosts"
).
exists
())
.
putBoolean
(
"hosts"
,
new
File
(
"/magisk/.core/hosts"
).
exists
())
.
putBoolean
(
"disable"
,
Utils
.
itemExist
(
MAGISK_DISABLE_FILE
))
.
putBoolean
(
"disable"
,
Utils
.
itemExist
(
MAGISK_DISABLE_FILE
))
...
...
app/src/main/java/com/topjohnwu/magisk/StatusFragment.java
View file @
e94219c5
...
@@ -2,7 +2,6 @@ package com.topjohnwu.magisk;
...
@@ -2,7 +2,6 @@ package com.topjohnwu.magisk;
import
android.os.Bundle
;
import
android.os.Bundle
;
import
android.support.annotation.Nullable
;
import
android.support.annotation.Nullable
;
import
android.support.v4.app.FragmentTransaction
;
import
android.support.v4.widget.SwipeRefreshLayout
;
import
android.support.v4.widget.SwipeRefreshLayout
;
import
android.view.LayoutInflater
;
import
android.view.LayoutInflater
;
import
android.view.View
;
import
android.view.View
;
...
@@ -65,13 +64,8 @@ public class StatusFragment extends Fragment implements CallbackEvent.Listener<V
...
@@ -65,13 +64,8 @@ public class StatusFragment extends Fragment implements CallbackEvent.Listener<V
}
}
@OnClick
(
R
.
id
.
magisk_status_container
)
@OnClick
(
R
.
id
.
magisk_status_container
)
public
void
magisk
()
{
public
void
gotoInstall
()
{
((
MainActivity
)
getActivity
()).
navigationView
.
setCheckedItem
(
R
.
id
.
install
);
((
MainActivity
)
getActivity
()).
navigate
(
R
.
id
.
install
);
FragmentTransaction
transaction
=
getFragmentManager
().
beginTransaction
();
transaction
.
setCustomAnimations
(
android
.
R
.
anim
.
fade_in
,
android
.
R
.
anim
.
fade_out
);
try
{
transaction
.
replace
(
R
.
id
.
content_frame
,
new
InstallFragment
(),
"install"
).
commit
();
}
catch
(
IllegalStateException
ignored
)
{}
}
}
private
int
defaultColor
;
private
int
defaultColor
;
...
@@ -110,14 +104,7 @@ public class StatusFragment extends Fragment implements CallbackEvent.Listener<V
...
@@ -110,14 +104,7 @@ public class StatusFragment extends Fragment implements CallbackEvent.Listener<V
.
setTitle
(
R
.
string
.
no_magisk_title
)
.
setTitle
(
R
.
string
.
no_magisk_title
)
.
setMessage
(
R
.
string
.
no_magisk_msg
)
.
setMessage
(
R
.
string
.
no_magisk_msg
)
.
setCancelable
(
true
)
.
setCancelable
(
true
)
.
setPositiveButton
(
R
.
string
.
goto_install
,
(
dialogInterface
,
i
)
->
{
.
setPositiveButton
(
R
.
string
.
goto_install
,
(
d
,
i
)
->
gotoInstall
())
((
MainActivity
)
getActivity
()).
navigationView
.
setCheckedItem
(
R
.
id
.
install
);
FragmentTransaction
transaction
=
getFragmentManager
().
beginTransaction
();
transaction
.
setCustomAnimations
(
android
.
R
.
anim
.
fade_in
,
android
.
R
.
anim
.
fade_out
);
try
{
transaction
.
replace
(
R
.
id
.
content_frame
,
new
InstallFragment
(),
"install"
).
commit
();
}
catch
(
IllegalStateException
ignored
)
{}
})
.
setNegativeButton
(
R
.
string
.
no_thanks
,
null
)
.
setNegativeButton
(
R
.
string
.
no_thanks
,
null
)
.
show
();
.
show
();
}
}
...
...
app/src/main/java/com/topjohnwu/magisk/asyncs/CheckUpdates.java
View file @
e94219c5
...
@@ -48,7 +48,8 @@ public class CheckUpdates extends ParallelTask<Void, Void, Void> {
...
@@ -48,7 +48,8 @@ public class CheckUpdates extends ParallelTask<Void, Void, Void> {
@Override
@Override
protected
void
onPostExecute
(
Void
v
)
{
protected
void
onPostExecute
(
Void
v
)
{
if
(
magiskManager
.
magiskVersion
<
magiskManager
.
remoteMagiskVersion
&&
showNotification
)
{
if
(
magiskManager
.
magiskVersion
<
magiskManager
.
remoteMagiskVersion
&&
showNotification
&&
magiskManager
.
updateNotification
)
{
NotificationCompat
.
Builder
builder
=
new
NotificationCompat
.
Builder
(
magiskManager
);
NotificationCompat
.
Builder
builder
=
new
NotificationCompat
.
Builder
(
magiskManager
);
builder
.
setSmallIcon
(
R
.
drawable
.
ic_magisk
)
builder
.
setSmallIcon
(
R
.
drawable
.
ic_magisk
)
.
setContentTitle
(
magiskManager
.
getString
(
R
.
string
.
magisk_update_title
))
.
setContentTitle
(
magiskManager
.
getString
(
R
.
string
.
magisk_update_title
))
...
...
app/src/main/java/com/topjohnwu/magisk/services/UpdateCheckService.java
View file @
e94219c5
...
@@ -12,6 +12,7 @@ public class UpdateCheckService extends JobService {
...
@@ -12,6 +12,7 @@ public class UpdateCheckService extends JobService {
@Override
@Override
protected
Void
doInBackground
(
Void
...
voids
)
{
protected
Void
doInBackground
(
Void
...
voids
)
{
magiskManager
.
updateMagiskInfo
();
magiskManager
.
updateMagiskInfo
();
magiskManager
.
updateNotification
=
magiskManager
.
prefs
.
getBoolean
(
"notification"
,
true
);
return
super
.
doInBackground
(
voids
);
return
super
.
doInBackground
(
voids
);
}
}
...
...
app/src/main/res/values-zh-rTW/strings.xml
View file @
e94219c5
...
@@ -191,5 +191,7 @@
...
@@ -191,5 +191,7 @@
<string
name=
"version_none"
>
(無)
</string>
<string
name=
"version_none"
>
(無)
</string>
<string
name=
"manual_boot_image"
>
請手動選取 boot 映像位置
</string>
<string
name=
"manual_boot_image"
>
請手動選取 boot 映像位置
</string>
<string
name=
"cannot_auto_detect"
>
(無法自動偵測)
</string>
<string
name=
"cannot_auto_detect"
>
(無法自動偵測)
</string>
<string
name=
"settings_notification_summary"
>
有更新的時候顯示通知
</string>
<string
name=
"settings_notification_title"
>
更新通知
</string>
</resources>
</resources>
app/src/main/res/values/strings.xml
View file @
e94219c5
...
@@ -131,6 +131,8 @@
...
@@ -131,6 +131,8 @@
<string
name=
"settings_general_category"
>
General
</string>
<string
name=
"settings_general_category"
>
General
</string>
<string
name=
"settings_dark_theme_title"
>
Dark Theme
</string>
<string
name=
"settings_dark_theme_title"
>
Dark Theme
</string>
<string
name=
"settings_dark_theme_summary"
>
Enable dark theme
</string>
<string
name=
"settings_dark_theme_summary"
>
Enable dark theme
</string>
<string
name=
"settings_notification_title"
>
Update Notification
</string>
<string
name=
"settings_notification_summary"
>
Show update notifications when new version is available
</string>
<string
name=
"settings_clear_cache_title"
>
Clear Repo Cache
</string>
<string
name=
"settings_clear_cache_title"
>
Clear Repo Cache
</string>
<string
name=
"settings_clear_cache_summary"
>
Clear the cached information for online repos, forces the app to refresh online
</string>
<string
name=
"settings_clear_cache_summary"
>
Clear the cached information for online repos, forces the app to refresh online
</string>
...
...
app/src/main/res/xml/app_settings.xml
View file @
e94219c5
...
@@ -10,6 +10,11 @@
...
@@ -10,6 +10,11 @@
android:summary=
"@string/settings_dark_theme_summary"
android:summary=
"@string/settings_dark_theme_summary"
android:key=
"dark_theme"
/>
android:key=
"dark_theme"
/>
<CheckBoxPreference
android:title=
"@string/settings_notification_title"
android:summary=
"@string/settings_notification_summary"
android:key=
"notification"
/>
<Preference
<Preference
android:key=
"clear"
android:key=
"clear"
android:title=
"@string/settings_clear_cache_title"
android:title=
"@string/settings_clear_cache_title"
...
...
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