[ROOT] [Magisk/Tasker] [Andromeda] Start Andromeda directly on boot from your phone

Search This thread

merkurial

Member
May 23, 2010
42
3
Hi,

You need to be rooted. Why to use Andromeda if you are rooted, you might wonder. Well, it runs miles better, there is no difference in speed between a themed and a not themed app. With a root Substratum, the difference is quite noticeable, for the worst.

Plus, I used magisk, although it should also be runnable from within Tasker, Auto Tools, or something alike, or simply with /system/etc/init.d support, which my P20 Pro lacks. The init.d injector magisk module didn't work either.

Hence I've modified the official linux adb script to be run at init directly on the phone. Due to the missing init.d support on many phones, like mine, I placed the script on /magisk/.core/service.d since I already had magisk installed

I also
Code:
ln -s /magisk/.core/service.d /system/etc/init.d
to make it easier to remember and have init.d support

The sleep timer might need to be increased, I tried to wait for projekt.substratum to be running but it was not enough, so unless someone can shed light on what other process to wait for, the sleep will do.

So download the script, rename it to start_andromeda-android.sh, and

Code:
adb push start_andromeda-android.sh /magisk/.core/service.d/
adb shell
su
chown 0:0 /magisk/.core/service.d/start_andromeda-android.sh
chmod 0755 /magisk/.core/service.d/start_andromeda-android.sh

#### optional, if your phone lacks /system/etc/init.d support, and you want to simulate it with magisk
# mount -o remount,rw /system
## if /system/etc/init.d exists and is not functional, like on my P20 Pro, just do
# rm -fr /system/etc/init.d
# ln -s /magisk/.core/service.d /system/etc/init.d
# mount -o remount,ro /system

# start_andromeda-android.sh

Code:
#!/system/bin/sh

sleep 15

# Let's first grab the location where Andromeda is installed
pkg=$(pm path projekt.andromeda)

# Due to the way the output is formatted, we have to strip 10 chars at the start
pkg=$(echo $pkg | cut -d : -f 2 | sed s/\\r//g)

# Now let's kill the running Andromeda services on the mobile device
kill=$(pidof andromeda)

# Check if we need to kill the existing pids, then kill them if need be
if [ -z "$kill" ]; then[INDENT]am force-stop projekt.substratum
appops set projekt.andromeda RUN_IN_BACKGROUND allow
appops set projekt.substratum RUN_IN_BACKGROUND allow
CLASSPATH=$pkg app_process /system/bin --nice-name=andromeda projekt.andromeda.Andromeda &
[/INDENT]
else
[INDENT]am force-stop projekt.substratum
kill -9 $kill
appops set projekt.andromeda RUN_IN_BACKGROUND allow
appops set projekt.substratum RUN_IN_BACKGROUND allow
CLASSPATH=$pkg app_process /system/bin --nice-name=andromeda projekt.andromeda.Andromeda &
[/INDENT]
fi
 

Attachments

  • start_andromeda-android.txt
    963 bytes · Views: 87
Our Apps
Get our official app!
The best way to access XDA on your phone
Nav Gestures
Add swipe gestures to any Android
One Handed Mode
Eases uses one hand with your phone