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
692b993e
Commit
692b993e
authored
Sep 28, 2016
by
topjohnwu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Additional notice for Module updates
parent
35e3a479
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
21 additions
and
14 deletions
+21
-14
ModulesAdapter.java
app/src/main/java/com/topjohnwu/magisk/ModulesAdapter.java
+9
-4
SplashActivity.java
app/src/main/java/com/topjohnwu/magisk/SplashActivity.java
+0
-4
Module.java
app/src/main/java/com/topjohnwu/magisk/module/Module.java
+8
-3
Async.java
app/src/main/java/com/topjohnwu/magisk/utils/Async.java
+1
-1
Utils.java
app/src/main/java/com/topjohnwu/magisk/utils/Utils.java
+1
-1
list_item_module.xml
app/src/main/res/layout/list_item_module.xml
+1
-1
strings.xml
app/src/main/res/values/strings.xml
+1
-0
No files found.
app/src/main/java/com/topjohnwu/magisk/ModulesAdapter.java
View file @
692b993e
...
@@ -99,11 +99,17 @@ public class ModulesAdapter extends RecyclerView.Adapter<ModulesAdapter.ViewHold
...
@@ -99,11 +99,17 @@ public class ModulesAdapter extends RecyclerView.Adapter<ModulesAdapter.ViewHold
updateDeleteButton
(
holder
,
module
);
updateDeleteButton
(
holder
,
module
);
});
});
if
(
module
.
isUpdated
())
{
holder
.
notice
.
setVisibility
(
View
.
VISIBLE
);
holder
.
notice
.
setText
(
R
.
string
.
update_file_created
);
holder
.
delete
.
setEnabled
(
false
);
}
else
{
updateDeleteButton
(
holder
,
module
);
updateDeleteButton
(
holder
,
module
);
}
}
}
private
void
updateDeleteButton
(
ViewHolder
holder
,
Module
module
)
{
private
void
updateDeleteButton
(
ViewHolder
holder
,
Module
module
)
{
holder
.
warning
.
setVisibility
(
module
.
willBeRemoved
()
?
View
.
VISIBLE
:
View
.
GONE
);
holder
.
notice
.
setVisibility
(
module
.
willBeRemoved
()
?
View
.
VISIBLE
:
View
.
GONE
);
if
(
module
.
willBeRemoved
())
{
if
(
module
.
willBeRemoved
())
{
holder
.
delete
.
setImageResource
(
R
.
drawable
.
ic_undelete
);
holder
.
delete
.
setImageResource
(
R
.
drawable
.
ic_undelete
);
...
@@ -122,10 +128,9 @@ public class ModulesAdapter extends RecyclerView.Adapter<ModulesAdapter.ViewHold
...
@@ -122,10 +128,9 @@ public class ModulesAdapter extends RecyclerView.Adapter<ModulesAdapter.ViewHold
@BindView
(
R
.
id
.
title
)
TextView
title
;
@BindView
(
R
.
id
.
title
)
TextView
title
;
@BindView
(
R
.
id
.
version_name
)
TextView
versionName
;
@BindView
(
R
.
id
.
version_name
)
TextView
versionName
;
@BindView
(
R
.
id
.
description
)
TextView
description
;
@BindView
(
R
.
id
.
description
)
TextView
description
;
@BindView
(
R
.
id
.
warning
)
TextView
warning
;
@BindView
(
R
.
id
.
notice
)
TextView
notice
;
@BindView
(
R
.
id
.
checkbox
)
CheckBox
checkBox
;
@BindView
(
R
.
id
.
checkbox
)
CheckBox
checkBox
;
@BindView
(
R
.
id
.
author
)
TextView
author
;
@BindView
(
R
.
id
.
author
)
TextView
author
;
// @BindView(R.id.updateStatus) TextView updateStatus;
@BindView
(
R
.
id
.
delete
)
ImageView
delete
;
@BindView
(
R
.
id
.
delete
)
ImageView
delete
;
public
ViewHolder
(
View
itemView
)
{
public
ViewHolder
(
View
itemView
)
{
...
...
app/src/main/java/com/topjohnwu/magisk/SplashActivity.java
View file @
692b993e
...
@@ -25,12 +25,8 @@ public class SplashActivity extends AppCompatActivity {
...
@@ -25,12 +25,8 @@ public class SplashActivity extends AppCompatActivity {
if
(
defaultPrefs
.
getString
(
"theme"
,
""
).
equals
(
"Dark"
))
{
if
(
defaultPrefs
.
getString
(
"theme"
,
""
).
equals
(
"Dark"
))
{
setTheme
(
R
.
style
.
AppTheme_dh
);
setTheme
(
R
.
style
.
AppTheme_dh
);
}
}
//setups go here
// Set up default preferences,make sure we add "extra" blacklist entries.
// Set up default preferences,make sure we add "extra" blacklist entries.
if
(!
defaultPrefs
.
contains
(
"auto_blacklist"
))
{
if
(!
defaultPrefs
.
contains
(
"auto_blacklist"
))
{
Logger
.
dev
(
"SplashActivity: Setting default preferences for application"
);
Logger
.
dev
(
"SplashActivity: Setting default preferences for application"
);
SharedPreferences
.
Editor
editor
=
defaultPrefs
.
edit
();
SharedPreferences
.
Editor
editor
=
defaultPrefs
.
edit
();
...
...
app/src/main/java/com/topjohnwu/magisk/module/Module.java
View file @
692b993e
...
@@ -6,9 +6,8 @@ import com.topjohnwu.magisk.utils.Utils;
...
@@ -6,9 +6,8 @@ import com.topjohnwu.magisk.utils.Utils;
public
class
Module
extends
BaseModule
{
public
class
Module
extends
BaseModule
{
private
String
mRemoveFile
;
private
String
mRemoveFile
,
mDisableFile
,
mUpdateFile
;
private
String
mDisableFile
;
private
boolean
mEnable
,
mRemove
,
mUpdated
;
private
boolean
mEnable
,
mRemove
;
public
Module
(
String
path
)
{
public
Module
(
String
path
)
{
...
@@ -16,6 +15,7 @@ public class Module extends BaseModule {
...
@@ -16,6 +15,7 @@ public class Module extends BaseModule {
mRemoveFile
=
path
+
"/remove"
;
mRemoveFile
=
path
+
"/remove"
;
mDisableFile
=
path
+
"/disable"
;
mDisableFile
=
path
+
"/disable"
;
mUpdateFile
=
path
+
"/update"
;
if
(
mId
==
null
)
{
if
(
mId
==
null
)
{
int
sep
=
path
.
lastIndexOf
(
'/'
);
int
sep
=
path
.
lastIndexOf
(
'/'
);
...
@@ -29,6 +29,7 @@ public class Module extends BaseModule {
...
@@ -29,6 +29,7 @@ public class Module extends BaseModule {
mEnable
=
!
Utils
.
itemExist
(
mDisableFile
);
mEnable
=
!
Utils
.
itemExist
(
mDisableFile
);
mRemove
=
Utils
.
itemExist
(
mRemoveFile
);
mRemove
=
Utils
.
itemExist
(
mRemoveFile
);
mUpdated
=
Utils
.
itemExist
(
mUpdateFile
);
}
}
...
@@ -56,4 +57,8 @@ public class Module extends BaseModule {
...
@@ -56,4 +57,8 @@ public class Module extends BaseModule {
return
mRemove
;
return
mRemove
;
}
}
public
boolean
isUpdated
()
{
return
mUpdated
;
}
}
}
\ No newline at end of file
app/src/main/java/com/topjohnwu/magisk/utils/Async.java
View file @
692b993e
...
@@ -42,7 +42,7 @@ public class Async {
...
@@ -42,7 +42,7 @@ public class Async {
@Override
@Override
protected
Void
doInBackground
(
Void
...
voids
)
{
protected
Void
doInBackground
(
Void
...
voids
)
{
String
toolPath
=
mContext
.
getApplicationInfo
().
dataDir
+
"/
busybox
"
;
String
toolPath
=
mContext
.
getApplicationInfo
().
dataDir
+
"/
tools
"
;
String
busybox
=
mContext
.
getApplicationInfo
().
dataDir
+
"/lib/libbusybox.so"
;
String
busybox
=
mContext
.
getApplicationInfo
().
dataDir
+
"/lib/libbusybox.so"
;
String
zip
=
mContext
.
getApplicationInfo
().
dataDir
+
"/lib/libzip.so"
;
String
zip
=
mContext
.
getApplicationInfo
().
dataDir
+
"/lib/libzip.so"
;
if
(
Shell
.
rootAccess
())
{
if
(
Shell
.
rootAccess
())
{
...
...
app/src/main/java/com/topjohnwu/magisk/utils/Utils.java
View file @
692b993e
...
@@ -62,7 +62,7 @@ public class Utils {
...
@@ -62,7 +62,7 @@ public class Utils {
}
else
{
}
else
{
MagiskFragment
.
magiskVersion
=
Integer
.
parseInt
(
ret
.
get
(
0
));
MagiskFragment
.
magiskVersion
=
Integer
.
parseInt
(
ret
.
get
(
0
));
}
}
String
toolPath
=
context
.
getApplicationInfo
().
dataDir
+
"/
busybox
"
;
String
toolPath
=
context
.
getApplicationInfo
().
dataDir
+
"/
tools
"
;
Shell
.
su
(
"PATH=$PATH:"
+
toolPath
);
Shell
.
su
(
"PATH=$PATH:"
+
toolPath
);
}
}
...
...
app/src/main/res/layout/list_item_module.xml
View file @
692b993e
...
@@ -70,7 +70,7 @@
...
@@ -70,7 +70,7 @@
android:textIsSelectable=
"false"
/>
android:textIsSelectable=
"false"
/>
<TextView
<TextView
android:id=
"@+id/
warning
"
android:id=
"@+id/
notice
"
android:layout_width=
"wrap_content"
android:layout_width=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_height=
"wrap_content"
android:layout_below=
"@id/description"
android:layout_below=
"@id/description"
...
...
app/src/main/res/values/strings.xml
View file @
692b993e
...
@@ -49,6 +49,7 @@
...
@@ -49,6 +49,7 @@
<string
name=
"no_info_provided"
>
(No info provided)
</string>
<string
name=
"no_info_provided"
>
(No info provided)
</string>
<string
name=
"no_modules_found"
>
No modules found
</string>
<string
name=
"no_modules_found"
>
No modules found
</string>
<string
name=
"module_not_installed"
>
Module is not installed
</string>
<string
name=
"module_not_installed"
>
Module is not installed
</string>
<string
name=
"update_file_created"
>
Module will be updated at next reboot
</string>
<string
name=
"remove_file_created"
>
Module will be removed at next reboot
</string>
<string
name=
"remove_file_created"
>
Module will be removed at next reboot
</string>
<string
name=
"remove_file_deleted"
>
Module will not be removed at next reboot
</string>
<string
name=
"remove_file_deleted"
>
Module will not be removed at next reboot
</string>
<string
name=
"disable_file_created"
>
Module will be disabled at next reboot
</string>
<string
name=
"disable_file_created"
>
Module will be disabled at next reboot
</string>
...
...
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