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
123f39a2
Commit
123f39a2
authored
Jan 10, 2017
by
topjohnwu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
We can see the token through logs anyway, no need to encrypt
parent
cadab127
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
2 additions
and
28 deletions
+2
-28
ModuleHelper.java
...rc/main/java/com/topjohnwu/magisk/utils/ModuleHelper.java
+1
-1
Utils.java
app/src/main/java/com/topjohnwu/magisk/utils/Utils.java
+0
-26
strings.xml
app/src/main/res/values/strings.xml
+1
-1
No files found.
app/src/main/java/com/topjohnwu/magisk/utils/ModuleHelper.java
View file @
123f39a2
...
@@ -82,7 +82,7 @@ public class ModuleHelper {
...
@@ -82,7 +82,7 @@ public class ModuleHelper {
}
}
// Making a request to url and getting response
// Making a request to url and getting response
jsonString
=
WebRequest
.
makeWebServiceCall
(
context
.
getString
(
R
.
string
.
url_main
,
Utils
.
getToken
()
),
WebRequest
.
GET
);
jsonString
=
WebRequest
.
makeWebServiceCall
(
context
.
getString
(
R
.
string
.
url_main
),
WebRequest
.
GET
);
if
(
jsonString
!=
null
&&
!
jsonString
.
isEmpty
())
{
if
(
jsonString
!=
null
&&
!
jsonString
.
isEmpty
())
{
// Have internet access
// Have internet access
...
...
app/src/main/java/com/topjohnwu/magisk/utils/Utils.java
View file @
123f39a2
...
@@ -37,9 +37,6 @@ public class Utils {
...
@@ -37,9 +37,6 @@ public class Utils {
public
static
boolean
isDownloading
=
false
;
public
static
boolean
isDownloading
=
false
;
public
static
boolean
isDarkTheme
;
public
static
boolean
isDarkTheme
;
private
static
final
String
cryptoPass
=
"MagiskRox666"
;
private
static
final
String
secret
=
"GTYybRBTYf5his9kQ16ZNO7qgkBJ/5MyVe4CGceAOIoXgSnnk8FTd4F1dE9p5Eus"
;
public
static
boolean
itemExist
(
String
path
)
{
public
static
boolean
itemExist
(
String
path
)
{
return
itemExist
(
true
,
path
);
return
itemExist
(
true
,
path
);
}
}
...
@@ -118,29 +115,6 @@ public class Utils {
...
@@ -118,29 +115,6 @@ public class Utils {
context
.
registerReceiver
(
receiver
,
new
IntentFilter
(
DownloadManager
.
ACTION_DOWNLOAD_COMPLETE
));
context
.
registerReceiver
(
receiver
,
new
IntentFilter
(
DownloadManager
.
ACTION_DOWNLOAD_COMPLETE
));
}
}
public
static
String
getToken
()
{
try
{
DESKeySpec
keySpec
=
new
DESKeySpec
(
cryptoPass
.
getBytes
(
"UTF8"
));
SecretKeyFactory
keyFactory
=
SecretKeyFactory
.
getInstance
(
"DES"
);
SecretKey
key
=
keyFactory
.
generateSecret
(
keySpec
);
byte
[]
encrypedPwdBytes
=
Base64
.
decode
(
secret
,
Base64
.
DEFAULT
);
// cipher is not thread safe
Cipher
cipher
=
Cipher
.
getInstance
(
"DES"
);
cipher
.
init
(
Cipher
.
DECRYPT_MODE
,
key
);
byte
[]
decrypedValueBytes
=
(
cipher
.
doFinal
(
encrypedPwdBytes
));
return
new
String
(
decrypedValueBytes
);
}
catch
(
InvalidKeyException
|
UnsupportedEncodingException
|
NoSuchAlgorithmException
|
BadPaddingException
|
NoSuchPaddingException
|
IllegalBlockSizeException
|
InvalidKeySpecException
e
)
{
e
.
printStackTrace
();
}
return
secret
;
}
public
static
String
getLegalFilename
(
CharSequence
filename
)
{
public
static
String
getLegalFilename
(
CharSequence
filename
)
{
return
filename
.
toString
().
replace
(
" "
,
"_"
).
replace
(
"'"
,
""
).
replace
(
"\""
,
""
)
return
filename
.
toString
().
replace
(
" "
,
"_"
).
replace
(
"'"
,
""
).
replace
(
"\""
,
""
)
.
replace
(
"$"
,
""
).
replace
(
"`"
,
""
).
replace
(
"("
,
""
).
replace
(
")"
,
""
)
.
replace
(
"$"
,
""
).
replace
(
"`"
,
""
).
replace
(
"("
,
""
).
replace
(
")"
,
""
)
...
...
app/src/main/res/values/strings.xml
View file @
123f39a2
...
@@ -111,7 +111,7 @@
...
@@ -111,7 +111,7 @@
<string
name=
"check_release_notes"
>
Check release notes
</string>
<string
name=
"check_release_notes"
>
Check release notes
</string>
<!--URL Templates-->
<!--URL Templates-->
<string
name=
"url_main"
translatable=
"false"
>
https://api.github.com/orgs/Magisk-Modules-Repo/repos?access_token=
%1$s
</string>
<string
name=
"url_main"
translatable=
"false"
>
https://api.github.com/orgs/Magisk-Modules-Repo/repos?access_token=
8f3c379fbeb80754b45b02486482584893af142a
</string>
<string
name=
"file_url"
translatable=
"false"
>
https://raw.githubusercontent.com/Magisk-Modules-Repo/%1$s/master/%2$s
</string>
<string
name=
"file_url"
translatable=
"false"
>
https://raw.githubusercontent.com/Magisk-Modules-Repo/%1$s/master/%2$s
</string>
<string
name=
"zip_url"
translatable=
"false"
>
https://github.com/Magisk-Modules-Repo/%1$s/archive/master.zip
</string>
<string
name=
"zip_url"
translatable=
"false"
>
https://github.com/Magisk-Modules-Repo/%1$s/archive/master.zip
</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