Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
ianmacd committed Jul 16, 2018
2 parents 316a540 + c2e673f commit 0ccccce
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 5 deletions.
9 changes: 5 additions & 4 deletions build.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ def header(str):
ndk_build = os.path.join(os.environ['ANDROID_HOME'], 'ndk-bundle', 'ndk-build')

cpu_count = multiprocessing.cpu_count()
gradlew = os.path.join('.', 'gradlew.bat' if os.name == 'nt' else 'gradlew')
archs = ['arm64-v8a', 'armeabi-v7a', 'x86', 'x86_64']

def mv(source, target):
Expand Down Expand Up @@ -203,7 +204,7 @@ def build_apk(args):
if not os.path.exists('release-key.jks'):
error('Please generate a java keystore and place it in \'release-key.jks\'')

proc = subprocess.run('{} app:assembleRelease'.format(os.path.join('.', 'gradlew.bat' if os.name == 'nt' else 'gradlew')), shell=True, stdout=STDOUT)
proc = subprocess.run('{} app:assembleRelease'.format(gradlew), shell=True, stdout=STDOUT)
if proc.returncode != 0:
error('Build Magisk Manager failed!')

Expand All @@ -219,7 +220,7 @@ def build_apk(args):
header('Output: ' + release)
rm(unsigned)
else:
proc = subprocess.run('{} app:assembleDebug'.format(os.path.join('.', 'gradlew.bat' if os.name == 'nt' else 'gradlew')), shell=True, stdout=STDOUT)
proc = subprocess.run('{} app:assembleDebug'.format(gradlew), shell=True, stdout=STDOUT)
if proc.returncode != 0:
error('Build Magisk Manager failed!')

Expand All @@ -234,7 +235,7 @@ def build_apk(args):
header('Output: ' + target)

def build_snet(args):
proc = subprocess.run('{} snet:assembleRelease'.format(os.path.join('.', 'gradlew.bat' if os.name == 'nt' else 'gradlew')), shell=True, stdout=STDOUT)
proc = subprocess.run('{} snet:assembleRelease'.format(gradlew), shell=True, stdout=STDOUT)
if proc.returncode != 0:
error('Build snet extention failed!')
source = os.path.join('snet', 'build', 'outputs', 'apk', 'release', 'snet-release-unsigned.apk')
Expand Down Expand Up @@ -390,7 +391,7 @@ def sign_adjust_zip(unsigned, output):

if not os.path.exists(jarsigner):
header('* Building ' + signer_name)
proc = subprocess.run('{} utils:shadowJar'.format(os.path.join('.', 'gradlew.bat' if os.name == 'nt' else 'gradlew')), shell=True, stdout=STDOUT)
proc = subprocess.run('{} utils:shadowJar'.format(gradlew), shell=True, stdout=STDOUT)
if proc.returncode != 0:
error('Build {} failed!'.format(signer_name))

Expand Down
1 change: 1 addition & 0 deletions native/jni/core/daemon.c
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ void main_daemon() {

// Start the log monitor
loggable = exec_command_sync("/system/bin/logcat", "-d", "-f", "/dev/null", NULL) == 0;
chmod("/dev/null", 0666);
if (loggable) {
connect_daemon2(LOG_DAEMON, &fd);
write_int(fd, HANDSHAKE);
Expand Down
1 change: 1 addition & 0 deletions native/jni/core/log_daemon.c
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ void log_daemon() {
if (exec_command_sync("/system/bin/logcat", "-b", b[i], "-d", "-f", "/dev/null", NULL) == 0)
vec_push_back_all(&log_cmd, "-b", b[i], NULL);
}
chmod("/dev/null", 0666);
vec_dup(&log_cmd, &clear_cmd);
vec_push_back_all(&log_cmd, "-v", "threadtime", "-s", "am_proc_start", "Magisk", "*:F", NULL);
vec_push_back(&log_cmd, NULL);
Expand Down
2 changes: 1 addition & 1 deletion native/jni/include/magiskrc.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const char magiskrc[] =
" rm "UNBLOCKFILE"\n"
" start magisk_startup\n"
" wait "UNBLOCKFILE" 10\n"
" rm /dev/.magisk.unblock\n"
" rm "UNBLOCKFILE"\n"
"\n"

// Services
Expand Down

0 comments on commit 0ccccce

Please sign in to comment.