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
5e87483f
Commit
5e87483f
authored
Oct 29, 2019
by
topjohnwu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move addAssetPath to shared
parent
f7aa4515
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
5 deletions
+12
-5
Hacks.kt
app/src/main/java/com/topjohnwu/magisk/Hacks.kt
+1
-5
DynAPK.java
shared/src/main/java/com/topjohnwu/magisk/DynAPK.java
+11
-0
No files found.
app/src/main/java/com/topjohnwu/magisk/Hacks.kt
View file @
5e87483f
...
...
@@ -27,12 +27,8 @@ import com.topjohnwu.magisk.utils.currentLocale
import
com.topjohnwu.magisk.utils.defaultLocale
import
java.util.*
private
val
addAssetPath
by
lazy
{
AssetManager
::
class
.
java
.
getMethod
(
"addAssetPath"
,
String
::
class
.
java
)
}
fun
AssetManager
.
addAssetPath
(
path
:
String
)
{
addAssetPath
.
invoke
(
this
,
path
)
DynAPK
.
addAssetPath
(
this
,
path
)
}
fun
Context
.
wrap
(
global
:
Boolean
=
true
):
Context
...
...
shared/src/main/java/com/topjohnwu/magisk/DynAPK.java
View file @
5e87483f
package
com
.
topjohnwu
.
magisk
;
import
android.content.Context
;
import
android.content.res.AssetManager
;
import
java.io.File
;
import
java.lang.reflect.Method
;
import
java.util.Map
;
import
static
android
.
os
.
Build
.
VERSION
.
SDK_INT
;
...
...
@@ -24,6 +26,7 @@ public class DynAPK {
public
static
final
int
MAGISKHIDE
=
4
;
private
static
File
dynDir
;
private
static
Method
addAssetPath
;
private
static
File
getDynDir
(
Context
c
)
{
if
(
dynDir
==
null
)
{
...
...
@@ -62,6 +65,14 @@ public class DynAPK {
return
arr
;
}
public
static
void
addAssetPath
(
AssetManager
asset
,
String
path
)
{
try
{
if
(
addAssetPath
==
null
)
addAssetPath
=
AssetManager
.
class
.
getMethod
(
"addAssetPath"
,
String
.
class
);
addAssetPath
.
invoke
(
asset
,
path
);
}
catch
(
Exception
ignored
)
{}
}
public
static
class
Data
{
public
int
version
;
public
Map
<
String
,
String
>
componentMap
;
...
...
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