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
7b043861
Commit
7b043861
authored
Dec 03, 2018
by
topjohnwu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Patch app label when repackaging
parent
07bfdf3e
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
16 additions
and
4 deletions
+16
-4
AndroidManifest.xml
app/src/full/AndroidManifest.xml
+0
-1
PatchAPK.java
app/src/full/java/com/topjohnwu/magisk/asyncs/PatchAPK.java
+15
-1
AndroidManifest.xml
app/src/main/AndroidManifest.xml
+1
-1
AndroidManifest.xml
app/src/stub/AndroidManifest.xml
+0
-1
No files found.
app/src/full/AndroidManifest.xml
View file @
7b043861
...
...
@@ -21,7 +21,6 @@
android:exported=
"true"
/>
<activity
android:name=
"a.c"
android:label=
"@string/app_name"
android:configChanges=
"orientation|screenSize"
android:exported=
"true"
android:theme=
"@style/SplashTheme"
>
...
...
app/src/full/java/com/topjohnwu/magisk/asyncs/PatchAPK.java
View file @
7b043861
...
...
@@ -20,6 +20,7 @@ import com.topjohnwu.utils.SignAPK;
import
java.nio.ByteBuffer
;
import
java.nio.ByteOrder
;
import
java.nio.CharBuffer
;
import
java.nio.IntBuffer
;
import
java.security.SecureRandom
;
import
java.util.jar.JarEntry
;
...
...
@@ -80,6 +81,18 @@ public class PatchAPK {
return
true
;
}
private
static
boolean
findAndPatch
(
byte
xml
[],
int
a
,
int
b
)
{
IntBuffer
buf
=
ByteBuffer
.
wrap
(
xml
).
order
(
ByteOrder
.
LITTLE_ENDIAN
).
asIntBuffer
();
int
len
=
xml
.
length
/
4
;
for
(
int
i
=
0
;
i
<
len
;
++
i
)
{
if
(
buf
.
get
(
i
)
==
a
)
{
buf
.
put
(
i
,
b
);
return
true
;
}
}
return
false
;
}
private
static
boolean
patchAndHide
()
{
MagiskManager
mm
=
Data
.
MM
();
...
...
@@ -115,7 +128,8 @@ public class PatchAPK {
byte
xml
[]
=
apk
.
getRawData
(
je
);
if
(!
findAndPatch
(
xml
,
from
,
to
)
||
!
findAndPatch
(
xml
,
from
+
".provider"
,
to
+
".provider"
))
!
findAndPatch
(
xml
,
from
+
".provider"
,
to
+
".provider"
)
||
!
findAndPatch
(
xml
,
R
.
string
.
app_name
,
R
.
string
.
re_app_name
))
return
false
;
// Write in changes
...
...
app/src/main/AndroidManifest.xml
View file @
7b043861
...
...
@@ -13,7 +13,7 @@
android:allowBackup=
"false"
android:directBootAware=
"true"
android:icon=
"@drawable/ic_launcher"
android:label=
"@string/
re_
app_name"
android:label=
"@string/app_name"
android:supportsRtl=
"true"
tools:ignore=
"GoogleAppIndexingWarning,UnusedAttribute"
>
...
...
app/src/stub/AndroidManifest.xml
View file @
7b043861
...
...
@@ -6,7 +6,6 @@
<application
tools:ignore=
"GoogleAppIndexingWarning"
>
<activity
android:label=
"@string/app_name"
android:name=
".MainActivity"
android:theme=
"@android:style/Theme.Translucent.NoTitleBar"
>
<intent-filter>
...
...
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