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
ffec9a4d
Commit
ffec9a4d
authored
Feb 02, 2022
by
topjohnwu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Minor changes
parent
9b18960b
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
7 deletions
+6
-7
DynLoad.java
stub/src/main/java/com/topjohnwu/magisk/DynLoad.java
+6
-7
No files found.
stub/src/main/java/com/topjohnwu/magisk/DynLoad.java
View file @
ffec9a4d
...
@@ -95,16 +95,15 @@ public class DynLoad {
...
@@ -95,16 +95,15 @@ public class DynLoad {
}
}
}
}
// Dynamically load APK, inject ClassLoader into ContextImpl, then
// Dynamically load APK and create the Application instance from the loaded APK
// create the non-stub Application instance from the loaded APK
static
Application
createApp
(
Context
context
)
{
static
Application
createApp
(
Context
context
)
{
File
apk
=
StubApk
.
current
(
context
);
loadApk
(
context
.
getApplicationInfo
());
// Trigger folder creation
// Trigger folder creation
context
.
getExternalFilesDir
(
null
);
context
.
getExternalFilesDir
(
null
);
// If no APK to load, attempt to copy from previous app
File
apk
=
StubApk
.
current
(
context
);
loadApk
(
context
.
getApplicationInfo
());
// If no APK is loaded, attempt to copy from previous app
if
(!
isDynLoader
()
&&
!
context
.
getPackageName
().
equals
(
APPLICATION_ID
))
{
if
(!
isDynLoader
()
&&
!
context
.
getPackageName
().
equals
(
APPLICATION_ID
))
{
try
{
try
{
var
info
=
context
.
getPackageManager
().
getApplicationInfo
(
APPLICATION_ID
,
0
);
var
info
=
context
.
getPackageManager
().
getApplicationInfo
(
APPLICATION_ID
,
0
);
...
@@ -185,7 +184,7 @@ public class DynLoad {
...
@@ -185,7 +184,7 @@ public class DynLoad {
mcl
.
set
(
loadedApk
,
new
DelegateClassLoader
());
mcl
.
set
(
loadedApk
,
new
DelegateClassLoader
());
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
// Actually impossible as this method is only called on API < 29,
// Actually impossible as this method is only called on API < 29,
// and API 21 - 28 do not restrict access to these
methods/
fields.
// and API 21 - 28 do not restrict access to these fields.
Log
.
e
(
DynLoad
.
class
.
getSimpleName
(),
""
,
e
);
Log
.
e
(
DynLoad
.
class
.
getSimpleName
(),
""
,
e
);
}
}
}
}
...
...
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