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
271b0287
Commit
271b0287
authored
Oct 20, 2019
by
topjohnwu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Pass in stub version just in case
parent
96a8a2a8
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
3 deletions
+9
-3
DynAPK.java
shared/src/main/java/com/topjohnwu/magisk/utils/DynAPK.java
+9
-3
No files found.
shared/src/main/java/com/topjohnwu/magisk/utils/DynAPK.java
View file @
271b0287
...
@@ -7,9 +7,12 @@ import java.util.Map;
...
@@ -7,9 +7,12 @@ import java.util.Map;
public
class
DynAPK
{
public
class
DynAPK
{
private
static
final
int
STUB_VERSION
=
1
;
// Indices of the object array
// Indices of the object array
private
static
final
int
COMPONENT_MAP
=
0
;
private
static
final
int
STUB_VERSION_ENTRY
=
0
;
private
static
final
int
RESOURCE_MAP
=
1
;
private
static
final
int
COMPONENT_MAP
=
1
;
private
static
final
int
RESOURCE_MAP
=
2
;
// Indices of the resource map
// Indices of the resource map
public
static
final
int
NOTIFICATION
=
0
;
public
static
final
int
NOTIFICATION
=
0
;
...
@@ -39,19 +42,22 @@ public class DynAPK {
...
@@ -39,19 +42,22 @@ public class DynAPK {
public
static
Data
load
(
Object
o
)
{
public
static
Data
load
(
Object
o
)
{
Object
[]
arr
=
(
Object
[])
o
;
Object
[]
arr
=
(
Object
[])
o
;
Data
data
=
new
Data
();
Data
data
=
new
Data
();
data
.
version
=
(
int
)
arr
[
STUB_VERSION_ENTRY
];
data
.
componentMap
=
(
Map
<
String
,
String
>)
arr
[
COMPONENT_MAP
];
data
.
componentMap
=
(
Map
<
String
,
String
>)
arr
[
COMPONENT_MAP
];
data
.
resourceMap
=
(
int
[])
arr
[
RESOURCE_MAP
];
data
.
resourceMap
=
(
int
[])
arr
[
RESOURCE_MAP
];
return
data
;
return
data
;
}
}
public
static
Object
pack
(
Data
data
)
{
public
static
Object
pack
(
Data
data
)
{
Object
[]
arr
=
new
Object
[
2
];
Object
[]
arr
=
new
Object
[
3
];
arr
[
STUB_VERSION_ENTRY
]
=
STUB_VERSION
;
arr
[
COMPONENT_MAP
]
=
data
.
componentMap
;
arr
[
COMPONENT_MAP
]
=
data
.
componentMap
;
arr
[
RESOURCE_MAP
]
=
data
.
resourceMap
;
arr
[
RESOURCE_MAP
]
=
data
.
resourceMap
;
return
arr
;
return
arr
;
}
}
public
static
class
Data
{
public
static
class
Data
{
public
int
version
;
public
Map
<
String
,
String
>
componentMap
;
public
Map
<
String
,
String
>
componentMap
;
public
int
[]
resourceMap
;
public
int
[]
resourceMap
;
}
}
...
...
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