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
0efb4da0
Commit
0efb4da0
authored
Jan 30, 2017
by
topjohnwu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Several bug fixes
Fix #57
parent
ed7920d6
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
178 additions
and
167 deletions
+178
-167
build.gradle
app/build.gradle
+5
-5
Policy.java
app/src/main/java/com/topjohnwu/magisk/superuser/Policy.java
+1
-1
SuRequestActivity.java
...ava/com/topjohnwu/magisk/superuser/SuRequestActivity.java
+6
-4
fragment_install.xml
app/src/main/res/layout/fragment_install.xml
+166
-157
No files found.
app/build.gradle
View file @
0efb4da0
...
@@ -47,11 +47,11 @@ repositories {
...
@@ -47,11 +47,11 @@ repositories {
dependencies
{
dependencies
{
compile
fileTree
(
include:
[
'*.jar'
],
dir:
'libs'
)
compile
fileTree
(
include:
[
'*.jar'
],
dir:
'libs'
)
compile
'com.android.support:recyclerview-v7:25.1.
0
'
compile
'com.android.support:recyclerview-v7:25.1.
1
'
compile
'com.android.support:cardview-v7:25.1.
0
'
compile
'com.android.support:cardview-v7:25.1.
1
'
compile
'com.android.support:design:25.1.
0
'
compile
'com.android.support:design:25.1.
1
'
compile
'com.android.support:support-v4:25.1.
0
'
compile
'com.android.support:support-v4:25.1.
1
'
compile
'com.android.support:support-v13:25.1.
0
'
compile
'com.android.support:support-v13:25.1.
1
'
compile
'com.jakewharton:butterknife:8.5.1'
compile
'com.jakewharton:butterknife:8.5.1'
compile
'com.google.code.gson:gson:2.8.0'
compile
'com.google.code.gson:gson:2.8.0'
compile
'com.github.clans:fab:1.6.4'
compile
'com.github.clans:fab:1.6.4'
...
...
app/src/main/java/com/topjohnwu/magisk/superuser/Policy.java
View file @
0efb4da0
...
@@ -11,7 +11,6 @@ public class Policy {
...
@@ -11,7 +11,6 @@ public class Policy {
public
static
final
int
DENY
=
1
;
public
static
final
int
DENY
=
1
;
public
static
final
int
ALLOW
=
2
;
public
static
final
int
ALLOW
=
2
;
public
int
uid
,
policy
;
public
int
uid
,
policy
;
public
long
until
;
public
long
until
;
public
boolean
logging
=
true
,
notification
=
true
;
public
boolean
logging
=
true
,
notification
=
true
;
...
@@ -22,6 +21,7 @@ public class Policy {
...
@@ -22,6 +21,7 @@ public class Policy {
String
[]
pkgs
=
pm
.
getPackagesForUid
(
uid
);
String
[]
pkgs
=
pm
.
getPackagesForUid
(
uid
);
if
(
pkgs
!=
null
&&
pkgs
.
length
>
0
)
{
if
(
pkgs
!=
null
&&
pkgs
.
length
>
0
)
{
info
=
pm
.
getPackageInfo
(
pkgs
[
0
],
0
);
info
=
pm
.
getPackageInfo
(
pkgs
[
0
],
0
);
this
.
uid
=
uid
;
packageName
=
pkgs
[
0
];
packageName
=
pkgs
[
0
];
appName
=
info
.
applicationInfo
.
loadLabel
(
pm
).
toString
();
appName
=
info
.
applicationInfo
.
loadLabel
(
pm
).
toString
();
}
else
throw
new
PackageManager
.
NameNotFoundException
();
}
else
throw
new
PackageManager
.
NameNotFoundException
();
...
...
app/src/main/java/com/topjohnwu/magisk/superuser/SuRequestActivity.java
View file @
0efb4da0
...
@@ -87,11 +87,10 @@ public class SuRequestActivity extends AppCompatActivity implements CallbackHand
...
@@ -87,11 +87,10 @@ public class SuRequestActivity extends AppCompatActivity implements CallbackHand
switch
(
Global
.
Configs
.
suResponseType
)
{
switch
(
Global
.
Configs
.
suResponseType
)
{
case
AUTO_DENY:
case
AUTO_DENY:
event
.
trigger
(
);
handleAction
(
Policy
.
DENY
,
0
);
return
;
return
;
case
AUTO_ALLOW:
case
AUTO_ALLOW:
policy
.
policy
=
Policy
.
ALLOW
;
handleAction
(
Policy
.
ALLOW
,
0
);
event
.
trigger
(
policy
);
return
;
return
;
case
PROMPT:
case
PROMPT:
default
:
default
:
...
@@ -157,9 +156,12 @@ public class SuRequestActivity extends AppCompatActivity implements CallbackHand
...
@@ -157,9 +156,12 @@ public class SuRequestActivity extends AppCompatActivity implements CallbackHand
}
}
void
handleAction
(
int
action
)
{
void
handleAction
(
int
action
)
{
handleAction
(
action
,
timeoutList
[
timeout
.
getSelectedItemPosition
()]);
}
void
handleAction
(
int
action
,
int
time
)
{
policy
.
policy
=
action
;
policy
.
policy
=
action
;
event
.
trigger
(
policy
);
event
.
trigger
(
policy
);
int
time
=
timeoutList
[
timeout
.
getSelectedItemPosition
()];
if
(
time
>=
0
)
{
if
(
time
>=
0
)
{
policy
.
until
=
time
==
0
?
0
:
(
System
.
currentTimeMillis
()
/
1000
+
time
*
60
);
policy
.
until
=
time
==
0
?
0
:
(
System
.
currentTimeMillis
()
/
1000
+
time
*
60
);
new
SuDatabaseHelper
(
this
).
addPolicy
(
policy
);
new
SuDatabaseHelper
(
this
).
addPolicy
(
policy
);
...
...
app/src/main/res/layout/fragment_install.xml
View file @
0efb4da0
This diff is collapsed.
Click to expand it.
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