Android 8.1 Custom Init Scripts - General Questions and Answers

Alright guys, I have a generic tablet with android 8.1it has an mtk armv7 processor... I'm trying to write a oneshot init that executes a shell script from /system/xbin but when I add it it doesn't seem to execute my script. Can someone help me with how to add it? The code I'm using is as follows:
# Run init.d scripts
service bsleep /system/bin/bsleep.sh
class late_start
seclabel u:r:shell:s0
user root
group root
oneshot
Click to expand...
Click to collapse
#!/system/bin/sh
(until [ "$(getprop sys.boot_completed)" == "1" ]; do
sleep 1
done
input keyevent SLEEP
Click to expand...
Click to collapse

If supported by kernel so-called init.d scripts must be located in directory /system//etc/init.d to get detected at boottime and run - scripts must be RWX. To push init.d scripts to this location elevated rights ( AKA ROOT permission ) is required.
On devices with non-rooted Android a workaround is possible: Using an App that emulates the Init.d function, e.g. Universal Init.d
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
Note: Universal Init.d app is no longer available in the Google Play Store. Please, download the Universal Init.d APK instead.

Related

[Tool] Statusbar SystemUI.apk replacer w/o rebooting phone

Statusbar Replacer
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
Hi xda users,
I want to share a batch script tool to replace your statusbar without
going to recovery or restarting your phone.
What does this do?
A: This will replace your statusbar in 5 secs. after you run replacer script, with your modded
SystemUI.apk in folder.
Extract folder inside rar archive
Place your SystemUI.apk
in the folder then connect phone to usb
then double click statusbar_replacer
Tested on Sense 4, please report if it works
on other roms to.
Usefull for
for themeing your statusbar icons, battery or
modding it with apktool if it runs or not.
How it works
1.adb mounts to sysrw
2.pushes new systemui
3.closes old systemui in memory
4.restarts new systemui(statusbar)
Requirements
Phone USB Drivers
USB Debugging on
Windows PC
Dont forget the thanks button.
Tried on my Motorola Razr i - didn't work. However after poking in the skies came to the following:
adb shell syswr - doesn't work you have to change permission manually, maybe it was an issue with Busybox
the rest looked for me as following:
adb shell
pkill -TERM -f com.android.systemui ()
exit
adb push SystemUI.apk /system/app/
adb shell
pkill -TERM -f com.android.systemui - don't ask why but tests revealed the second termination is a must =))
am startservice -n com.android.systemui/.SystemUIService
su
reboot recovery
+ change Permissions

[MOD/PATCH] ZERG INIT - Universal init.d Patcher.

ZERG INIT​ZERG INIT - Universal init.d Patcher.​
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
Basically init.d is folder contains some scripts those can automatically executed at boot time.
This system is a Linux Kernel’s feature.
But there are many stock ROMs are comes without init.d feature. These ROM's kernel hasn't init.d support. I also face this problem.
We could found many tweaks, Mods in XDA or outside that requires init.d.
So I was decided to write a program that could patch init.d. with some alternative methods.​
Features due to version 0.1:
1. You can execute scripts with any name.
2. You do not need to keep “00” like numbers before scripts name.
3. You can keep extension like “.sh” after scripts name.
4. Faster execution.
5. More powerful patch.
6. init.d related scripts file/folders auto permission fixing.
7. Full compatible with SuperSU flashable zip update (after or before).
How to:​
1. Download all the files in attachments
2. Install Terminal Emulator
3. Install BusyBox
4. Unpack "zerginit_v0.1_ansaryx.zip"
5. Keep the binary file to your sdcard
6. Open Terminal Emulator
7. Type​
8. See the on screen statuses
9. Now Reboot your device
10. Check log file in "/data/AlienoidMod/logs/init.d_status.log" if init.d working or not.​
Comment and let me know how you feel about this... Please give me a thanks ​

[SELinux] Devices Xperia

{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
welcome to this new tutorial
such as changing the state of SELinux on xperia devices
Requirements:
- Devices Xperia
- Root Access
- Installed busybox
- Support init.d
- Root Explorer (optional)
Process:
1.- with root explorer locate the following directory /system file in search of build.prop
2.- add the following line so that we can afford to view the status of SELinux on our device
Code:
ro.build.selinux=1
3.- save changes
4.- reset your device and settings on the phone will appear to them the status of SELinux
- attached screenshot
5.- within the init.d folder create a script with the name 88SELinux and add the following code
Code:
#!/system/bin/sh
chmod 0644 /sys/fs/selinux/disable
setenforce 0
setprop ro.boot.selinux disable
echo 0 > /sys/fs/selinux/enforce
echo 0 > /sys/fs/selinux/disable
exit 0;
6.- 88SELinux file take permission octal 0755 can use root explorer and enter the number 0755 attached screenshot
7.- restart the terminal and the status of SELinux should appear as in the screenshot
8.- finally if you do not change the status of SELinux it is because their init.d support is not working
Good work bro lml

Unable to get a root shell in ADB

Preface: I am trying to attain root, on a un-rooted device, Samsung xCover3, (Note: Root is able to be achieved on kit-kat, and marshmallow, not on Lollipop, which is the current device I'm working on. My XDA thread incease someone say's "follow this", Becuse I created that thread) implementing chainfires systemless root by hand (No working TWRP for lollipop, plus we have an uncommon boot.img which chainfires SuperSu.zip probably couldn't handle).
Prep-work:
- Created a su.img with relevant files inside (Needed for Systemless root to work). Note: This is the file that needs to be pushed to /data.
- Modified the Ramdisk to launch daemonsu (needed to mount su.img for systemless root) as well as changed the defult.prop to
Code:
ro.secure=0
ro.debuggable=1
ro.adb.secure=0
to allow for ADB to be able to be run as root.
- I then also patched the sepolicy file with the default patches as done by chainfires SuperSu.zip
- I then recompiled the kernel so Samsung's Anti-root features and TIMA aren't enabled.
Problem: When typing `adb root` my id does not change to root (0) instead it stays the same, as before hand.
Note: In the below image, daemonsu service should also be running, but I believe what ever is stopping ADB root, working is also probably what stops that service.
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
Reason/Questions, why??
- Maybe the sepolicy doesn't allow it? If so how would I patch to allow adb root to work
- Am I missing something Obvious?
So what is needed to be done to allow for "ADB root" to work?
My question is also on Android Stackexchange

Unable to get a root shell in ADB

Preface: I am trying to attain root, on a un-rooted device, Samsung xCover3, (Note: Root is able to be achieved on kit-kat, and marshmallow, not on Lollipop, which is the current device I'm working on. My][url]http://forum.xda-developers.com/android/development/4-4-4-5-1-1-6-0-1-samsung-xcover3-t3465132 XDA thread[/URL] incease someone say's "follow this", Becuse I created that thread) implementing chainfires systemless root by hand (No working TWRP for lollipop, plus we have an uncommon boot.img which chainfires SuperSu.zip probably couldn't handle).
Prep-work:
- Created a su.img with relevant files inside (Needed for Systemless root to work). Note: This is the file that needs to be pushed to /data.
- Modified the Ramdisk to launch daemonsu (needed to mount su.img for systemless root) as well as changed the defult.prop to
Code:
ro.secure=0
ro.debuggable=1
ro.adb.secure=0
to allow for ADB to be able to be run as root.
- I then also patched the sepolicy file with the default patches as done by chainfires SuperSu.zip
- I then recompiled the kernel so Samsung's Anti-root features and TIMA aren't enabled.
Problem: When typing `adb root` my id does not change to root (0) instead it stays the same, as before hand.
Note: In the below image, daemonsu service should also be running, but I believe what ever is stopping ADB root, working is also probably what stops that service.
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
Reason/Questions, why??
- Maybe the sepolicy doesn't allow it? If so how would I patch to allow adb root to work
- Am I missing something Obvious?
So what is needed to be done to allow for "ADB root" to work?
My question is also on Android Stackexchange

Categories

Resources