Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
A
android_frameworks_base
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
open-source
android_frameworks_base
Commits
71abb014
Commit
71abb014
authored
Oct 15, 2020
by
aldrin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
TAG change DREAMLAND_TAG
parent
5c122f52
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
8 deletions
+8
-8
Application.java
core/java/android/app/Application.java
+8
-8
No files found.
core/java/android/app/Application.java
View file @
71abb014
...
...
@@ -353,29 +353,29 @@ public class Application extends ContextWrapper implements ComponentCallbacks2 {
*/
private
static
AtomicBoolean
hasInited
=
new
AtomicBoolean
(
false
);
private
static
final
String
TAG
=
"LOAD_DREAMLAND"
;
private
static
final
String
DREAMLAND_
TAG
=
"LOAD_DREAMLAND"
;
@UnsupportedAppUsage
/* package */
final
void
attach
(
Context
context
)
{
if
(
hasInited
.
compareAndSet
(
false
,
true
))
{
Log
.
i
(
TAG
,
"attach: "
+
context
.
getPackageName
());
Log
.
i
(
DREAMLAND_
TAG
,
"attach: "
+
context
.
getPackageName
());
PackageInfo
runtimePkg
=
findDreamlandApkFromInstalled
(
context
);
if
(
runtimePkg
==
null
){
Log
.
w
(
TAG
,
"未找到 dreamland 运行时apk,请安装!"
);
Log
.
w
(
DREAMLAND_
TAG
,
"未找到 dreamland 运行时apk,请安装!"
);
}
else
{
String
targetPackageSourceDir
=
runtimePkg
.
applicationInfo
.
publicSourceDir
;
String
nativeLibraryDir
=
runtimePkg
.
applicationInfo
.
nativeLibraryDir
;
Log
.
i
(
TAG
,
"load apk path: "
+
targetPackageSourceDir
);
Log
.
i
(
TAG
,
"load native path: "
+
nativeLibraryDir
);
Log
.
i
(
DREAMLAND_
TAG
,
"load apk path: "
+
targetPackageSourceDir
);
Log
.
i
(
DREAMLAND_
TAG
,
"load native path: "
+
nativeLibraryDir
);
String
dexDir
=
dexDir
(
context
).
getAbsolutePath
();
try
{
ClassLoader
classLoader
=
new
DexClassLoader
(
targetPackageSourceDir
,
dexDir
,
nativeLibraryDir
,
context
.
getClassLoader
());
Class
<?>
runtimeClass
=
classLoader
.
loadClass
(
"com.dreamland.runtime.DreamlandRuntime"
);
Method
method
=
runtimeClass
.
getDeclaredMethod
(
"callApplicationAttach"
,
Context
.
class
);
method
.
invoke
(
null
,
context
);
Log
.
i
(
TAG
,
"加载 runtime 成功"
);
Log
.
i
(
DREAMLAND_
TAG
,
"加载 runtime 成功"
);
}
catch
(
Exception
e
){
Log
.
e
(
TAG
,
"加载模块发生异常"
,
e
);
Log
.
e
(
DREAMLAND_
TAG
,
"加载模块发生异常"
,
e
);
}
}
}
...
...
@@ -386,7 +386,7 @@ public class Application extends ContextWrapper implements ComponentCallbacks2 {
private
static
PackageInfo
findDreamlandApkFromInstalled
(
Context
context
)
{
PackageManager
packageManager
=
context
.
getPackageManager
();
if
(
packageManager
==
null
){
Log
.
w
(
TAG
,
"packageManager 为 null"
);
Log
.
w
(
DREAMLAND_
TAG
,
"packageManager 为 null"
);
return
null
;
}
for
(
PackageInfo
pkg
:
packageManager
.
getInstalledPackages
(
PackageManager
.
GET_META_DATA
))
{
...
...
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