[Miscellaneous Android Development] bpaxda:
Boot-time root script not running, but otherwise works great

Let me first say thanks so much [MENTION=8132642]diplomatic[/MENTION] for Mtk-su. This temp root works perfectly on my device: a cheap Walmart Alcatel TCL A1 A501DL for Tracfone. This device has an mt6739 chip (according to CPU-Z) running android 8.1.0 armv71 (non 64 bit). My question pertains not to the Mtk-su binary, but to the last bit of instructions in post #1000 of this thread: "Up-to-date bootless root for Magisk 20+!" to obtain a systemless automatic boot running of your script. The "Init.d scripts support" app doesn't run anything at boot and I've tried version 1.1.27 and the latest 1.1.44.

I'm using the Magisk.v20.4 ZIP, the non-64 bit magiskinit (md5=8d2b669cae142b76876ee388c9dab05a), mtk-su (md5=8081b7c64facc3259c695b9da8148a3b) and magisk-boot.sh (9d0c93d1fd39e67c0d990852bcd9fcba) (UPDATED 2020-04-02)

When I click "Run scripts now" using the Init.d app, your script runs fine in /sdcard/init.d: the su binary appears, Magisk becomes activated and I can su either from ADB or apps that have been granted through Magisk manager; I just can't get it to run automatically on boot. The "last execution results" are only updated when I manually run it based on the timestamps. I guess its even possible it tries to run at boot, hits a problem and doesn't log the results ... ?

I have read all replies since post #1000 and nobody has mentioned this particular issue. Anyway, as you pointed out in the mini-FAQ that follows the instructions, I've disabled all things I can find that I would think could possibly restrict the Init.d app from running in the background.

I've also tried the "Mtk Easy Su" solution which is basically the same idea. This is an app that basically gives you a "press this to root" button using your Mtk-su binary. This also works fine, but with the same catch. "Run on boot" enabled won't run anything at it at boot time either.

It may be that this locked down Android doesn't allow this boot time stuff? I have verified this OS has dm_verity and a read-only /system partition that can't be remounted rw. One thing I haven't tried is supposedly a Magisk module can be added called "App Systemizer" - perhaps "systemizing" the Init.d app might allow it to run at boot time? I'll post any results here and I'll work on that while I'm awaiting any info I can get from you guys. Would anyone have any ideas about getting the Init.d to run properly at boot time?

For what its worth, here is the output of mtk-su when run (for the first time after booting) in ADB shell:

FERMI_TF:/data/local/tmp $ ./mtk-su -v

armv7l machine

param1: 0x1000, param2: 0x8040, type: 13

Building symbol table

kallsyms_addresses pa 0x40ed9e40

kallsyms_num_syms 51203, addr_count 51203

kallsyms_names pa 0x40f0be60, size 670778

kallsyms_markers pa 0x40fafaa0

kallsyms_token_table pa 0x40fafdd0

kallsyms_token_index pa 0x40fb0150

Patching credentials

Parsing current_is_single_threaded

c04e8038: LDR Rt, [PC, #128] ; 0xc04e80c0

init_task VA: 0xc140c578

Possible list_head tasks at offset 0x2b0

comm swapper/0 at offset 0x454

Found own task_struct at node 1

cred VA: 0xc7c4b800

Parsing avc_denied

c0487e78: LDR Rt, [PC, #84] ; 0xc0487ed4

selinux_enforcing VA: 0xc15b06d4

Setting selinux_enforcing

Switched selinux to permissive

starting /system/bin/sh

UID: 0 cap: 3fffffffff selinux: permissive

Also attached is a screenshot of "Show last execution results" within the Init.d app. Thanks again to diplomatic and all who have posted great info to this thread sofar!