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
5bac442b
Commit
5bac442b
authored
Aug 09, 2018
by
topjohnwu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Reorganize sources
parent
6add6827
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
30 additions
and
25 deletions
+30
-25
Android.mk
native/jni/Android.mk
+12
-11
bootstages.c
native/jni/core/bootstages.c
+1
-0
img.h
native/jni/include/img.h
+11
-0
utils.h
native/jni/include/utils.h
+0
-14
cpio.c
native/jni/magiskboot/cpio.c
+0
-0
cpio.h
native/jni/magiskboot/cpio.h
+0
-0
magiskboot.h
native/jni/magiskboot/magiskboot.h
+4
-0
pattern.c
native/jni/magiskboot/pattern.c
+1
-0
img.c
native/jni/utils/img.c
+1
-0
No files found.
native/jni/Android.mk
View file @
5bac442b
...
...
@@ -10,14 +10,12 @@ LIBLZ4 := $(EXT_PATH)/lz4/lib
LIBBZ2 := $(EXT_PATH)/bzip2
LIBFDT := $(EXT_PATH)/dtc/libfdt
LIBNANOPB := $(EXT_PATH)/nanopb
UTIL_SRC := utils/cpio.c \
utils/file.c \
utils/img.c \
utils/list.c \
utils/misc.c \
utils/pattern.c \
utils/vector.c \
utils/xwrap.c
COMMON_UTILS := \
utils/file.c \
utils/list.c \
utils/misc.c \
utils/vector.c \
utils/xwrap.c
########################
# Binaries
...
...
@@ -55,7 +53,8 @@ LOCAL_SRC_FILES := \
su/pts.c \
su/su_daemon.c \
su/su_socket.c \
$(UTIL_SRC)
utils/img.c \
$(COMMON_UTILS)
LOCAL_CFLAGS := -DIS_DAEMON -DSELINUX
LOCAL_LDLIBS := -llog
...
...
@@ -83,7 +82,7 @@ LOCAL_SRC_FILES := \
magiskpolicy/magiskpolicy.c \
magiskpolicy/rules.c \
magiskpolicy/sepolicy.c \
$(
UTIL_SRC
)
$(
COMMON_UTILS
)
LOCAL_LDFLAGS := -static
include $(BUILD_EXECUTABLE)
...
...
@@ -105,6 +104,7 @@ LOCAL_C_INCLUDES := \
$(LIBFDT)
LOCAL_SRC_FILES := \
magiskboot/cpio.c \
magiskboot/main.c \
magiskboot/bootimg.c \
magiskboot/hexpatch.c \
...
...
@@ -112,7 +112,8 @@ LOCAL_SRC_FILES := \
magiskboot/format.c \
magiskboot/dtb.c \
magiskboot/ramdisk.c \
$(UTIL_SRC)
magiskboot/pattern.c \
$(COMMON_UTILS)
LOCAL_CFLAGS := -DXWRAP_EXIT
LOCAL_LDLIBS := -lz
...
...
native/jni/core/bootstages.c
View file @
5bac442b
...
...
@@ -18,6 +18,7 @@
#include "magisk.h"
#include "db.h"
#include "utils.h"
#include "img.h"
#include "daemon.h"
#include "resetprop.h"
#include "magiskpolicy.h"
...
...
native/jni/include/img.h
0 → 100644
View file @
5bac442b
#ifndef IMG_H
#define IMG_H
int
create_img
(
const
char
*
img
,
int
size
);
int
resize_img
(
const
char
*
img
,
int
size
);
char
*
mount_image
(
const
char
*
img
,
const
char
*
target
);
int
umount_image
(
const
char
*
target
,
const
char
*
device
);
int
merge_img
(
const
char
*
source
,
const
char
*
target
);
int
trim_img
(
const
char
*
img
,
const
char
*
mount
,
char
*
loop
);
#endif //IMG_H
native/jni/include/utils.h
View file @
5bac442b
...
...
@@ -147,18 +147,4 @@ void full_read_at(int dirfd, const char *filename, void **buf, size_t *size);
void
stream_full_read
(
int
fd
,
void
**
buf
,
size_t
*
size
);
void
write_zero
(
int
fd
,
size_t
size
);
// img.c
int
create_img
(
const
char
*
img
,
int
size
);
int
resize_img
(
const
char
*
img
,
int
size
);
char
*
mount_image
(
const
char
*
img
,
const
char
*
target
);
int
umount_image
(
const
char
*
target
,
const
char
*
device
);
int
merge_img
(
const
char
*
source
,
const
char
*
target
);
int
trim_img
(
const
char
*
img
,
const
char
*
mount
,
char
*
loop
);
// pattern.c
int
patch_verity
(
void
**
buf
,
uint32_t
*
size
,
int
patch
);
void
patch_encryption
(
void
**
buf
,
uint32_t
*
size
);
#endif
native/jni/
utils
/cpio.c
→
native/jni/
magiskboot
/cpio.c
View file @
5bac442b
File moved
native/jni/
include
/cpio.h
→
native/jni/
magiskboot
/cpio.h
View file @
5bac442b
File moved
native/jni/magiskboot/magiskboot.h
View file @
5bac442b
...
...
@@ -32,4 +32,8 @@ size_t lz4_legacy(int mode, int fd, const void *buf, size_t size);
long
long
comp
(
format_t
type
,
int
to
,
const
void
*
from
,
size_t
size
);
long
long
decomp
(
format_t
type
,
int
to
,
const
void
*
from
,
size_t
size
);
// Pattern
int
patch_verity
(
void
**
buf
,
uint32_t
*
size
,
int
patch
);
void
patch_encryption
(
void
**
buf
,
uint32_t
*
size
);
#endif
native/jni/
utils
/pattern.c
→
native/jni/
magiskboot
/pattern.c
View file @
5bac442b
...
...
@@ -2,6 +2,7 @@
#include <string.h>
#include "utils.h"
#include "magiskboot.h"
static
int
check_verity_pattern
(
const
char
*
s
)
{
int
skip
=
0
;
...
...
native/jni/utils/img.c
View file @
5bac442b
...
...
@@ -14,6 +14,7 @@
#include "magisk.h"
#include "utils.h"
#include "img.h"
#define round_size(a) ((((a) / 32) + 2) * 32)
#define SOURCE_TMP "/dev/.img_src"
...
...
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