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
e90c555c
Commit
e90c555c
authored
Jul 31, 2018
by
topjohnwu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Some cleanups
parent
863b9a41
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
13 additions
and
15 deletions
+13
-15
Data.java
app/src/full/java/com/topjohnwu/magisk/Data.java
+1
-6
MagiskManager.java
app/src/full/java/com/topjohnwu/magisk/MagiskManager.java
+0
-1
InstallMagisk.java
.../full/java/com/topjohnwu/magisk/asyncs/InstallMagisk.java
+3
-2
LocaleManager.java
...c/full/java/com/topjohnwu/magisk/utils/LocaleManager.java
+6
-6
app_settings.xml
app/src/full/res/xml/app_settings.xml
+2
-0
strings.xml
app/src/main/res/values/strings.xml
+1
-0
No files found.
app/src/full/java/com/topjohnwu/magisk/Data.java
View file @
e90c555c
...
@@ -52,9 +52,7 @@ public class Data {
...
@@ -52,9 +52,7 @@ public class Data {
public
static
int
suResponseType
;
public
static
int
suResponseType
;
public
static
int
suNotificationType
;
public
static
int
suNotificationType
;
public
static
int
suNamespaceMode
;
public
static
int
suNamespaceMode
;
public
static
String
localeConfig
;
public
static
int
updateChannel
;
public
static
int
updateChannel
;
public
static
String
bootFormat
;
public
static
int
repoOrder
;
public
static
int
repoOrder
;
public
static
void
loadMagiskInfo
()
{
public
static
void
loadMagiskInfo
()
{
...
@@ -154,8 +152,7 @@ public class Data {
...
@@ -154,8 +152,7 @@ public class Data {
// config
// config
isDarkTheme
=
mm
.
prefs
.
getBoolean
(
Const
.
Key
.
DARK_THEME
,
false
);
isDarkTheme
=
mm
.
prefs
.
getBoolean
(
Const
.
Key
.
DARK_THEME
,
false
);
updateChannel
=
Utils
.
getPrefsInt
(
mm
.
prefs
,
Const
.
Key
.
UPDATE_CHANNEL
,
Const
.
Value
.
STABLE_CHANNEL
);
updateChannel
=
Utils
.
getPrefsInt
(
mm
.
prefs
,
Const
.
Key
.
UPDATE_CHANNEL
,
Const
.
Value
.
STABLE_CHANNEL
);
bootFormat
=
mm
.
prefs
.
getString
(
Const
.
Key
.
BOOT_FORMAT
,
".img"
);
repoOrder
=
mm
.
prefs
.
getInt
(
Const
.
Key
.
REPO_ORDER
,
Const
.
Value
.
ORDER_DATE
);
repoOrder
=
mm
.
prefs
.
getInt
(
Const
.
Key
.
REPO_ORDER
,
Const
.
Value
.
ORDER_NAME
);
}
}
public
static
void
writeConfig
()
{
public
static
void
writeConfig
()
{
...
@@ -171,8 +168,6 @@ public class Data {
...
@@ -171,8 +168,6 @@ public class Data {
.
putString
(
Const
.
Key
.
SU_MULTIUSER_MODE
,
String
.
valueOf
(
multiuserMode
))
.
putString
(
Const
.
Key
.
SU_MULTIUSER_MODE
,
String
.
valueOf
(
multiuserMode
))
.
putString
(
Const
.
Key
.
SU_MNT_NS
,
String
.
valueOf
(
suNamespaceMode
))
.
putString
(
Const
.
Key
.
SU_MNT_NS
,
String
.
valueOf
(
suNamespaceMode
))
.
putString
(
Const
.
Key
.
UPDATE_CHANNEL
,
String
.
valueOf
(
updateChannel
))
.
putString
(
Const
.
Key
.
UPDATE_CHANNEL
,
String
.
valueOf
(
updateChannel
))
.
putString
(
Const
.
Key
.
LOCALE
,
localeConfig
)
.
putString
(
Const
.
Key
.
BOOT_FORMAT
,
bootFormat
)
.
putInt
(
Const
.
Key
.
UPDATE_SERVICE_VER
,
Const
.
UPDATE_SERVICE_VER
)
.
putInt
(
Const
.
Key
.
UPDATE_SERVICE_VER
,
Const
.
UPDATE_SERVICE_VER
)
.
putInt
(
Const
.
Key
.
REPO_ORDER
,
repoOrder
)
.
putInt
(
Const
.
Key
.
REPO_ORDER
,
repoOrder
)
.
apply
();
.
apply
();
...
...
app/src/full/java/com/topjohnwu/magisk/MagiskManager.java
View file @
e90c555c
...
@@ -44,7 +44,6 @@ public class MagiskManager extends ContainerApp {
...
@@ -44,7 +44,6 @@ public class MagiskManager extends ContainerApp {
prefs
=
PreferenceManager
.
getDefaultSharedPreferences
(
this
);
prefs
=
PreferenceManager
.
getDefaultSharedPreferences
(
this
);
mDB
=
MagiskDatabaseHelper
.
getInstance
(
this
);
mDB
=
MagiskDatabaseHelper
.
getInstance
(
this
);
LocaleManager
.
locale
=
LocaleManager
.
defaultLocale
=
Locale
.
getDefault
();
String
pkg
=
mDB
.
getStrings
(
Const
.
Key
.
SU_MANAGER
,
null
);
String
pkg
=
mDB
.
getStrings
(
Const
.
Key
.
SU_MANAGER
,
null
);
if
(
pkg
!=
null
&&
getPackageName
().
equals
(
Const
.
ORIG_PKG_NAME
))
{
if
(
pkg
!=
null
&&
getPackageName
().
equals
(
Const
.
ORIG_PKG_NAME
))
{
...
...
app/src/full/java/com/topjohnwu/magisk/asyncs/InstallMagisk.java
View file @
e90c555c
...
@@ -231,10 +231,11 @@ public class InstallMagisk extends ParallelTask<Void, Void, Boolean> {
...
@@ -231,10 +231,11 @@ public class InstallMagisk extends ParallelTask<Void, Void, Boolean> {
private
void
outputBoot
(
File
patched
)
throws
IOException
{
private
void
outputBoot
(
File
patched
)
throws
IOException
{
switch
(
mode
)
{
switch
(
mode
)
{
case
PATCH_MODE:
case
PATCH_MODE:
File
dest
=
new
File
(
Download
.
EXTERNAL_PATH
,
"patched_boot"
+
Data
.
bootFormat
);
String
fmt
=
mm
.
prefs
.
getString
(
Const
.
Key
.
BOOT_FORMAT
,
".img"
);
File
dest
=
new
File
(
Download
.
EXTERNAL_PATH
,
"patched_boot"
+
fmt
);
dest
.
getParentFile
().
mkdirs
();
dest
.
getParentFile
().
mkdirs
();
OutputStream
out
;
OutputStream
out
;
switch
(
Data
.
bootForma
t
)
{
switch
(
fm
t
)
{
case
".img.tar"
:
case
".img.tar"
:
out
=
new
TarOutputStream
(
new
BufferedOutputStream
(
new
FileOutputStream
(
dest
)));
out
=
new
TarOutputStream
(
new
BufferedOutputStream
(
new
FileOutputStream
(
dest
)));
((
TarOutputStream
)
out
).
putNextEntry
(
new
TarEntry
(
patched
,
"boot.img"
));
((
TarOutputStream
)
out
).
putNextEntry
(
new
TarEntry
(
patched
,
"boot.img"
));
...
...
app/src/full/java/com/topjohnwu/magisk/utils/LocaleManager.java
View file @
e90c555c
...
@@ -17,20 +17,20 @@ import java.util.List;
...
@@ -17,20 +17,20 @@ import java.util.List;
import
java.util.Locale
;
import
java.util.Locale
;
public
class
LocaleManager
{
public
class
LocaleManager
{
public
static
Locale
locale
;
public
static
Locale
locale
=
Locale
.
getDefault
()
;
public
static
Locale
defaultLocale
;
public
final
static
Locale
defaultLocale
=
Locale
.
getDefault
()
;
public
static
List
<
Locale
>
locales
;
public
static
List
<
Locale
>
locales
;
public
static
void
setLocale
()
{
public
static
void
setLocale
()
{
MagiskManager
mm
=
Data
.
MM
();
MagiskManager
mm
=
Data
.
MM
();
Data
.
localeConfig
=
mm
.
prefs
.
getString
(
Const
.
Key
.
LOCALE
,
""
);
String
localeConfig
=
mm
.
prefs
.
getString
(
Const
.
Key
.
LOCALE
,
""
);
if
(
Data
.
localeConfig
.
isEmpty
())
{
if
(
localeConfig
.
isEmpty
())
{
locale
=
defaultLocale
;
locale
=
defaultLocale
;
}
else
{
}
else
{
locale
=
Locale
.
forLanguageTag
(
Data
.
localeConfig
);
locale
=
Locale
.
forLanguageTag
(
localeConfig
);
}
}
Resources
res
=
mm
.
getResources
();
Resources
res
=
mm
.
getResources
();
Configuration
config
=
new
Configuration
(
res
.
getConfiguration
()
);
Configuration
config
=
res
.
getConfiguration
(
);
config
.
setLocale
(
locale
);
config
.
setLocale
(
locale
);
res
.
updateConfiguration
(
config
,
res
.
getDisplayMetrics
());
res
.
updateConfiguration
(
config
,
res
.
getDisplayMetrics
());
}
}
...
...
app/src/full/res/xml/app_settings.xml
View file @
e90c555c
...
@@ -12,6 +12,7 @@
...
@@ -12,6 +12,7 @@
<ListPreference
<ListPreference
android:key=
"locale"
android:key=
"locale"
android:defaultValue=
"@string/empty"
android:title=
"@string/language"
/>
android:title=
"@string/language"
/>
<Preference
<Preference
...
@@ -52,6 +53,7 @@
...
@@ -52,6 +53,7 @@
android:title=
"@string/settings_boot_format_title"
android:title=
"@string/settings_boot_format_title"
android:entries=
"@array/boot_formats"
android:entries=
"@array/boot_formats"
android:entryValues=
"@array/boot_formats"
android:entryValues=
"@array/boot_formats"
android:defaultValue=
".img"
android:summary=
"@string/settings_boot_format_summary"
/>
android:summary=
"@string/settings_boot_format_summary"
/>
</PreferenceCategory>
</PreferenceCategory>
...
...
app/src/main/res/values/strings.xml
View file @
e90c555c
...
@@ -5,6 +5,7 @@
...
@@ -5,6 +5,7 @@
<string
name=
"app_name"
translatable=
"false"
>
Magisk Manager
</string>
<string
name=
"app_name"
translatable=
"false"
>
Magisk Manager
</string>
<string
name=
"magisk"
translatable=
"false"
>
Magisk
</string>
<string
name=
"magisk"
translatable=
"false"
>
Magisk
</string>
<string
name=
"magiskhide"
translatable=
"false"
>
Magisk Hide
</string>
<string
name=
"magiskhide"
translatable=
"false"
>
Magisk Hide
</string>
<string
name=
"empty"
translatable=
"false"
/>
<!--Used in both stub and full app-->
<!--Used in both stub and full app-->
<string
name=
"download_file_error"
>
Error downloading file
</string>
<string
name=
"download_file_error"
>
Error downloading file
</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