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
d1d26f44
Commit
d1d26f44
authored
Aug 27, 2022
by
topjohnwu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix building individual applet
parent
357d913f
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
24 additions
and
26 deletions
+24
-26
build.py
build.py
+3
-1
Android-rs.mk
native/src/Android-rs.mk
+12
-8
Android.mk
native/src/Android.mk
+1
-16
applet_stub.cpp
native/src/core/applet_stub.cpp
+6
-1
resetprop.cpp
native/src/resetprop/resetprop.cpp
+2
-0
No files found.
build.py
View file @
d1d26f44
...
...
@@ -64,7 +64,7 @@ cpu_count = multiprocessing.cpu_count()
archs
=
[
'armeabi-v7a'
,
'x86'
,
'arm64-v8a'
,
'x86_64'
]
triples
=
[
'armv7a-linux-androideabi'
,
'i686-linux-android'
,
'aarch64-linux-android'
,
'x86_64-linux-android'
]
default_targets
=
[
'magisk'
,
'magiskinit'
,
'magiskboot'
,
'magiskpolicy'
,
'busybox'
]
support_targets
=
default_targets
+
[
'resetprop'
,
'test'
]
support_targets
=
default_targets
+
[
'resetprop'
]
rust_targets
=
[
'magisk'
,
'magiskinit'
,
'magiskboot'
,
'magiskpolicy'
]
sdk_path
=
os
.
environ
[
'ANDROID_SDK_ROOT'
]
...
...
@@ -220,6 +220,8 @@ def run_ndk_build(flags):
def
run_cargo_build
(
args
):
os
.
chdir
(
op
.
join
(
'native'
,
'src'
))
targets
=
set
(
args
.
target
)
&
set
(
rust_targets
)
if
'resetprop'
in
args
.
target
:
targets
.
add
(
'magisk'
)
env
=
os
.
environ
.
copy
()
env
[
'CARGO_BUILD_RUSTC'
]
=
op
.
join
(
rust_bin
,
'rustc'
+
EXE_EXT
)
...
...
native/src/Android-rs.mk
View file @
d1d26f44
...
...
@@ -4,30 +4,34 @@ LOCAL_PATH := $(call my-dir)
# Rust compilation outputs
###########################
ifdef B_MAGISK
LIBRARY_PATH = ../out/$(TARGET_ARCH_ABI)/libmagisk-rs.a
ifneq (,$(wildcard $(LOCAL_PATH)/$(LIBRARY_PATH)))
include $(CLEAR_VARS)
LOCAL_MODULE := magisk-rs
LOCAL_SRC_FILES :=
../out/$(TARGET_ARCH_ABI)/libmagisk-rs.a
LOCAL_SRC_FILES :=
$(LIBRARY_PATH)
include $(PREBUILT_STATIC_LIBRARY)
endif
ifdef B_BOOT
LIBRARY_PATH = ../out/$(TARGET_ARCH_ABI)/libmagiskboot-rs.a
ifneq (,$(wildcard $(LOCAL_PATH)/$(LIBRARY_PATH)))
include $(CLEAR_VARS)
LOCAL_MODULE := boot-rs
LOCAL_SRC_FILES :=
../out/$(TARGET_ARCH_ABI)/libmagiskboot-rs.a
LOCAL_SRC_FILES :=
$(LIBRARY_PATH)
include $(PREBUILT_STATIC_LIBRARY)
endif
ifdef B_INIT
LIBRARY_PATH = ../out/$(TARGET_ARCH_ABI)/libmagiskinit-rs.a
ifneq (,$(wildcard $(LOCAL_PATH)/$(LIBRARY_PATH)))
include $(CLEAR_VARS)
LOCAL_MODULE := init-rs
LOCAL_SRC_FILES :=
../out/$(TARGET_ARCH_ABI)/libmagiskinit-rs.a
LOCAL_SRC_FILES :=
$(LIBRARY_PATH)
include $(PREBUILT_STATIC_LIBRARY)
endif
ifdef B_POLICY
LIBRARY_PATH = ../out/$(TARGET_ARCH_ABI)/libmagiskpolicy-rs.a
ifneq (,$(wildcard $(LOCAL_PATH)/$(LIBRARY_PATH)))
include $(CLEAR_VARS)
LOCAL_MODULE := policy-rs
LOCAL_SRC_FILES :=
../out/$(TARGET_ARCH_ABI)/libmagiskpolicy-rs.a
LOCAL_SRC_FILES :=
$(LIBRARY_PATH)
include $(PREBUILT_STATIC_LIBRARY)
endif
native/src/Android.mk
View file @
d1d26f44
...
...
@@ -150,29 +150,14 @@ LOCAL_STATIC_LIBRARIES := \
LOCAL_SRC_FILES := \
core/applet_stub.cpp \
resetprop/persist_properties.cpp \
resetprop/resetprop.cpp \
resetprop/persist.cpp \
LOCAL_CFLAGS := -DAPPLET_STUB_MAIN=resetprop_main
include $(BUILD_EXECUTABLE)
endif
ifdef B_TEST
ifneq (,$(wildcard src/test.cpp))
include $(CLEAR_VARS)
LOCAL_MODULE := test
LOCAL_STATIC_LIBRARIES := \
libbase \
libphmap
LOCAL_SRC_FILES := test.cpp
include $(BUILD_EXECUTABLE)
endif
endif
########################
# Libraries
########################
...
...
native/src/core/applet_stub.cpp
View file @
d1d26f44
#include <sys/stat.h>
#include <magisk.hpp>
#include <selinux.hpp>
#include <base.hpp>
int
main
(
int
argc
,
char
*
argv
[])
{
umask
(
0
);
if
(
argc
<
1
)
return
1
;
enable_selinux
();
cmdline_logging
();
init_argv0
(
argc
,
argv
);
umask
(
0
);
return
APPLET_STUB_MAIN
(
argc
,
argv
);
}
native/src/resetprop/resetprop.cpp
View file @
d1d26f44
...
...
@@ -6,6 +6,8 @@
#include <resetprop.hpp>
#include <base.hpp>
#undef __INTRODUCED_IN
#define __INTRODUCED_IN(...)
#define _REALLY_INCLUDE_SYS__SYSTEM_PROPERTIES_H_
#include <_system_properties.h>
...
...
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