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
b064c124
Commit
b064c124
authored
Dec 27, 2016
by
topjohnwu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Dialog fix and trivial stuffs
parent
c7e64f40
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
33 additions
and
31 deletions
+33
-31
InstallFragment.java
app/src/main/java/com/topjohnwu/magisk/InstallFragment.java
+15
-5
StatusFragment.java
app/src/main/java/com/topjohnwu/magisk/StatusFragment.java
+2
-2
ReposAdapter.java
...main/java/com/topjohnwu/magisk/adapters/ReposAdapter.java
+12
-21
strings.xml
app/src/main/res/values-ar/strings.xml
+1
-1
strings.xml
app/src/main/res/values-zh-rCN/strings.xml
+1
-1
strings.xml
app/src/main/res/values/strings.xml
+2
-1
No files found.
app/src/main/java/com/topjohnwu/magisk/InstallFragment.java
View file @
b064c124
...
@@ -14,6 +14,8 @@ import android.widget.Spinner;
...
@@ -14,6 +14,8 @@ import android.widget.Spinner;
import
android.widget.TextView
;
import
android.widget.TextView
;
import
com.topjohnwu.magisk.receivers.MagiskDlReceiver
;
import
com.topjohnwu.magisk.receivers.MagiskDlReceiver
;
import
com.topjohnwu.magisk.receivers.RepoDlReceiver
;
import
com.topjohnwu.magisk.utils.Async
;
import
com.topjohnwu.magisk.utils.CallbackHandler
;
import
com.topjohnwu.magisk.utils.CallbackHandler
;
import
com.topjohnwu.magisk.utils.Utils
;
import
com.topjohnwu.magisk.utils.Utils
;
...
@@ -49,11 +51,19 @@ public class InstallFragment extends Fragment implements CallbackHandler.EventLi
...
@@ -49,11 +51,19 @@ public class InstallFragment extends Fragment implements CallbackHandler.EventLi
if
(
bootImage
==
null
)
{
if
(
bootImage
==
null
)
{
bootImage
=
blockList
.
get
(
spinner
.
getSelectedItemPosition
()
-
1
);
bootImage
=
blockList
.
get
(
spinner
.
getSelectedItemPosition
()
-
1
);
}
}
Utils
.
dlAndReceive
(
String
filename
=
"Magisk-v"
+
String
.
valueOf
(
StatusFragment
.
remoteMagiskVersion
)
+
".zip"
;
String
finalBootImage
=
bootImage
;
MainActivity
.
alertBuilder
.
setTitle
(
getString
(
R
.
string
.
repo_install_title
,
getString
(
R
.
string
.
magisk
)))
.
setMessage
(
getString
(
R
.
string
.
repo_install_msg
,
filename
))
.
setCancelable
(
true
)
.
setPositiveButton
(
R
.
string
.
download_install
,
(
dialogInterface
,
i
)
->
Utils
.
dlAndReceive
(
getActivity
(),
getActivity
(),
new
MagiskDlReceiver
(
b
ootImage
,
keepEncChkbox
.
isChecked
(),
keepVerityChkbox
.
isChecked
()),
new
MagiskDlReceiver
(
finalB
ootImage
,
keepEncChkbox
.
isChecked
(),
keepVerityChkbox
.
isChecked
()),
StatusFragment
.
magiskLink
,
StatusFragment
.
magiskLink
,
"Magisk-v"
+
String
.
valueOf
(
StatusFragment
.
remoteMagiskVersion
)
+
".zip"
);
Utils
.
getLegalFilename
(
filename
)))
.
setNegativeButton
(
R
.
string
.
no_thanks
,
null
)
.
show
();
});
});
if
(
blockDetectionDone
.
isTriggered
)
{
if
(
blockDetectionDone
.
isTriggered
)
{
updateUI
();
updateUI
();
...
...
app/src/main/java/com/topjohnwu/magisk/StatusFragment.java
View file @
b064c124
...
@@ -94,12 +94,12 @@ public class StatusFragment extends Fragment implements CallbackHandler.EventLis
...
@@ -94,12 +94,12 @@ public class StatusFragment extends Fragment implements CallbackHandler.EventLis
updateSafetyNetUI
();
updateSafetyNetUI
();
}
}
if
(
magiskVersion
<
0
)
{
if
(
magiskVersion
<
0
&&
Shell
.
rootAccess
()
)
{
MainActivity
.
alertBuilder
MainActivity
.
alertBuilder
.
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
.
download
_install
,
(
dialogInterface
,
i
)
->
{
.
setPositiveButton
(
R
.
string
.
goto
_install
,
(
dialogInterface
,
i
)
->
{
((
MainActivity
)
getActivity
()).
navigationView
.
setCheckedItem
(
R
.
id
.
install
);
((
MainActivity
)
getActivity
()).
navigationView
.
setCheckedItem
(
R
.
id
.
install
);
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
);
...
...
app/src/main/java/com/topjohnwu/magisk/adapters/ReposAdapter.java
View file @
b064c124
...
@@ -6,8 +6,6 @@ import android.animation.ValueAnimator;
...
@@ -6,8 +6,6 @@ import android.animation.ValueAnimator;
import
android.content.Context
;
import
android.content.Context
;
import
android.content.Intent
;
import
android.content.Intent
;
import
android.net.Uri
;
import
android.net.Uri
;
import
android.preference.PreferenceManager
;
import
android.support.v7.app.AlertDialog
;
import
android.support.v7.widget.RecyclerView
;
import
android.support.v7.widget.RecyclerView
;
import
android.util.DisplayMetrics
;
import
android.util.DisplayMetrics
;
import
android.view.LayoutInflater
;
import
android.view.LayoutInflater
;
...
@@ -19,6 +17,7 @@ import android.widget.ImageView;
...
@@ -19,6 +17,7 @@ import android.widget.ImageView;
import
android.widget.LinearLayout
;
import
android.widget.LinearLayout
;
import
android.widget.TextView
;
import
android.widget.TextView
;
import
com.topjohnwu.magisk.MainActivity
;
import
com.topjohnwu.magisk.R
;
import
com.topjohnwu.magisk.R
;
import
com.topjohnwu.magisk.module.Repo
;
import
com.topjohnwu.magisk.module.Repo
;
import
com.topjohnwu.magisk.receivers.RepoDlReceiver
;
import
com.topjohnwu.magisk.receivers.RepoDlReceiver
;
...
@@ -34,8 +33,7 @@ public class ReposAdapter extends RecyclerView.Adapter<ReposAdapter.ViewHolder>
...
@@ -34,8 +33,7 @@ public class ReposAdapter extends RecyclerView.Adapter<ReposAdapter.ViewHolder>
private
List
<
Repo
>
mUpdateRepos
,
mInstalledRepos
,
mOthersRepos
;
private
List
<
Repo
>
mUpdateRepos
,
mInstalledRepos
,
mOthersRepos
;
private
View
mView
;
private
View
mView
;
private
Context
context
;
private
Context
mContext
;
private
AlertDialog
.
Builder
builder
;
public
ReposAdapter
(
List
<
Repo
>
update
,
List
<
Repo
>
installed
,
List
<
Repo
>
others
)
{
public
ReposAdapter
(
List
<
Repo
>
update
,
List
<
Repo
>
installed
,
List
<
Repo
>
others
)
{
mUpdateRepos
=
update
;
mUpdateRepos
=
update
;
...
@@ -47,14 +45,7 @@ public class ReposAdapter extends RecyclerView.Adapter<ReposAdapter.ViewHolder>
...
@@ -47,14 +45,7 @@ public class ReposAdapter extends RecyclerView.Adapter<ReposAdapter.ViewHolder>
public
ViewHolder
onCreateViewHolder
(
ViewGroup
parent
,
int
viewType
)
{
public
ViewHolder
onCreateViewHolder
(
ViewGroup
parent
,
int
viewType
)
{
mView
=
LayoutInflater
.
from
(
parent
.
getContext
()).
inflate
(
R
.
layout
.
list_item_repo
,
parent
,
false
);
mView
=
LayoutInflater
.
from
(
parent
.
getContext
()).
inflate
(
R
.
layout
.
list_item_repo
,
parent
,
false
);
ButterKnife
.
bind
(
this
,
mView
);
ButterKnife
.
bind
(
this
,
mView
);
context
=
parent
.
getContext
();
mContext
=
parent
.
getContext
();
String
theme
=
PreferenceManager
.
getDefaultSharedPreferences
(
context
).
getString
(
"theme"
,
""
);
if
(
theme
.
equals
(
"Dark"
))
{
builder
=
new
AlertDialog
.
Builder
(
context
,
R
.
style
.
AlertDialog_dh
);
}
else
{
builder
=
new
AlertDialog
.
Builder
(
context
);
}
return
new
ViewHolder
(
mView
);
return
new
ViewHolder
(
mView
);
}
}
...
@@ -81,7 +72,7 @@ public class ReposAdapter extends RecyclerView.Adapter<ReposAdapter.ViewHolder>
...
@@ -81,7 +72,7 @@ public class ReposAdapter extends RecyclerView.Adapter<ReposAdapter.ViewHolder>
holder
.
versionName
.
setText
(
versionName
);
holder
.
versionName
.
setText
(
versionName
);
}
}
if
(
author
!=
null
)
{
if
(
author
!=
null
)
{
holder
.
author
.
setText
(
c
ontext
.
getString
(
R
.
string
.
author
,
author
));
holder
.
author
.
setText
(
mC
ontext
.
getString
(
R
.
string
.
author
,
author
));
}
}
if
(
description
!=
null
)
{
if
(
description
!=
null
)
{
holder
.
description
.
setText
(
description
);
holder
.
description
.
setText
(
description
);
...
@@ -90,12 +81,12 @@ public class ReposAdapter extends RecyclerView.Adapter<ReposAdapter.ViewHolder>
...
@@ -90,12 +81,12 @@ public class ReposAdapter extends RecyclerView.Adapter<ReposAdapter.ViewHolder>
View
.
OnClickListener
listener
=
view
->
{
View
.
OnClickListener
listener
=
view
->
{
if
(
view
.
getId
()
==
holder
.
updateImage
.
getId
())
{
if
(
view
.
getId
()
==
holder
.
updateImage
.
getId
())
{
String
filename
=
repo
.
getName
()
+
"-"
+
repo
.
getVersion
()
+
".zip"
;
String
filename
=
repo
.
getName
()
+
"-"
+
repo
.
getVersion
()
+
".zip"
;
b
uilder
MainActivity
.
alertB
uilder
.
setTitle
(
c
ontext
.
getString
(
R
.
string
.
repo_install_title
,
repo
.
getName
()))
.
setTitle
(
mC
ontext
.
getString
(
R
.
string
.
repo_install_title
,
repo
.
getName
()))
.
setMessage
(
c
ontext
.
getString
(
R
.
string
.
repo_install_msg
,
filename
))
.
setMessage
(
mC
ontext
.
getString
(
R
.
string
.
repo_install_msg
,
filename
))
.
setCancelable
(
true
)
.
setCancelable
(
true
)
.
setPositiveButton
(
R
.
string
.
download_install
,
(
dialogInterface
,
i
)
->
Utils
.
dlAndReceive
(
.
setPositiveButton
(
R
.
string
.
download_install
,
(
dialogInterface
,
i
)
->
Utils
.
dlAndReceive
(
c
ontext
,
mC
ontext
,
new
RepoDlReceiver
(),
new
RepoDlReceiver
(),
repo
.
getZipUrl
(),
repo
.
getZipUrl
(),
Utils
.
getLegalFilename
(
filename
)))
Utils
.
getLegalFilename
(
filename
)))
...
@@ -103,13 +94,13 @@ public class ReposAdapter extends RecyclerView.Adapter<ReposAdapter.ViewHolder>
...
@@ -103,13 +94,13 @@ public class ReposAdapter extends RecyclerView.Adapter<ReposAdapter.ViewHolder>
.
show
();
.
show
();
}
}
if
((
view
.
getId
()
==
holder
.
changeLog
.
getId
())
&&
(!
repo
.
getLogUrl
().
equals
(
""
)))
{
if
((
view
.
getId
()
==
holder
.
changeLog
.
getId
())
&&
(!
repo
.
getLogUrl
().
equals
(
""
)))
{
new
WebWindow
(
context
.
getString
(
R
.
string
.
changelog
),
repo
.
getLogUrl
(),
c
ontext
);
new
WebWindow
(
mContext
.
getString
(
R
.
string
.
changelog
),
repo
.
getLogUrl
(),
mC
ontext
);
}
}
if
((
view
.
getId
()
==
holder
.
authorLink
.
getId
())
&&
(!
repo
.
getSupportUrl
().
equals
(
""
)))
{
if
((
view
.
getId
()
==
holder
.
authorLink
.
getId
())
&&
(!
repo
.
getSupportUrl
().
equals
(
""
)))
{
c
ontext
.
startActivity
(
new
Intent
(
Intent
.
ACTION_VIEW
,
Uri
.
parse
(
repo
.
getDonateUrl
())));
mC
ontext
.
startActivity
(
new
Intent
(
Intent
.
ACTION_VIEW
,
Uri
.
parse
(
repo
.
getDonateUrl
())));
}
}
if
((
view
.
getId
()
==
holder
.
supportLink
.
getId
())
&&
(!
repo
.
getSupportUrl
().
equals
(
""
)))
{
if
((
view
.
getId
()
==
holder
.
supportLink
.
getId
())
&&
(!
repo
.
getSupportUrl
().
equals
(
""
)))
{
c
ontext
.
startActivity
(
new
Intent
(
Intent
.
ACTION_VIEW
,
Uri
.
parse
(
repo
.
getSupportUrl
())));
mC
ontext
.
startActivity
(
new
Intent
(
Intent
.
ACTION_VIEW
,
Uri
.
parse
(
repo
.
getSupportUrl
())));
}
}
};
};
...
@@ -145,7 +136,7 @@ public class ReposAdapter extends RecyclerView.Adapter<ReposAdapter.ViewHolder>
...
@@ -145,7 +136,7 @@ public class ReposAdapter extends RecyclerView.Adapter<ReposAdapter.ViewHolder>
public
ViewHolder
(
View
itemView
)
{
public
ViewHolder
(
View
itemView
)
{
super
(
itemView
);
super
(
itemView
);
WindowManager
windowmanager
=
(
WindowManager
)
c
ontext
.
getSystemService
(
Context
.
WINDOW_SERVICE
);
WindowManager
windowmanager
=
(
WindowManager
)
mC
ontext
.
getSystemService
(
Context
.
WINDOW_SERVICE
);
ButterKnife
.
bind
(
this
,
itemView
);
ButterKnife
.
bind
(
this
,
itemView
);
DisplayMetrics
dimension
=
new
DisplayMetrics
();
DisplayMetrics
dimension
=
new
DisplayMetrics
();
windowmanager
.
getDefaultDisplay
().
getMetrics
(
dimension
);
windowmanager
.
getDefaultDisplay
().
getMetrics
(
dimension
);
...
...
app/src/main/res/values-ar/strings.xml
View file @
b064c124
...
@@ -14,7 +14,7 @@
...
@@ -14,7 +14,7 @@
<string
name=
"magisk_version"
>
المثبت Magisk v%1$s
</string>
<string
name=
"magisk_version"
>
المثبت Magisk v%1$s
</string>
<string
name=
"magisk_version_error"
>
هل قمت بتثبيت Magisk؟
</string>
<string
name=
"magisk_version_error"
>
هل قمت بتثبيت Magisk؟
</string>
<string
name=
"magisk_update_available"
>
Magisk v%1$
s
تحديث!
</string>
<string
name=
"magisk_update_available"
>
Magisk v%1$
.1f
تحديث!
</string>
<string
name=
"cannot_check_updates"
>
لا يمكن التحقق من التحديثات
</string>
<string
name=
"cannot_check_updates"
>
لا يمكن التحقق من التحديثات
</string>
<string
name=
"up_to_date"
>
أحدث إصدار من %1$s مثبت
</string>
<string
name=
"up_to_date"
>
أحدث إصدار من %1$s مثبت
</string>
...
...
app/src/main/res/values-zh-rCN/strings.xml
View file @
b064c124
...
@@ -14,7 +14,7 @@
...
@@ -14,7 +14,7 @@
<string
name=
"magisk_version"
>
已安装 Magisk v%1$s
</string>
<string
name=
"magisk_version"
>
已安装 Magisk v%1$s
</string>
<string
name=
"magisk_version_error"
>
你是否已安装 Magisk?
</string>
<string
name=
"magisk_version_error"
>
你是否已安装 Magisk?
</string>
<string
name=
"magisk_update_available"
>
Magisk 可更新到 v%1$
s
!
</string>
<string
name=
"magisk_update_available"
>
Magisk 可更新到 v%1$
.1f
!
</string>
<string
name=
"cannot_check_updates"
>
无法检查更新
</string>
<string
name=
"cannot_check_updates"
>
无法检查更新
</string>
<string
name=
"up_to_date"
>
已安装最新版本的 %1$s
</string>
<string
name=
"up_to_date"
>
已安装最新版本的 %1$s
</string>
...
...
app/src/main/res/values/strings.xml
View file @
b064c124
...
@@ -85,7 +85,8 @@
...
@@ -85,7 +85,8 @@
<string
name=
"no_thanks"
>
No thanks
</string>
<string
name=
"no_thanks"
>
No thanks
</string>
<string
name=
"repo_install_title"
>
Install %1$s
</string>
<string
name=
"repo_install_title"
>
Install %1$s
</string>
<string
name=
"repo_install_msg"
>
Do you want to install %1$s ?
</string>
<string
name=
"repo_install_msg"
>
Do you want to install %1$s ?
</string>
<string
name=
"download_install"
>
Go to \"Install\" section
</string>
<string
name=
"download_install"
>
Download and install
</string>
<string
name=
"goto_install"
>
Go to \"Install\" section
</string>
<string
name=
"download_file_error"
>
Error downloading file
</string>
<string
name=
"download_file_error"
>
Error downloading file
</string>
<string
name=
"install_error"
>
Installation error!
</string>
<string
name=
"install_error"
>
Installation error!
</string>
<string
name=
"manual_install_1"
>
Zip file placed in %1$s
</string>
<string
name=
"manual_install_1"
>
Zip file placed in %1$s
</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