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
60b3b8dd
Commit
60b3b8dd
authored
Sep 27, 2018
by
topjohnwu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Better incremental builds
parent
41446ec9
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
30 additions
and
9 deletions
+30
-9
build.py
build.py
+1
-2
build.gradle
native/build.gradle
+2
-2
bootstages.c
native/jni/core/bootstages.c
+1
-0
daemon.c
native/jni/core/daemon.c
+2
-1
log_daemon.c
native/jni/core/log_daemon.c
+1
-0
magisk.c
native/jni/core/magisk.c
+2
-1
magiskinit.c
native/jni/core/magiskinit.c
+1
-0
flags.h
native/jni/include/flags.h
+15
-0
magisk.h
native/jni/include/magisk.h
+0
-1
proc_monitor.c
native/jni/magiskhide/proc_monitor.c
+1
-0
su.c
native/jni/su/su.c
+2
-1
su.h
native/jni/su/su.h
+0
-1
img.c
native/jni/utils/img.c
+1
-0
misc.c
native/jni/utils/misc.c
+1
-0
No files found.
build.py
View file @
60b3b8dd
...
@@ -170,8 +170,7 @@ def build_binary(args):
...
@@ -170,8 +170,7 @@ def build_binary(args):
header
(
'* Building binaries: '
+
' '
.
join
(
args
.
target
))
header
(
'* Building binaries: '
+
' '
.
join
(
args
.
target
))
# Force update logging.h timestamp to trigger recompilation for the flags to make a difference
os
.
utime
(
os
.
path
.
join
(
'native'
,
'jni'
,
'include'
,
'flags.h'
))
os
.
utime
(
os
.
path
.
join
(
'native'
,
'jni'
,
'utils'
,
'include'
,
'logging.h'
))
# Basic flags
# Basic flags
base_flags
=
'MAGISK_VERSION=
\"
{}
\"
MAGISK_VER_CODE={} MAGISK_DEBUG={}'
.
format
(
config
[
'version'
],
config
[
'versionCode'
],
base_flags
=
'MAGISK_VERSION=
\"
{}
\"
MAGISK_VER_CODE={} MAGISK_DEBUG={}'
.
format
(
config
[
'version'
],
config
[
'versionCode'
],
...
...
native/build.gradle
View file @
60b3b8dd
...
@@ -14,8 +14,8 @@ android {
...
@@ -14,8 +14,8 @@ android {
externalNativeBuild
{
externalNativeBuild
{
ndkBuild
{
ndkBuild
{
// Pass arguments to ndk-build.
// Pass arguments to ndk-build.
arguments
(
'B_MAGISK=1'
,
'B_INIT=1'
,
'B_BOOT=1'
,
'B_BXZ=1'
,
'MAGISK_VERSION=debug'
,
arguments
(
'B_MAGISK=1'
,
'B_INIT=1'
,
'B_BOOT=1'
,
'B_BXZ=1'
,
'MAGISK_
VER_CODE=99999'
,
'MAGISK_
DEBUG=-DMAGISK_DEBUG'
)
'MAGISK_DEBUG=-DMAGISK_DEBUG'
)
}
}
}
}
}
}
...
...
native/jni/core/bootstages.c
View file @
60b3b8dd
...
@@ -21,6 +21,7 @@
...
@@ -21,6 +21,7 @@
#include "daemon.h"
#include "daemon.h"
#include "resetprop.h"
#include "resetprop.h"
#include "selinux.h"
#include "selinux.h"
#include "flags.h"
static
char
buf
[
PATH_MAX
],
buf2
[
PATH_MAX
];
static
char
buf
[
PATH_MAX
],
buf2
[
PATH_MAX
];
static
struct
vector
module_list
;
static
struct
vector
module_list
;
...
...
native/jni/core/daemon.c
View file @
60b3b8dd
...
@@ -19,6 +19,7 @@
...
@@ -19,6 +19,7 @@
#include "daemon.h"
#include "daemon.h"
#include "resetprop.h"
#include "resetprop.h"
#include "selinux.h"
#include "selinux.h"
#include "flags.h"
int
setup_done
=
0
;
int
setup_done
=
0
;
int
seperate_vendor
=
0
;
int
seperate_vendor
=
0
;
...
@@ -69,7 +70,7 @@ static void *request_handler(void *args) {
...
@@ -69,7 +70,7 @@ static void *request_handler(void *args) {
su_daemon_receiver
(
client
,
&
credential
);
su_daemon_receiver
(
client
,
&
credential
);
break
;
break
;
case
CHECK_VERSION
:
case
CHECK_VERSION
:
write_string
(
client
,
MAGISK_VER_STR
);
write_string
(
client
,
xstr
(
MAGISK_VERSION
)
":MAGISK"
);
close
(
client
);
close
(
client
);
break
;
break
;
case
CHECK_VERSION_CODE
:
case
CHECK_VERSION_CODE
:
...
...
native/jni/core/log_daemon.c
View file @
60b3b8dd
...
@@ -16,6 +16,7 @@
...
@@ -16,6 +16,7 @@
#include "magisk.h"
#include "magisk.h"
#include "utils.h"
#include "utils.h"
#include "daemon.h"
#include "daemon.h"
#include "flags.h"
static
int
loggable
=
0
;
static
int
loggable
=
0
;
static
struct
vector
log_cmd
,
clear_cmd
;
static
struct
vector
log_cmd
,
clear_cmd
;
...
...
native/jni/core/magisk.c
View file @
60b3b8dd
...
@@ -11,6 +11,7 @@
...
@@ -11,6 +11,7 @@
#include "magisk.h"
#include "magisk.h"
#include "daemon.h"
#include "daemon.h"
#include "selinux.h"
#include "selinux.h"
#include "flags.h"
char
*
argv0
;
char
*
argv0
;
...
@@ -66,7 +67,7 @@ int magisk_main(int argc, char *argv[]) {
...
@@ -66,7 +67,7 @@ int magisk_main(int argc, char *argv[]) {
if
(
argc
<
2
)
if
(
argc
<
2
)
usage
();
usage
();
if
(
strcmp
(
argv
[
1
],
"-c"
)
==
0
)
{
if
(
strcmp
(
argv
[
1
],
"-c"
)
==
0
)
{
printf
(
"%s (%d)
\n
"
,
MAGISK_VER_STR
,
MAGISK_VER_CODE
);
printf
(
"%s (%d)
\n
"
,
xstr
(
MAGISK_VERSION
)
":MAGISK"
,
MAGISK_VER_CODE
);
return
0
;
return
0
;
}
else
if
(
strcmp
(
argv
[
1
],
"-v"
)
==
0
)
{
}
else
if
(
strcmp
(
argv
[
1
],
"-v"
)
==
0
)
{
int
fd
=
connect_daemon
();
int
fd
=
connect_daemon
();
...
...
native/jni/core/magiskinit.c
View file @
60b3b8dd
...
@@ -45,6 +45,7 @@
...
@@ -45,6 +45,7 @@
#include "utils.h"
#include "utils.h"
#include "daemon.h"
#include "daemon.h"
#include "magisk.h"
#include "magisk.h"
#include "flags.h"
#define DEFAULT_DT_DIR "/proc/device-tree/firmware/android"
#define DEFAULT_DT_DIR "/proc/device-tree/firmware/android"
...
...
native/jni/include/flags.h
0 → 100644
View file @
60b3b8dd
#pragma once
/* Include this header anywhere you access MAGISK_DEBUG, MAGISK_VERSION, MAGISK_VER_CODE.
*
* This file is only for more precise incremental builds. We can make sure code that uses
* external flags are re-compiled by updating the timestamp of this file
* */
#ifndef MAGISK_VERSION
#define MAGISK_VERSION 99.99
#endif
#ifndef MAGISK_VER_CODE
#define MAGISK_VER_CODE 99999
#endif
native/jni/include/magisk.h
View file @
60b3b8dd
...
@@ -6,7 +6,6 @@
...
@@ -6,7 +6,6 @@
#include "logging.h"
#include "logging.h"
#define MAGISK_VER_STR xstr(MAGISK_VERSION) ":MAGISK"
#define MAIN_SOCKET "d30138f2310a9fb9c54a3e0c21f58591"
#define MAIN_SOCKET "d30138f2310a9fb9c54a3e0c21f58591"
#define LOG_SOCKET "5864cd77f2f8c59b3882e2d35dbf51e4"
#define LOG_SOCKET "5864cd77f2f8c59b3882e2d35dbf51e4"
#define JAVA_PACKAGE_NAME "com.topjohnwu.magisk"
#define JAVA_PACKAGE_NAME "com.topjohnwu.magisk"
...
...
native/jni/magiskhide/proc_monitor.c
View file @
60b3b8dd
...
@@ -20,6 +20,7 @@
...
@@ -20,6 +20,7 @@
#include "daemon.h"
#include "daemon.h"
#include "utils.h"
#include "utils.h"
#include "magiskhide.h"
#include "magiskhide.h"
#include "flags.h"
static
int
sockfd
=
-
1
;
static
int
sockfd
=
-
1
;
...
...
native/jni/su/su.c
View file @
60b3b8dd
...
@@ -28,6 +28,7 @@
...
@@ -28,6 +28,7 @@
#include "utils.h"
#include "utils.h"
#include "su.h"
#include "su.h"
#include "selinux.h"
#include "selinux.h"
#include "flags.h"
struct
su_context
*
su_ctx
;
struct
su_context
*
su_ctx
;
...
@@ -182,7 +183,7 @@ int su_daemon_main(int argc, char **argv) {
...
@@ -182,7 +183,7 @@ int su_daemon_main(int argc, char **argv) {
printf
(
"%d
\n
"
,
MAGISK_VER_CODE
);
printf
(
"%d
\n
"
,
MAGISK_VER_CODE
);
exit2
(
EXIT_SUCCESS
);
exit2
(
EXIT_SUCCESS
);
case
'v'
:
case
'v'
:
printf
(
"%s
\n
"
,
MAGISKSU_VER_STR
);
printf
(
"%s
\n
"
,
xstr
(
MAGISK_VERSION
)
":MAGISKSU (topjohnwu)"
);
exit2
(
EXIT_SUCCESS
);
exit2
(
EXIT_SUCCESS
);
case
'z'
:
case
'z'
:
// Do nothing, placed here for legacy support :)
// Do nothing, placed here for legacy support :)
...
...
native/jni/su/su.h
View file @
60b3b8dd
...
@@ -11,7 +11,6 @@
...
@@ -11,7 +11,6 @@
#include "db.h"
#include "db.h"
#include "list.h"
#include "list.h"
#define MAGISKSU_VER_STR xstr(MAGISK_VERSION) ":MAGISKSU (topjohnwu)"
#define DEFAULT_SHELL "/system/bin/sh"
#define DEFAULT_SHELL "/system/bin/sh"
struct
su_info
{
struct
su_info
{
...
...
native/jni/utils/img.c
View file @
60b3b8dd
...
@@ -17,6 +17,7 @@
...
@@ -17,6 +17,7 @@
#include "magisk.h"
#include "magisk.h"
#include "utils.h"
#include "utils.h"
#include "img.h"
#include "img.h"
#include "flags.h"
#define round_size(a) ((((a) / 32) + 2) * 32)
#define round_size(a) ((((a) / 32) + 2) * 32)
#define SOURCE_TMP "/dev/.img_src"
#define SOURCE_TMP "/dev/.img_src"
...
...
native/jni/utils/misc.c
View file @
60b3b8dd
...
@@ -23,6 +23,7 @@
...
@@ -23,6 +23,7 @@
#include "logging.h"
#include "logging.h"
#include "utils.h"
#include "utils.h"
#include "resetprop.h"
#include "resetprop.h"
#include "flags.h"
unsigned
get_shell_uid
()
{
unsigned
get_shell_uid
()
{
struct
passwd
*
ppwd
=
getpwnam
(
"shell"
);
struct
passwd
*
ppwd
=
getpwnam
(
"shell"
);
...
...
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