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
a2c1b024
Commit
a2c1b024
authored
Apr 22, 2018
by
topjohnwu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use 32-bit binaries only
parent
3d865394
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
16 additions
and
19 deletions
+16
-19
app
app
+1
-1
build.py
build.py
+5
-5
Android.mk
native/jni/Android.mk
+1
-5
Application.mk
native/jni/Application.mk
+1
-1
flash_script.sh
scripts/flash_script.sh
+2
-2
util_functions.sh
scripts/util_functions.sh
+6
-5
No files found.
app
@
267395bf
Subproject commit
6764a98409fac8da30218ec87b7f7e6fcfcef4c9
Subproject commit
267395bfa2b5077717aadcc3cdd0634443fbad03
build.py
View file @
a2c1b024
...
@@ -93,7 +93,7 @@ def build_binary(args):
...
@@ -93,7 +93,7 @@ def build_binary(args):
error
(
'Build Magisk binary failed!'
)
error
(
'Build Magisk binary failed!'
)
print
(
''
)
print
(
''
)
for
arch
in
[
'arm
64-v8a'
,
'armeabi-v7a'
,
'x86'
,
'x86_64
'
]:
for
arch
in
[
'arm
eabi-v7a'
,
'x86
'
]:
mkdir_p
(
os
.
path
.
join
(
'out'
,
arch
))
mkdir_p
(
os
.
path
.
join
(
'out'
,
arch
))
with
open
(
os
.
path
.
join
(
'out'
,
arch
,
'dump.h'
),
'w'
)
as
dump
:
with
open
(
os
.
path
.
join
(
'out'
,
arch
,
'dump.h'
),
'w'
)
as
dump
:
dump
.
write
(
'#include "stdlib.h"
\n
'
)
dump
.
write
(
'#include "stdlib.h"
\n
'
)
...
@@ -110,7 +110,7 @@ def build_binary(args):
...
@@ -110,7 +110,7 @@ def build_binary(args):
error
(
'Build Magisk binary failed!'
)
error
(
'Build Magisk binary failed!'
)
print
(
''
)
print
(
''
)
for
arch
in
[
'arm
64-v8a'
,
'armeabi-v7a'
,
'x86'
,
'x86_64
'
]:
for
arch
in
[
'arm
eabi-v7a'
,
'x86
'
]:
for
binary
in
[
'magiskinit'
,
'magiskboot'
,
'b64xz'
,
'busybox'
]:
for
binary
in
[
'magiskinit'
,
'magiskboot'
,
'b64xz'
,
'busybox'
]:
try
:
try
:
mv
(
os
.
path
.
join
(
'native'
,
'libs'
,
arch
,
binary
),
os
.
path
.
join
(
'out'
,
arch
,
binary
))
mv
(
os
.
path
.
join
(
'native'
,
'libs'
,
arch
,
binary
),
os
.
path
.
join
(
'out'
,
arch
,
binary
))
...
@@ -234,7 +234,7 @@ def zip_main(args):
...
@@ -234,7 +234,7 @@ def zip_main(args):
zip_with_msg
(
zipf
,
source
,
target
)
zip_with_msg
(
zipf
,
source
,
target
)
# Binaries
# Binaries
for
lib_dir
,
zip_dir
in
[(
'arm
64-v8a'
,
'arm64'
),
(
'armeabi-v7a'
,
'arm'
),
(
'x86'
,
'x86'
),
(
'x86_64'
,
'x64
'
)]:
for
lib_dir
,
zip_dir
in
[(
'arm
eabi-v7a'
,
'arm'
),
(
'x86'
,
'x86
'
)]:
for
binary
in
[
'magiskinit'
,
'magiskboot'
]:
for
binary
in
[
'magiskinit'
,
'magiskboot'
]:
source
=
os
.
path
.
join
(
'out'
,
lib_dir
,
binary
)
source
=
os
.
path
.
join
(
'out'
,
lib_dir
,
binary
)
target
=
os
.
path
.
join
(
zip_dir
,
binary
)
target
=
os
.
path
.
join
(
zip_dir
,
binary
)
...
@@ -261,7 +261,7 @@ def zip_main(args):
...
@@ -261,7 +261,7 @@ def zip_main(args):
zipf
.
writestr
(
target
,
util_func
)
zipf
.
writestr
(
target
,
util_func
)
# addon.d.sh
# addon.d.sh
source
=
os
.
path
.
join
(
'scripts'
,
'addon.d.sh'
)
source
=
os
.
path
.
join
(
'scripts'
,
'addon.d.sh'
)
target
=
os
.
path
.
join
(
'
addon.d
'
,
'99-magisk.sh'
)
target
=
os
.
path
.
join
(
'
common
'
,
'99-magisk.sh'
)
zip_with_msg
(
zipf
,
source
,
target
)
zip_with_msg
(
zipf
,
source
,
target
)
# Prebuilts
# Prebuilts
...
@@ -291,7 +291,7 @@ def zip_uninstaller(args):
...
@@ -291,7 +291,7 @@ def zip_uninstaller(args):
zip_with_msg
(
zipf
,
source
,
target
)
zip_with_msg
(
zipf
,
source
,
target
)
# Binaries
# Binaries
for
lib_dir
,
zip_dir
in
[(
'arm
64-v8a'
,
'arm64'
),
(
'armeabi-v7a'
,
'arm'
),
(
'x86'
,
'x86'
),
(
'x86_64'
,
'x64
'
)]:
for
lib_dir
,
zip_dir
in
[(
'arm
eabi-v7a'
,
'arm'
),
(
'x86'
,
'x86
'
)]:
source
=
os
.
path
.
join
(
'out'
,
lib_dir
,
'magiskboot'
)
source
=
os
.
path
.
join
(
'out'
,
lib_dir
,
'magiskboot'
)
target
=
os
.
path
.
join
(
zip_dir
,
'magiskboot'
)
target
=
os
.
path
.
join
(
zip_dir
,
'magiskboot'
)
zip_with_msg
(
zipf
,
source
,
target
)
zip_with_msg
(
zipf
,
source
,
target
)
...
...
native/jni/Android.mk
View file @
a2c1b024
...
@@ -110,10 +110,8 @@ LOCAL_CFLAGS := -DXWRAP_EXIT
...
@@ -110,10 +110,8 @@ LOCAL_CFLAGS := -DXWRAP_EXIT
LOCAL_LDLIBS := -lz
LOCAL_LDLIBS := -lz
include $(BUILD_EXECUTABLE)
include $(BUILD_EXECUTABLE)
#
32-bit
static binaries
# static binaries
ifndef GRADLE # Do not run gradle sync on these binaries
ifndef GRADLE # Do not run gradle sync on these binaries
ifneq ($(TARGET_ARCH_ABI), x86_64)
ifneq ($(TARGET_ARCH_ABI), arm64-v8a)
# b64xz
# b64xz
include $(CLEAR_VARS)
include $(CLEAR_VARS)
LOCAL_MODULE := b64xz
LOCAL_MODULE := b64xz
...
@@ -125,8 +123,6 @@ include $(BUILD_EXECUTABLE)
...
@@ -125,8 +123,6 @@ include $(BUILD_EXECUTABLE)
# Busybox
# Busybox
include jni/external/busybox/Android.mk
include jni/external/busybox/Android.mk
endif
endif
endif
endif
# Precompile
# Precompile
endif
endif
...
...
native/jni/Application.mk
View file @
a2c1b024
APP_ABI := x86
x86_64 armeabi-v7a arm64-v8
a
APP_ABI := x86
armeabi-v7
a
APP_PLATFORM := android-21
APP_PLATFORM := android-21
APP_CFLAGS := $(MAGISK_FLAGS) -std=gnu99
APP_CFLAGS := $(MAGISK_FLAGS) -std=gnu99
APP_CPPFLAGS := -std=c++11
APP_CPPFLAGS := -std=c++11
...
...
scripts/flash_script.sh
View file @
a2c1b024
...
@@ -69,7 +69,7 @@ api_level_arch_detect
...
@@ -69,7 +69,7 @@ api_level_arch_detect
ui_print
"- Device platform:
$ARCH
"
ui_print
"- Device platform:
$ARCH
"
BINDIR
=
$INSTALLER
/
$ARCH
BINDIR
=
$INSTALLER
/
$ARCH
32
chmod
-R
755
$CHROMEDIR
$BINDIR
chmod
-R
755
$CHROMEDIR
$BINDIR
# Check if system root is installed and remove
# Check if system root is installed and remove
...
@@ -105,7 +105,7 @@ chmod -R 755 $MAGISKBIN
...
@@ -105,7 +105,7 @@ chmod -R 755 $MAGISKBIN
if
[
-d
/system/addon.d
]
;
then
if
[
-d
/system/addon.d
]
;
then
ui_print
"- Adding addon.d survival script"
ui_print
"- Adding addon.d survival script"
mount
-o
rw,remount /system
mount
-o
rw,remount /system
cp
-af
$INSTALLER
/
addon.d
/99-magisk.sh /system/addon.d/99-magisk.sh
cp
-af
$INSTALLER
/
common
/99-magisk.sh /system/addon.d/99-magisk.sh
chmod
755 /system/addon.d/99-magisk.sh
chmod
755 /system/addon.d/99-magisk.sh
fi
fi
...
...
scripts/util_functions.sh
View file @
a2c1b024
...
@@ -266,11 +266,12 @@ api_level_arch_detect() {
...
@@ -266,11 +266,12 @@ api_level_arch_detect() {
ABILONG
=
`
grep_prop ro.product.cpu.abi
`
ABILONG
=
`
grep_prop ro.product.cpu.abi
`
ARCH
=
arm
ARCH
=
arm
ARCH32
=
arm
IS64BIT
=
false
IS64BIT
=
false
if
[
"
$ABI
"
=
"x86"
]
;
then
ARCH
=
x86
;
fi
;
if
[
"
$ABI
"
=
"x86"
]
;
then
ARCH
=
x86
;
ARCH32
=
x86
;
fi
;
if
[
"
$ABI2
"
=
"x86"
]
;
then
ARCH
=
x86
;
fi
;
if
[
"
$ABI2
"
=
"x86"
]
;
then
ARCH
=
x86
;
ARCH32
=
x86
;
fi
;
if
[
"
$ABILONG
"
=
"arm64-v8a"
]
;
then
ARCH
=
arm64
;
IS64BIT
=
true
;
fi
;
if
[
"
$ABILONG
"
=
"arm64-v8a"
]
;
then
ARCH
=
arm64
;
ARCH32
=
arm
;
IS64BIT
=
true
;
fi
;
if
[
"
$ABILONG
"
=
"x86_64"
]
;
then
ARCH
=
x64
;
IS64BIT
=
true
;
fi
;
if
[
"
$ABILONG
"
=
"x86_64"
]
;
then
ARCH
=
x64
;
ARCH32
=
x86
;
IS64BIT
=
true
;
fi
;
}
}
boot_actions
()
{
boot_actions
()
{
...
@@ -297,7 +298,7 @@ recovery_actions() {
...
@@ -297,7 +298,7 @@ recovery_actions() {
# Temporarily block out all custom recovery binaries/libs
# Temporarily block out all custom recovery binaries/libs
mv
/sbin /sbin_tmp
mv
/sbin /sbin_tmp
# Add all possible library paths
# Add all possible library paths
$IS64BIT
&&
export
LD_LIBRARY_PATH
=
/system/lib64:/system/vendor/lib64
||
export
LD_LIBRARY_PATH
=
/system/lib:/system/vendor/lib
export
LD_LIBRARY_PATH
=
/system/lib:/system/vendor/lib
}
}
recovery_cleanup
()
{
recovery_cleanup
()
{
...
...
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