What is the right way to turn an app into a system app under Android Oreo and above ? - General Questions and Answers

I have tried several methods to turn an app into a system app but even if in some case I managed to install the app inside /system/priv-app the app was not running as a system app as I could figure out by checking running the command "adb shell ps".
So please could someone tell me if I missed something or if there is some limitation link to Lineage or may be Magisk or TWRP to have an app runing as a system app ?
I have tried with Lineage 15.1 (Oreo) and magisk 21.2 the phone is a Samsung S5 using TWRP 3.5.0_9-0 as system Recovery
First method was to
1 making a copy of the app folder to the internal storage
2 renaming that copied Folder with a short name without dot (like renaming com.example.myapp folder to Myapp Folder)
3 renaming the apk from base.apk to Myapp.apk
4 uninstalling the app
5 under TWRP recovery mode mount the system partiton and copying the Myapp folder to system/priv-app directory
6 chmod 755 Myapp Folder
7 chmod 644 Myapp.apk
8 wipe Dalvilk Cache and rebooting
Steps 2 and 3 might be useless it was just because I noticed the Priv-app directory used these naming Scheme for apps inside this folder
I tried this method also under Lineage 17.1 and Magisk 21.4 but then the phone was not able to reboot until I delete the newly created folder inside Priv-app
I also tried another method using Magisk Systemize (Terminal) module but the result was the same (the app was running but not as a system app)
As I have never seen that it was mentionned in any posted method explaning how to turn an app into a system app, the installed app was not signed with the platform key and the manifest was not including android:sharedUserId="android.uid.system"
Thanks in advance to those that will try to help.

Have you tried copying it to /system/app ?

Droid_76 said:
Have you tried copying it to /system/app ?
Click to expand...
Click to collapse
Yes and unfortunately the result was exactly the same

If DM-Verity & AVB are enabled these locks must get disabled before trying to operate on /system partition

jwoegerbauer said:
If DM-Verity & AVB are enabled these locks must get disabled before trying to operate on /system partition
Click to expand...
Click to collapse
Thanks but I don't think I have these enabled as I can mount write on the system partition, how do you check whether they are enabled or not ?

Newer Android versions have these locks by default enabled - they are set within file vbmeta.img : If enabled then phone's bootloader always loads device's Stock ROM, not any modded ROM where it doesn't matter whether partitions temporarily got mounted - by you - as RW or not.
Long story short: You've to unlock phone's bootloader, if not done yet, then disable the locks
Example code:
Code:
adb devices
adb reboot fastboot
fastboot devices
fastboot --disable-verity --disable-verification flash vbmeta vbmeta.img

I wonder what's the difference between a system app and a common app.

James_Watson said:
I wonder what's the difference between a system app and a common app.
Click to expand...
Click to collapse
Apps developed as system app / system privileged app can access System APIs whereas common user app cannot.
Simply installing a common user app as system app / system privleged app makes NO SENSE at all.

jwoegerbauer said:
Newer Android versions have these locks by default enabled - they are set within file vbmeta.img : If enabled then phone's bootloader always loads device's Stock ROM, not any modded ROM where it doesn't matter whether partitions temporarily got mounted - by you - as RW or not.
Long story short: You've to unlock phone's bootloader, if not done yet, then disable the locks
Example code:
Code:
adb devices
adb reboot fastboot
fastboot devices
fastboot --disable-verity --disable-verification flash vbmeta vbmeta.img
Click to expand...
Click to collapse
Thanks but correct me if I'm wrong I could not have installed LineageOS TWRP and Magisk if Dm-verify was active so I don't think it is the issue here. I'm still looking forward what is preventing the app to run as a system app when it is installed in system/priv-app. The app is then running but as a standard app.

Lisadev said:
I'm still looking forward what is preventing the app to run as a system app when it is installed in system/priv-app. The app is then running but as a standard app.
Click to expand...
Click to collapse
Must admit I don't understand your problem: an app either runs or runs not where it doesn't matter where it's located. That's also true if an app has root rights granted.
IMO only thing of interest is what Android app's permissions are granted. A permission SYSTEM / ALLOW_ALL what I think you expect to be there doesn't exist. See also here:
https://developer.android.com/reference/android/Manifest.permission#public-constructors_1

I ran into problems with a couple of methods as well. People said they would work, but they were no good. But do you know what has worked for me, reliably and consistently?
App Systemizer.
Just search for App Systemizer through Magisk. Download and install, then reboot. Now, open up a terminal with superuser privileges. Yeah, gotta use a terminal for this one. Open terminal and enter the command su (in case you didn't know how to get superuser privileges through a terminal). Once you've done that, enter the command systemize and then follow the prompts.
I had problems with other methods. This was the one that worked. Give it a try.

Start command prompt on your computer to navigate where the APK file is located. Enable USB debugging on your device and connect it to the computer via USB cable. Your phone will automatically rebooted and your app will now be saved as a system app.

jwoegerbauer said:
Must admit I don't understand your problem: an app either runs or runs not where it doesn't matter where it's located. That's also true if an app has root rights granted.
IMO only thing of interest is what Android app's permissions are granted. A permission SYSTEM / ALLOW_ALL what I think you expect to be there doesn't exist. See also here:
https://developer.android.com/reference/android/Manifest.permission#public-constructors_1
Click to expand...
Click to collapse
Fore instance there is some permissions like REBOOT that require a system app you will not be able to reboot through PowerManager otherwise even if I know you can rebbot by other means on a rooted phone using some su command.

FailSafeNow said:
I ran into problems with a couple of methods as well. People said they would work, but they were no good. But do you know what has worked for me, reliably and consistently?
App Systemizer.
Just search for App Systemizer through Magisk. Download and install, then reboot. Now, open up a terminal with superuser privileges. Yeah, gotta use a terminal for this one. Open terminal and enter the command su (in case you didn't know how to get superuser privileges through a terminal). Once you've done that, enter the command systemize and then follow the prompts.
I had problems with other methods. This was the one that worked. Give it a try.
Click to expand...
Click to collapse
Yes thanks but if you read my first post you will see that I have tried Systemizer and it works in the sense that the app in installed inside system/priv-app folder and is able to run but it does not run as a system app

nihitthakkar said:
Start command prompt on your computer to navigate where the APK file is located. Enable USB debugging on your device and connect it to the computer via USB cable. Your phone will automatically rebooted and your app will now be saved as a system app.
Click to expand...
Click to collapse
I don't get it, you probable forgot to post something in your message

Lisadev said:
Yes thanks but if you read my first post you will see that I have tried Systemizer and it works in the sense that the app in installed inside system/priv-app folder and is able to run but it does not run as a system app
Click to expand...
Click to collapse
It doesn't? How can you tell? Maybe I've been missing something all this time. Maybe I only think App Systemizer works.

Lisadev said:
Não entendi, provavelmente você se esqueceu de postar algo em sua mensagem
Click to expand...
Click to collapse
Hello Friend! This question is a mystery to me. A while ago I created a thread explaining how to turn the Cerberus app into a system app and still survive a factory reset. I can guarantee you that my method worked until about 4 months ago.
This is the thread:
[GUIDE] [CERBERUS] [MAGISK] How to install Cerberus as System app.
Hello friends, I bring good news. Yes! It is possible to install Cerberus as a system app. (Even if it's rooted with Magisk) Yes, Cerberus will survive a factory reset. And your device will be traceable after a factory reset. Obviously the...
forum.xda-developers.com
For some reason now I also can't make an apk stay in Priv-app after reboot.
Even after I successfully flash vbmeta.img as described in the link below, I can't get it to work.
How to disable dm-verity or Android Verified Boot (AVB)
This is a quick guide showing how to disable dm_verity or Android Verified Boot (AVB). Disabling dm-verity / AVB is only important if you intend to flash custom images such as patched boot, custom rec
forum.hovatek.com
The question that everybody wants to hear. Did any methods work for you?

At the time of posting this (9th oct, 2021), this method works in my Android 10 (dunno 11, but most prob.)
Used Magisk root
1) First step, make /system writable (google made it read-only) by applying instruction from this thread - https://forum.xda-developers.com/t/script-android-10-universal-mount-system-read-write-r-w.4247311/
This will make sure that folders moved into /system/app or /system/priv-app are permanent across reboots.
2) Install Lucky Patcher (search google to download)
3) Go to Magisk manager and install Lucky Patcher Module for moving apps to system.
4) Normally install the app you are aiming for. Grant it all necessary permissions by going to apps settings. (don't skip this particular step. Skipping it can make permissions not able to grant later on)
5) Go to Lucky Patcher and select the app, select tools option and then select move to /system/priv-app. Tick the use Magisk module checkbox
( No, not done yet. Remember, module only mounts the app, not truly move it to /system/priv-app )
6) Turn off the Lucky Patcher Module in Magisk and reboot. You will notice app has disappeared from system (expected behaviour)(don't skip this step)
7) Open a terminal app.
Type-
su
mount -o remount,rw /
After success (may need to reboot),
open a root file manager, go to folder /data/adb/modules/luckypatcher_apps/system
Here, you would find the real apk folder for /system/priv-app as well as the permission configuration for /system/etc/permissions
Copy both folders to respective /system directories.
(we use Lucky Patcher here since it generates correct files with the right permissions, but of course, App Systemizer may also be used, but the steps change and I don't use it, so continue)
8) Go to /data/data folder and delete the app data folder for the app that was moved to /system/priv-app (prevents bugs if any)
9) Reboot phone. Now the app you wanted is fully system privileged with it actually existing in /system/priv-app (can check with TWRP's file manager).
There is no modules like App Systemizer or Lucky Patcher module mounting it. Done.
10) As an aside, just delete the /data/adb/modules/luckypatcher_apps/system folder. Like this, no problem will arise even if you enable this module again for whatever reason.
That's it, all done. Survival across reboots is already a sure thing. Now try to Factory Reset if you want to test if it survives across resets.
*Note - Of course, just make a Nandroid and internal SD backup in case.
Who doesn't want a "Save Game" option in life?

System App is not easily uninstalled by user, so it is a type of must have app as a android OS for a specific vendor(HTC, MOTO, Samsung).
Now how we can make an app as a system App.
Have source code
Have .apk Only
Step 1 Create a folder inside packages/apps/
First create a folder for your app ( Let say MyTestApp) inside packages/apps/ of your android AOSP downloaded source code.
Then create a Android.mk file inside the folder(MyTestApp).
Step 2 open Android.mk file and add folowing code Snippet and save this mk file.
Step 3 put your app name in build/target/product/ folder
open core.mk file from build/target/product/ folder and add your app name(MyTestApp) in
PRODUCT_PACKAGES tag at the bottom MyTestApp.
Now step by step procedure for .apk file
Step 1 will be same like above
only change is that in place of src, res folder just put your .apk file.
step 2 open Android.mk file and add folowing code Snippet.
Step 3 will be same as above mention for Android source code (a)
This is all about how to make an android app as a system App.

Jeffrey A. Hancock said:
System App is not easily uninstalled by user, so it is a type of must have app as a android OS for a specific vendor(HTC, MOTO, Samsung).
Now how we can make an app as a system App.
Have source code
Have .apk Only
Step 1 Create a folder inside packages/apps/
First create a folder for your app ( Let say MyTestApp) inside packages/apps/ of your android AOSP downloaded source code.
Then create a Android.mk file inside the folder(MyTestApp).
Step 2 open Android.mk file and add folowing code Snippet and save this mk file.
Step 3 put your app name in build/target/product/ folder
open core.mk file from build/target/product/ folder and add your app name(MyTestApp) in
PRODUCT_PACKAGES tag at the bottom MyTestApp.
Now step by step procedure for .apk file
Step 1 will be same like above
only change is that in place of src, res folder just put your .apk file.
step 2 open Android.mk file and add folowing code Snippet.
Step 3 will be same as above mention for Android source code (a)
This is all about how to make an android app as a system App.
Click to expand...
Click to collapse
This means to compile the ROM yourself?

Related

GUIDES & FAQs [Android]: ADB Workshop by Adrynalyne and Guide by Captainkrtek

DO NOT POST IN THIS THREAD BEFORE READING THE WHOLE POST
PLEASE ADD GUIDES TO COMMON ISSUES YOURSELVES
To my recollection, the previous WM Guides thread was successful.. so we'll be moving on to android as well - from beginner to pro.
I hope this thread will provide answers to a decent percentage of your questions.
Please hold until guide collecting is finished..
In the meanwhile you are ALL invited to send me links or full guides to add to this thread.. remember, we are all about sharing.
COMING SOON! (in the meanwhile, you've got a great battery life guide at http://forum.xda-developers.com/showthread.php?t=471521 - be sure to thank BruceElliot for it!)
also, if you decide to post a guide, please keep the guide as neat as possible, with a title containing the LEVEL ([BEGINNER], [INTERMEDIATE], [PRO]) and the commonly searched words so that people who look for it can find it easily. (if you can, use the same color (dark orange) and same size (4) and Bold.. for the main title.. tho that's not a must )
post #2. [BEGINNERS+INTERMEDIATE] Replacing System Files using Android Commander
post #3. [EVERYONE] ADB Workshop by Adrynalyne and Guide by Captainkrtek
post #4. [QUICK FAQ's] Common QnA's for beginners by Timmymarsh (work in progress)
[BEGINNERS] Replacing system files using Android Commander
Replacing system files using Android Commander:
(This post was formally based in the HD2's RTL support thread and revolved around our need to replace frameworks)
so:
1. Download the android SDK from: http://dl.google.com/android/android...08-windows.zip
2. EXTRACT(!!!) the android-sdk-windows to c:\
(make sure you extract the dir - not run the setup from inside the zip file)
3. install Android Commander from http://androidcommander.com
4. Connect your device and make sure it's set to Debugging mode in /settings/applications/development/
5. You might have to set a dir containing your adb.exe file. set it to c:\android-sdk-windows\tools\
6. You will see a Total Commander-like interface. you can then copy the framework.jar file to the correct directory (there's no difference between SD android builds and androids in ROM - the system dir will be shown the same way)
a. Yes, you can replace/delete system files while android is running.
b. (for androids running from SD) Any file copied to /sdcard/android/root/system/X will be copied to /system/X in the system file. The sdcard/android root dir is JUST LIKE your root in ROM androids.
c. Make sure you either created a backup or verified a match in any other way before replacing files like frameworks, zimage, modules, etc.. your android might not boot afterwards (I keep all system.ext2 files backed up so that i can restore them incase i screw something up.)
enjoy
[EVERYONE] ADB Workshop by Adrynalyne and Guide by Captainkrtek
This following guide was rewritten by Captainkrtek, please make sure to thank him for it
Original Post:
(http://forum.xda-developers.com/showthread.php?t=879701)
This workshop was held in #android-learning on irc.freenode.net by XDA Member Adrynalyne. All credit to him for this guide, I simply am taking it and turning it into a guide. Here we go!
You can find the raw IRC log here
Good evening folks, and welcome to my ADB workshop. This is by no means a full explanation on the subject, but more of a crash course to help folks get up to speed, and get more from their devices. There may be some things you already know here, so please be patient and respect those who do not.
Reference Files
http://adrynalyne.us/files/How to install adb.pdf
http://adrynalyne.us/files/Using ADB.pdf
So, lets just start with the basics.
What is ADB?
ADB stands for the android debugging bridge and is used for testing and debugging purposes by developers.
However, we like to get more out of our devices, and its a great way to fix things.
Knowing adb can mean the difference between a paperweight and a working phone.
So, to start with, we will look at installing ADB.
Generally speaking, the Sun/Oracle JDK is required to run all SDK functions.
ADB is but one tool in the SDK arsenal.
So, we begin by downloading and installing the JDK. This can be found here:
https://cds.sun.com/is-bin/[email protected]_Developer
Choose your OS, download and install. I recommend that 64 bit users use the regular x86/32 bit version as well.
Moving ahead, we download the Windows sdk from here:
http://dl.google.com/android/installer_r08-windows.exe
Due to already installing JDK, you won't be stopped by the install process.
Now, if you notice, I installed it to:
C:\android-sdk-windows
I did this because it makes things easier when setting up path variables.
I encourage everyone to do the same, but obviously it is not required.
So, this SDK is handy, but is only good up to 2.2. We want the latest and greatest! (Well I do)
So, we navigate to:
C:\android-sdk-windows\
and we run SDK Manager.exe
If you notice in your PDF file for installing adb, you will notice that you can update, and I made a choice not to include earlier sdk versions.
I won't go into full detail on that, but depending on the version of SDK you have, 8 or 9, it WILL make a difference in using adb.
By default, for version 8 adb.exe resides in C:\android-sdk-windows\tools
By default, for version 9 adb.exe resides in C:\android-sdk-windows\platform-tools
We will assume version 9 in this guide
Really, the SDK is installed and adb is usable right now, but in my humble opinion, its not enough
I like the ability to use adb in ANY directory on my machine.
To do this, we edit Windows's environment variables.
Specifically, the system path.
To do this, we click on start, or the orb (depending on OS), and right click on Computer, left clicking on properties in the menu.
If its windows XP, I believe it brings you into advanced system properties immediatly. Vista and 7 need a second step.
On the left hand side, as you notice I have highlighted in the pdf, left click advanced system settings.
Under advanced tab, we left click environment variables...
There are two boxes here.
We are concerned with system variables, however.
So we scroll down the list and highlight path and click edit.
Ignoring all the extra stuff in here, make sure you are at the end of the line, and type
Code:
;C:\android-sdk-windows\platform-tools
The semicolon allows us to separate it
from the previous path statement.
Click ok all the way out.
We now have ADB setup globally. We can use cmd.exe (I use powershell) and no matter what directory we are in, adb is recognized.
If it is not, make certain you entered the path into system variables, and made no typos.
If you installed to a different location, you will need to adjust the path accordingly.
This concludes the section on installing the Android SDK to use ADB.
This next section will be on using ADB, so please open that pdf now.
Now, this applies to any OS, not just Windows.
Well, with the exception of the USB drivers.
I will not go too much into that, but if you take a look at the PDF, it goes through installing usb drivers for the sdk, and how to download them.
Fiarly straightforward, in that rspect.
Now, to setup our phones to use with the SDK and ADB, we must change some settings.
First, we go to menu softkey, then settings.
We scroll down to Applications and tap it.
Under Development, we will check Enable USB Debugging. Please note the SGS phones are different in this respect.
The USB cable must be unplugged before enabling or disabling this setting.
Once this is done, we are now ready to play with adb
One quick note: If you get device not found/conencted, please reboot your phone. DJ05 has a quirk in it where ADBD randomly crashes on boot.
A reboot will fix this
ADBD= ADB Daemon
Ok, continuing on.
Lets look at installing applications. This is also known as sideloading.
Unlike installing from the SD card, it does not require unknown sources to be enabled.
The command for this is
Code:
adb install packagename
This assumes that you are working from the directory where the file is located.
This will install the application to /data/app.
It will also show sometimes useful errors if install fails.
That is not something you will see from the Android GUI.
Now, a lot of us have probably deleted files with apps like Root Explorer. While this isn't really a bad thing, it leaves behind databases and data for the application removed.
This is where the 0kb applicaiton entries come from.
If you take that application entry name, you can uninstall the extra data via adb.
First we go to the adb shell which logs into the phone.
Code:
adb shell
If we end up with a $, we will want admin rights, in many cases. This is not one of them, I don't beleive.
To get admin rights, you want to type
Code:
su
Look at your phone if this is the first time, it may prompt you to allow access. Else you will get permission denied.
If you are not rooted, this will not work either.
Ok, now that we are logged in, we will type
Code:
pm uninstall packagename
where packagename is the name of the 0kb listing.
Now this seems like a pain in the a** and I agree.
HOWEVER
There will be a time where Manage applications crashes when you try to uninstall it from the phone. In this case, a factory reset, or this method is the only effective way to fix the problem.
Moving on.
How many of us have removed system applications or renamed them? Did you know that you can simply disable them from the system?
Code:
adb shell
su
pm disable appllicationname
This will disable it, and the system will ignore it.
This can be seen as safer than deleting or renaming things, but your mileage may vary.
On the other hand, you can also re-enable these applications.
Code:
adb shell
su
pm enable applicationname
Please note: Not all applications will properly re-enable. I believe a factory reset or reinstall of said application will fix the issue.
Also, application names are absolutely case sensitive.
*nix based Operating Systems see the letter 'a' and 'A' as two different things.
when you log into adb shell, you are playing by android rules
Ok, a lot of us tweak and mod our phones and turning off the device to get to clockwork recovery, or battery pulls, or multiple button holds to get into Download mode are troublesome and annoying at best.
ADB can help us here.
Here, we do not need to be logged into the shell
If we want to merely reboot the phone:
Code:
adb reboot
If we want to go to recovery (works well with voodoo5)
Code:
adb reboot recovery
If we want to go to Download Mode because we need Odin, heaven forbid:
Code:
adb reboot download
Its instant. No waiting on animations or anything else.
Its also handy if Android has locked up, but yet still works in adb.
I for one hate taking my case off to battery pull.
So now we move on to pushing and pulling files.
Sometimes, I don't feel like mounting my sd card to copy a file over to my phone.
I can use this command to push a file straight to my sd card:
Code:
adb push filename /pathtodirectoryonphone
So for instance, if I have test.txt that I want to send, I would type:
Code:
adb push test.txt /sdcard/
and there it goes.
Ok moving on
Pushing files can be done to any directory, however, some are protected.
For instance, /system is going to give you a permission denied or a read only filesystem error.
To get around this, the easiest thing to do is push the file to your sdcard, then log into the shell:
Code:
adb shell
Code:
su
We will then mount the system as writable
Code:
mount -o rw,remount /dev/block/stl9 /system
Then we can use something like
Code:
cp /sdcard/test.txt /system/app/test.txt
cp stands for copy
and it requires the path of the file and destination path. The name of the file is optional
When you copy it, you can rename it to whatever you like.
For instance, if we wanted to backup a file
Code:
cp /sdcard/test.txt /sdcard/backuptest.txt
Now, lets assume you do not have busybox installed.
You non rooted users will not.
Then you must use a slightly more complicated command called dd
This is used like this:
Code:
dd if=/sdcard/test.txt of=/system/app/test.txt
if is for inputfile
of= output file
Not every user friendly, but probably one of the safer copy commands.
Ok, moving on to pulling files.
Lets say you want to get a file from your phone, to modify, backup, etc.
To do this, we simply use adb in this manner:
Code:
adb pull /pathtofile/filename destinationname
For instance, if I wanted to backup ADW launcher in system/app
I would do this
Code:
adb pull /system/app/ADWLaucnher.apk ADWLauncher.apk
And it will pull the file from the phone and put it in the current directory.
Like above, you can specifcy where it goes.
pushing files to the sdcard, it seems prudent to talk about changing permissions.
sdcards are typically fat32, which destroys permisisons, and Android is heavily permission based.
So if you push an application to your sd card, then try to copy it to /system/app/ bad things are going to happen, or the app may not even show up.
So in that case, we use something called chmod.
This is used in this manner
Code:
adb shell
su
chmod 755 /pathtoapplication/applicationname
Keep in mind
you dont want to do this while its still on your sd card.
an example
Code:
adb shell
su
chmod 755 /system/app/ADWLauncher.apk
755 is good for applications and script files.
Just a couple more topics to cover.
Lets go over deleting files.
This becomes especially handy for removing rogue applications.
To do this, we must be in the adb shell.
Code:
adb shell
su
rm /system/app/ADWLauncher.apk
You may need to remount system as writable with:
Code:
mount -o rw,remount /dev/block/stl9 /system
That applies when using chmod as well.
So what I did above was delete ADW Launcher from system/app
However, what if I wanted to delete the entire contents of a directory?
Same thing as before, except
Code:
adb shell
rm -f /data/dalvik-cache/*.*
I just cleared my dalvik-cache with that command
very quick, very effective.
If you just tried that, please reboot your phone now
Ok....this leaves us with the final topic: logcat
logcat allows us to log what the OS is doing, and possibly delve information for when things are not working
its quite simple Reading it is another.
To use logcat
Code:
adb shell
logcat
To logcat to a certain file do
Code:
adb shell
logcat > /sdcard/logcat.txt
Now we let the log settle down to a reasonable amount of data coming in and not a wall of scrolling, then start the app in question. When it gives an error, we hit ctrl-C and kill the adb shell session.
This should have captured enough data to see the error. Now, I prepared an example. A user came to me on IRC, and Google Maps was force closing. Clearing data didnt fix it, Clearing dalvik-cache, and fix permissions did not fix it. In this case, the user did not know how to use adb So I had him grab an app called alogcat from the market and email me the log. This is also a very valid method.
this file explains what the problem was, and highlights what to look for as an example.
http://adrynalyne.us/files/logcat.pdf
___________________________________________________________________
This concludes the guide from Adrynalyne, there will be more workshops such as this one in irc.freenode.net #android-learning.
Thanks to everyone in #samsung-fascinate !
QUICK FAQ's
sources: Q&A Section, The Weekly Q&A Section by XDA News Writers (thanks guys)
Q: ‘Is there any way to block specific apps from using my data connection?’
A: Try the Droid Wall application.
Q: ‘I read how you can make changes in the build.prop file on my Android device. How exactly do I get to it?’
A: Install ASTRO file manager, browse to /system, long press on build.prop – Edit – Copy. Press on the home icon then Edit icon – Paste. Connect sd card, edit it, and paste it over from where you copied build.prop
Q: What happens if I update my phone? will I need to re-root it and get the ROM again? will all of my applications get erased? If so, is there a way around this?
A: You will lose your root, but not apps if it is just an update.
Q: I just tried to flash a ROM from recovery on my Android phone and got “Verification Failed, Installation Aborted” What happened?
A: Before you can flash a custom ROM the .zip file must be digitally signed in the ROM kitchen, if unzipped and re-zipped it will lose its verification, this happens often using the Safari browser as it likes to decompress .zip’s. Or if your download is corrupted (download the ROM again) it will fail the Verification.
Q - HTC Location Widget shows "map data unavailable"
A - On the widget, click the pin/then click the windows button/click get more/scroll to download maps/download relevant map (care, maybe a big file). Now exit and click onto map, your location should now be visible :)
Q:So, I moved all the apps on the SD, but is still not enough. How can I free some memory? I could delete the cache of the older upgrade or something else?
A:Do you have pictures and videos? If so, check if they are on the SD card and not on your internal memory. Cleaning your cache helps, and try deleting your text messages threads.
Q: ‘What exactly is a kernel and what are the benefits in changing it?’
A: A kernel is a bridge between the applications and the actual data processing done at the hardware level. The kernel’s responsibilities include managing the system’s resources – the communication between hardware and software components. Flashing different kernels gives you different operating speeds, better battery life, the ability to overclock, and more.
Android control other device with IOIO Board.
It use ADB.
http://androidcontrol.blogspot.com/2011/10/ioio-board-for-android-control-io.html
timmymarsh said:
QUICK FAQ's
sources: Q&A Section, The Weekly Q&A Section by XDA News Writers (thanks guys)
Q: ‘Is there any way to block specific apps from using my data connection?’
A: Try the Droid Wall application.
Q: ‘I read how you can make changes in the build.prop file on my Android device. How exactly do I get to it?’
A: Install ASTRO file manager, browse to /system, long press on build.prop – Edit – Copy. Press on the home icon then Edit icon – Paste. Connect sd card, edit it, and paste it over from where you copied build.prop
Q: What happens if I update my phone? will I need to re-root it and get the ROM again? will all of my applications get erased? If so, is there a way around this?
A: You will lose your root, but not apps if it is just an update.
Q: I just tried to flash a ROM from recovery on my Android phone and got “Verification Failed, Installation Aborted” What happened?
A: Before you can flash a custom ROM the .zip file must be digitally signed in the ROM kitchen, if unzipped and re-zipped it will lose its verification, this happens often using the Safari browser as it likes to decompress .zip’s. Or if your download is corrupted (download the ROM again) it will fail the Verification.
Q - HTC Location Widget shows "map data unavailable"
A - On the widget, click the pin/then click the windows button/click get more/scroll to download maps/download relevant map (care, maybe a big file). Now exit and click onto map, your location should now be visible :)
Q:So, I moved all the apps on the SD, but is still not enough. How can I free some memory? I could delete the cache of the older upgrade or something else?
A:Do you have pictures and videos? If so, check if they are on the SD card and not on your internal memory. Cleaning your cache helps, and try deleting your text messages threads.
Q: ‘What exactly is a kernel and what are the benefits in changing it?’
A: A kernel is a bridge between the applications and the actual data processing done at the hardware level. The kernel’s responsibilities include managing the system’s resources – the communication between hardware and software components. Flashing different kernels gives you different operating speeds, better battery life, the ability to overclock, and more.
Click to expand...
Click to collapse
Thank you for your patience and taking the time to answer those questions. I loved your simple and easily digestible format.
There is a note
*nix based Operating Systems see the letter 'a' and 'A' as two different things.
when you log into adb shell, you are playing by android rules
Click to expand...
Click to collapse
this note is all wrong..
1. linNUX is not *NIX.
2. Mac OS-X is a *NIX OS, it is based upon UNIX, they use their own variant called Darwin. Darwin does not require capitolization.
3. The word should be POSIX. Linux is POSIX compliant and POSIX defines the capitolization standardards
soft brick
Taioba said:
Is there any way to use ADB even though I can not enable USB debugging by the android?
I have an Atrix with soft-brick. How can I restore a file (framework-res.apk) knowing that my USB debugging is off?
I can enable ADB via fastboot?
Thanks!
Click to expand...
Click to collapse
I found this for atrix 4g....
http://forum.xda-developers.com/showthread.php?t=965546
hope it helps
knoknot said:
i have a bricked s2 not so sure how to go about reviving it via adb
Click to expand...
Click to collapse
check this thread
http://forum.xda-developers.com/showthread.php?t=1237815
thanks. searched for that
Thanks for it.
Great Guys............ :good:
Thanks for sharing.
Thanks for sharing this guild :d, i am new member for reccod
Great job~ Sometimes could be used this.
I'm using Windows 10 RTM and I've set the path, yet I still get the "unrecognized application" error in the command console. What am I missing?
Nevermind, a restart fixed it. Used to be you didn't have to.... sheesh.
nir36 said:
Replacing system files using Android Commander:
(This post was formally based in the HD2's RTL support thread and revolved around our need to replace frameworks)
so:
1. Download the android SDK from: http://dl.google.com/android/android...08-windows.zip
2. EXTRACT(!!!) the android-sdk-windows to c:\
(make sure you extract the dir - not run the setup from inside the zip file)
3. install Android Commander from http://androidcommander.com
4. Connect your device and make sure it's set to Debugging mode in /settings/applications/development/
5. You might have to set a dir containing your adb.exe file. set it to c:\android-sdk-windows\tools\
6. You will see a Total Commander-like interface. you can then copy the framework.jar file to the correct directory (there's no difference between SD android builds and androids in ROM - the system dir will be shown the same way)
a. Yes, you can replace/delete system files while android is running.
b. (for androids running from SD) Any file copied to /sdcard/android/root/system/X will be copied to /system/X in the system file. The sdcard/android root dir is JUST LIKE your root in ROM androids.
c. Make sure you either created a backup or verified a match in any other way before replacing files like frameworks, zimage, modules, etc.. your android might not boot afterwards (I keep all system.ext2 files backed up so that i can restore them incase i screw something up.)
enjoy
Click to expand...
Click to collapse
Thanks, this Guide is very informative
Help with LG D722
I'm using LG D722 phone and I somehow unlocked bootloader and installed twrp recovery. I backed up Lollipop that's what I'm using and i want to restore custom ROM
I know I need to install Google Apps after installing Custom ROM. But Do I also need to install Modem files on my device ? Because I can't find them on XDA Forums. Please give me a link or something. The help is not just appreciated but seriously needed.
Success. Thanks
Hello, I walk testing one recovery but I'm booting before flashing, the question is, will the recovery feel same when booted vs flashed? I've booted and used to flash a pair of zips but felt very laggy and bugged although did the work right. Thanks
Edit: solved, tried myself
Sent from my SHIELD Tablet K1 using XDA-Developers mobile app
http://forum.xda-developers.com/showthread.php?t=872128&page=2

BootBuddy - Run Boot Scripts from SDcard (a safe alternative to init.d)

INTRODUCTION:
Boot Buddy will allow you to run Linux shell scripts when your Android device is booting up. It will run your scripts early in the boot process, before the home screen appears.
The intended audience is generally intermediate to advanced users, and those who want to play with shell scripting on their device.
FEATURES:
BootBuddy is similar to init.d scripts, but with a core difference that it stores boot scripts on your SDcard instead of the internal system. This allows for several interesting enhancements. Feature listing-
Much more Safe than init.d. If you have a script that is malfunctioning, just boot with the sdcard out, and put the sdcard back in after your device reaches home screen. Your device is Saved, No Problem!
Boot Buddy is designed from the start to run scripts right from your SDcard. Just download any scripts to your boot_buddy_scripts directory and they're ready to run. (No more screwing around with permissions and files in your /system/etc/init.d/*)
SDcard storage allows you to copy a script to another device, or multiple devices easily.
Boot Buddy's author has several years of scripting and programming experience. It is streamlined, fast, and doesn't perform worthless functions like repeatedly logging the authors name and time (*hint to a t-init author*).
Clear goals of making operation simple, intuitive, and clean.
If you're currently using an "init.d" solution, BootBuddy can integrate seamlessly with it.
If you try BootBuddy and you don't like it, the installer also works as an uninstaller for easy clean removal.
BootBuddy is Open Source GNU GPL. Open for anyone to modify and improve upon.
As a developer, I make software to operate the way I would want if I were an end user, because I actually do use it, and I am an end user like you.
REQUIREMENTS:
Android 4.0 and up
Rooted device
An sdcard
Script Manager Free (or any other app that can run scripts as root)
Boot Buddy Installer bb_install.sh
INSTALL:
Start Script Manager, and allow/grant root access.
Navigate to the bb_install.sh file.
Tap on the file to show the menu options.
At the top, highlight the "Su" icon.
On the top-left, tap "Run".
The script will run quickly. It will automatically detect your sdcard location and create a folder on your sdcard named "boot_buddy_scripts". In that folder, you put the scripts you want to run at system boot. A log file will be kept at /data/boot_buddy.log
If you need your scripts to run in order, they are ordered by filename using the busybox "sort" program. They will run in alphabetical order using this format 0-9A-Za-z.
YOUR FIRST SCRIPTS: (OPTIONAL)
Here are a couple example scripts you may use.
The Android /system is normally mounted with read-only permissions by default. We will change that with the first script listed below. It will cause /system to be remounted to read-write permissions during boot.
The second script will create a file at every boot named /mnt/sdcard/sys_mount_info.txt. That txt file will give us information about how /system is currently mounted.
Download the file 00rw_system.sh into your boot_buddy_scripts folder.
Download the file 99sys_mount_info.sh into your boot_buddy_scripts folder.
Reboot your phone.
That's it, you just installed 2 new scripts and had them run at boot. It's Really just that simple to add startup scripts to your system.
To verify they are running, use any text viewer to open the file /mnt/sdcard/sys_mount_info.txt. It may show more than one line of text. There should be a line similar to this:
/dev/block/(device specific text) /system (fstype) rw,(more text)
The rw means that /system was successfully remounted as read-write during boot.
At any time you can delete either script if you choose. Easy!
UNINSTALL:
If for any reason you find you don't want or don't like Boot Buddy, you can cleanly uninstall it using the installer bb_install.sh. These instructions are almost identical to installing. (All match the installation steps, except step 4)
Start Script Manager, and allow/grant root access.
Navigate to the bb_install.sh file.
Tap on the file to show the menu options.
Type --uninstall in the text area labeled Arguments.
At the top, highlight the "Su" icon.
On the top-left, tap "Run".
Boot Buddy will be uninstalled. It will not remove the contents of your boot_buddy_scripts folder. If you have an "init.d" system installed, it will cleanly remove only Boot Buddy parts and leave the rest.
MUST READ
ADVANCED NOTES:
Boot Buddy will Not cause harm to your system, but it may not work on custom roms. Also, it may fail to detect the real location of your SDcard. It requires that /system/etc/install-recovery.sh is run during the boot process, and that file will be created if it does not exist. Also the file /data/boot_buddy.sh will be created. The script /system/etc/install-recovery.sh will run /data/boot_buddy.sh. The script /data/boot_buddy.sh will run the scripts on your sdcard. The file /data/boot_buddy.log will log any script output.
For Windows and Mac users- If you download the installer to your pc first, do not edit the installer with a text editor. Your computer will add hidden markers at the ends of each line that will prevent the installer from running. If you want to edit it, you should do so on a Linux pc or directly on your Android device.
Tell us about your results!!!
BootBuddy source code: http://github.com/Sepero/bootbuddy
NOTE : I AM NOT A DEVELOPER I AM ONLY SHARING THIS. So Try On Your Own Risk. I Can't Help Anything.
Credits :
[email protected]
Script mgr says I'm not root, despite me in a root terminal elsewhere. wtf ?? ...
I'm not root in script mgr., even though I'm showing up as root in terminal.
I've installed Super user (chains sd ), just in case the App doesn't support my other Supersu App or similar.
I've utilised the su icon and run.
I did tick run as executable.
No reboot tried.
What am I missing ??
Please advise.
I give you 5 stars to the thread
Almost first!!! haha.... this is awesome dude this could be HUGE.
Steve Eligoyo said:
I'm not root in script mgr., even though I'm showing up as root in terminal.
I've installed Super user (chains sd ), just in case the App doesn't support my other Supersu App or similar.
I've utilised the su icon and run.
I did tick run as executable.
No reboot tried.
What am I missing ??
Please advise.
Click to expand...
Click to collapse
You must to select root when start on script mgr, you have skull head with crossed bones
Steps to complete failure: Page 96 ?? ...
Here are the steps I've taken to get kicked in the teeth:
Boot phone > menu > script mgr. > start > scroll to file (in this case bb _install.sh ) > open file > tick su ( tried boot and bgr several times, nada amigo ) as instructions state > run > unexpected oper error: your not root > rinse and repeat sixty times > open terminal > su > Works just fine > Post my question on xda in the WTF Thread
Update:
After creating the directories and files needed to make this train wreck into a working setup, (obviously a few are missing here, working on it), I reopened script mgr and browsed the file system, which shows bb _install.sh file (and the other two in this
Thread as well) with the green su skull and crossbones with the boot dot next to those skulls, yet the apps shell /console says oper error - Your not root.
Again, I open terminal, su > enter > Viola!, I'm root.
I've installed the sdcard v. of script mgr as well and I get a message stating /data/system/xbin does not exist.
I'll likely need to tweak the script mgr settings to /sdcard 0/externalsd /directory bind /system /xbin/bb _install.sh - something like that.
Still doesn't explain why the app is putting the brakes on root terminal in the nag screen.
Any ideas ??
MAN THANK YOU !!!! as a noob i couldn´t get init.d to work right. so i tried your script on the xperia z3c with stock 4.4.4
to make it compatible with z3c you need to edit the file /data/boot-buddy.sh after the installation
and replace both
/boot_buddy_scripts/
with
/storage/emulated/legacy/boot_buddy_scripts/
or
/storage/sdcard1/boot_buddy_scripts/
or another prefered location
then make a new folder boot_buddy_scripts in the location.
really it executes the scripts way before the apps are starting , this is so nice and will be on my phones from now on !
edit: i also now changed the log file creation to the sd card for quick access (most filebrowsers open there by default)..
the logfile is major awesome btw if something didn´t go right , its easy to debug , thanx alot again
Won't install says I don't have busybox. I have it but it has to go in system bin instead of xbin. Amy way to get this working?

Root Remix OS for PC

This guide is to root Remix OS for PC
You will need Ubuntu for Rooting (You can download and run it in live CD)
If you are experienced with linux systems don't read whats written in bracket
1. Download and Extract RemixRoot.zip
2. Copy system.img from your pendrive or hdd wherever you have installed Remix Os to this folder (ie RemixRoot folder it should be alongside Readme.txt)
3. Open Terminal (Ctrl+Alt+T)
4. Type
Code:
sudo -i
5. Enter your password (If you are running in live cd then no password)
6. Change directory to RootRemix folder (Goto tmp folder, right click and goto properties and copy location, this is your <dir> replace it in command below )
Code:
cd <dir>
7. If you did it right next line of terminal will end with RemixRoot# followed by blinking cursor
8. Now run rootx.sh script by typing
Code:
sh rootx.sh
9. If everything goes right there wont be any error message and you will get a root.img in your RemixRoot folder
10. Rename it to system.img and copy to your pendrive/hdd replacing previous system.img
11. Reboot and go to RemixOS and update SuperSU binaries
12. That's it! you are now rooted
Thanks to Chainfire & hackarchive
I tried it but i got no system.img, i got r/w access to system (choosen by install) so i tried to symlink it to my system directory and commented out all image mounted related things from script and then tried it.
but after that i cannot boot android anymore, i think the problem is app_process linking to daemonsu, since i set back to original it boots like normal but no superuser access. SuperSU said theres is no superuser installed.
Any suggestion?
Silly question but will I lose root access if I update to the newest version by flashing the new image over the top?
Yes a silly question.... Deserves a silly answer. It will still be underneath, but good luck trying to retrace it!
any other method for rooting, without using ubuntu?
#tested with ubuntu live, and it works like a charms. Thank you..
Sent from my C46G using XDA Premium 4 mobile app
ninharp said:
I tried it but i got no system.img, i got r/w access to system (choosen by install) so i tried to symlink it to my system directory and commented out all image mounted related things from script and then tried it.
but after that i cannot boot android anymore, i think the problem is app_process linking to daemonsu, since i set back to original it boots like normal but no superuser access. SuperSU said theres is no superuser installed.
Any suggestion?
Click to expand...
Click to collapse
same problem here.
Hope same other method can solved
I modified the original script to work with the system folder installation and i removed all app_processX dependend things from script (dunno if it affects the root in any way, cannot find any issue by now) Read the Readme.txt for further installation instructions. The link you find on the reddit sub that GoPal has posted! I cannot post links right now.
Try this
kretex said:
Hope same other method can solved
Click to expand...
Click to collapse
ninharp said:
I tried it but i got no system.img, i got r/w access to system (choosen by install) so i tried to symlink it to my system directory and commented out all image mounted related things from script and then tried it.
but after that i cannot boot android anymore, i think the problem is app_process linking to daemonsu, since i set back to original it boots like normal but no superuser access. SuperSU said theres is no superuser installed.
Any suggestion?
Click to expand...
Click to collapse
You will get root.img file you will have to rename it to system.img
masdeco said:
same problem here.
Click to expand...
Click to collapse
Me too [emoji25]
Envoyé de mon E5333 en utilisant Tapatalk
I've just installed RemixOS 2.0 onto a partition on my Lenovo X200T. I followed the instructions and all was good until I tried to run SuperSU. When it tried to update via the normal method the install failed and asked for a reboot. Any suggestions.
ninharp said:
I modified the original script to work with the system folder installation and i removed all app_processX dependend things from script (dunno if it affects the root in any way, cannot find any issue by now) Read the Readme.txt for further installation instructions. The link you find on the reddit sub that GoPal has posted! I cannot post links right now.
Try this
Click to expand...
Click to collapse
the answer is replace the system folder. this is my methode :
1. copy the system img from the extracted remix iso to somewhere
2. then run the script
3. unpack the system img that already rooted and copy all the content to the system folder of the remix (replace)
4. done. Remix os rooted.
Guys, I installed Remix to ext4 partition (in order to use all free space), so there's no "system.img" on it (but there's "system" folder). How to modify the script or to root Remix other way?
masdeco, thanks for the idea! How do you unpack img file, btw?
4ezahernya said:
Guys, I installed Remix to ext4 partition (in order to use all free space), so there's no "system.img" on it (but there's "system" folder). How to modify the script or to root Remix other way?
masdeco, thanks for the idea! How do you unpack img file, btw?
Click to expand...
Click to collapse
after root the system img then mount it, copy all the content to the system folder of your remix.
since I am a linux user so I use this command :
mount -o loop system.img tmp
this is so cool cool
Works Lenovo Yoga 2 11
Installed to a partition on my HD:
Downloaded RemixOS iso
extracted contents of iso
created temp, data and system folders
ran this tool to root the system.img (now root.img)
renamed root.img back to system.img
mounted system.img to temp folder
copied contents of temp folder to system folder
added entry in grub
now I am triple booting Windows, Linux and RemixOS 2.0 Android with ROOT
Thank You!!!
here is a xdelta3 for patching system.img for those using Remix OS 2 from a USB stick and run windows
GizmoTheGreen said:
here is a xdelta3 for patching system.img for those using Remix OS 2 from a USB stick and run windows
Click to expand...
Click to collapse
can you please explain its usage?
the_poolee said:
can you please explain its usage?
Click to expand...
Click to collapse
me too!
Please
the_poolee said:
can you please explain its usage?
Click to expand...
Click to collapse
dariett said:
me too!
Please
Click to expand...
Click to collapse
it shouldn't be too hard to figure out, put the files in your folder of choice with the system.img from your usb stick, run the batfile. it should create a file named rooted system image, now just replace system.img on your usb stick with that and run...
ofcourse I am assuming your system.img is identical to the one I had, which it should be if it was the 2.0 dev preview which is the only thing you can get today, right?

[script]replace kingroot's kinguser with supersu

Remove KingRoot’s KingUser with SuperSU using Terminal [Requires Intermediate skills]
This method works for almost all the android devices and works the best, However, it requires some decent skills to follow the instructions and copy the commands listed below into the Terminal app.
The link of the script which is shared below works without a computer system/PC, Hence the steps I’m listing below won’t require a computer PC. So are you ready?
Downloads
This download section has the download links to the files or apps you will require to complete the below listed steps. Ready to shift from KingUser to SuperSU? What are you waiting for?
lets begin.
1.Download & Install Terminal Emulator App
2.Download SuperSu script from here http://www.mediafire.com/file/mxzbt42xypvn2ts/Replace_Kinguser_with_SuperSU-v2.4.zip and unzip it!
Steps to Replace KingUser with SuperSU?
Step 1: Extract the Replace_Kinguser_with_SuperSU ZIP File & Transfer the extracted version to Internal storage of device.
Install the Terminal app for Android and extract the Replace_Kinguser_with_SuperSU file and after extracting the Replace_Kinguser_with_supersu file transfer the “Extracted Folder – MRW” to outermost directory in the internal storage.
Step 2: Open Terminal Android App & Write the Following commands in the Android Terminal.
Open the terminal android app type the command “su” in the terminal, after writing the SU in terminal, you will be prompted with the message box asking you to deny/grant the functions. Granting permission will help you remove the kinguser on your smartphone.
After granting permissions you will have to type one single line of code, The other command will be: sh /sdcard/mrw/root.sh
After writing the above command, it might show some error, but ignore that error, it will automatically launch SuperSU, in case it doesn’t manually open SuperSU.
Once done, Restart your smartphone and you will see that SuperSU works flawlessly on your Smartphone. That’s all, you’ve successfully replaced KingRoot’s KingUser with Chainfire’s SuperSU.
Huge thanks to the Dev of the script
Source and Download link credits goes to Droidmen.com
Thread link of Droidmen: https://www.droidmen.com/remove-kingroot-kinguser-with-supersu/
I shared this guide from droidmen if you found this guide useful PLEASE HIT THANKS BUTTON!​
RESERVED
Good
Sent from my Redmi Note 3 using Tapatalk

			
				
can anyone confirm it in above 4.4 ?
sohamsen said:
can anyone confirm it in above 4.4 ?
Click to expand...
Click to collapse
Well it works on 4.4.2 but you need you manually uninstall kinguser in system after.
Arkonite said:
Well it works on 4.4.2 but you need you manually uninstall kinguser in system after.
Click to expand...
Click to collapse
mine uninstalled automatically
Replace kingroot with supersu
Here you can get the most effective way to replace kingroot with supersu;
How to replace kingroot with supersu
King roots

A Beginner’s Guide to Modifying Android Devices

Warning: Even an expert runs the risk of “bricking,” or locking up their Android device when modifying it. Often this is a ‘soft brick’ from which they can recover, but sometimes the device is “hard bricked” from which no recovery is possible, and the device becomes a source of spare parts. Proceed at your own risk. Neither the author, nor XDA is liable if you do “brick” your device.
Note: I have insufficient posts to include outside links. I'll add them when I do. Until then you'll need to search the 'net.
Keeping that in mind, you may wish to acquire an older model device to practice with before attempting to modify leading edge devices. Kijiji and Craig’s List are good sources for low cost, used devices that can be used for practice. I acquired the Samsung Galaxy S5 neo (SM-G903W) with Android 7.0.0 (Nougat) installed, I’m using in this guide for about $20 USD. Although any device will do, try to get one from the same manufacturer as the device you want to modify. If your device is a phone, you do not need a SIM card to follow this guide.
The Android OS is a derivative of Linux, and many, but not all commands are the same. You should refer to Linux or Unix manuals for an explanation of the commands. Search the ‘net for “Linux Commands” to find the latest manuals.
As the boot animation and sound are the most common modifications, changes to those are the goals of this guide. It seems as though there is an app for everything now. Yes, they are handy, but this guide will use the command line for many of the modifications. I use Terminal Emulator on the device for command line access. I also use BusyBox to expand the command set available. Both are available from the Play Store. You need root access to install and use BusyBox.
The first step is to read the manual for your device. Pay particular attention to the method used to enter the download and recovery modes. The Samsung Galaxy S5 neo uses volume up + home + power to enter the recovery mode, and volume down + home + power To enter the download mode from the power off condition. Press the volume and home buttons first, and then press the power button while holding them down. The device will boot into the desired mode. You may also require special USB drivers on your PC for your device.
Next you need to take as complete a backup of your device as possible using the stock options. See your manual for help with this. It’s also a very good idea to download the full firmware, as well as the boot and recovery partitions and any tools needed to re-flash this software. The best way to find these is to consult the manufacturer’s website, then this forum, followed by a ‘net search if nothing else provides results. For my device I need Odin on my PC. I found the full firmware at sammobile.com and firmware.mobi. The boot and recovery images can be extracted from the Samsung file, and then re-compressed using 7-zip on your PC. The firmware.mobi website offers all three files for several versions of Android, as well as a configured Odin package to root my device.
Now that we’re ready, the next few posts in this thread will cover the following sequence:
1. Root Device
2. Install Recovery
3. Install Applications
4. NANDroid backup
5. Make your modifications​
Root Device with Chainfire
Warning: If you have a KNOX enabled device, rooting it will trip the KNOX warranty flag, voiding your warranty. This flag cannot be reset, and will prevent some applications from working.
Warning: Rooting improperly can “Hard Brick” your device, turning it into a source of spare parts.
There are numerous rooting tools out there. I use Chainfire whenever possible. The current website firmware.mobi will generate an easy to use package including Odin for supported devices. Download and extract the package to a new folder on your PC. Start Odin using the root.bat file. Read the warnings. Next:
Ensure Developer Options are enabled on your device. On the SM-G903W, go to Settings/About Phone/Software information/Build number seven times. Other devices may use a different method. Consult your manual.
In Settings / Developer Options ensure OEM Unlock is on and turn on USB Debugging
Note: I also turn “Auto update system” off
Turn the device off, then re-boot into the download mode (Volume Down + Home + Power, and then press Volume Up on my device)
Plug the device into a USB port of your PC
Select AP in Odin, then select the image.tar.md5 file downloaded with your package.
Ensure one of the COM ports is highlighted.
This is your last chance to abort. DO NOT CONTINE if you have any doubts.
Click Start
When your device is rooted successfully you’ll see a green pass in Odin. Congratulations! Your device will re-boot into recovery mode to root the device, and then re-boot normally. Well, that’s how it was supposed to work. When I used the CF Autoroot file for the SM-G903W, I got the error message “Recovery is NOT seandroid enforcing”, and was unable to boot into the recovery mode. I used Odin to re-flash the recovery partition which allowed me to enter the recovery mode again. A little searching on this forum, led me to this post by Neoony. I used the link for the SM-G903F and succeeded in rooting the device.
Now you need a root manager. My preference is Super SU. Install it from Google Play. Run Super SU. It will let you know if you were not successful by reporting that your device is not rooted.
Install Backup/Recovery (TWRP)
As we intend to modify the Android system itself, we need the ability to back it up and restore it. There are several options including Clockwork Mod (CWM), Team Win Recovery Project (TWRP) and Titanium Backup. My personal preference is TWRP.
Installation is as follows:
Install the “Official TWRP App” from Google Play
Run the App, agree to the Terms and Conditions, and enable “Run with root permissions,” then tap OK.
Tap “TWRP FLASH” on the next screen
Select your device from the drop down menu, you will need a network connection for this. You’ll be presented with a series of choices. Choose the latest and greatest. The image will be downloaded to your device.
Select “FLASH TO RECOVERY”, and confirm the image is correct. You will see the message “Flash Completed Successfully!” when installation is complete.
Exit the “Official TWRP App” and re-boot your device into the Download, followed by Recovery, and finally normally to confirm all is well.
Install Applications
The applications to install are those you will use to customize your device. I suggest BusyBox, and Terminal Emulator from the Play Store. BusyBox requires root access for the expanded command set. Terminal Emulator will allow command line access on your device so you won’t need ADB on your computer. You will be able to gain root access through it to modify anything on your device anytime, anywhere.
Other Apps you may find useful are the Jota Text Editor, and Hex Editor. These are also available through the Play Store.
NANDroid backup
Once the device is rooted, and your choice of applications are installed it’s a good idea to fully back up the device. This includes ALL partitions, so you have a baseline that you can re-flash. If your device has minimal memory, you may need an SD card or USB OTG drive to hold your backup. These backups will often be larger than 4GB.
Re-boot your device into the Recovery Mode. In TWRP, select ALL the partitions. Select the desired Storage location, and tap OK. Swipe to backup your device. Note the warning that “Backups of data do not include any files in internal storage such as pictures or downloads.” That is not the purpose of TWRP, and is best accomplished with the native backup utility. This backup will require several minutes.
Make your modifications
With root access, a recovery program and needed applications installed; and a complete backup we are finally ready to modify the Android installation of your device. We’ll start with the boot animation.
Modifying the boot animation:
Most devices use a ZIP file for boot animations. Samsung uses a proprietary QMG file. I tried to convert a boot animation that I put together a few years ago into the QMG format using Samsung’s Theme Designer Version 2.0.4 (Build 3918), as the links I found to newer versions on the XDA forum were broken. Searching through this forum, I found this post by Jertlok. I used the Marshmallow version with Nougat successfully.
Enough of this talking, let the games begin! Find the boot animation you want to use and download it to your device.
I’m using the Terminal Emulator for this installation. Our first step is to find the source and destination folders for this file. The relevant folders for the SM-G903W are:
boot animation: /system/media
downloads: /data/media/0/Download
If you have another device and the boot animation is located elsewhere, do a search of this forum first to find them. Look for your device first, and the other models by the same manufacturer.
Type the following commands using the Terminal Emulator:
Code:
su get super user privileges
mount -o rw,remount /system remount /system with read & write permissions
cd /system/media go to directory with boot media files, may differ
ls verify this is the correct folder
mv /data/media/0/Download/bootanimation.zip . move the file to our current location
ls verify the file was moved
exit leave super user mode
Reboot your device and verify the boot animation works.
Note: Don’t forget the period at the end of the mv command. This is a shortcut meaning the current directory, saving you from typing the full location.
Modifying the boot sound:
Finding the location for the boot sound can be more involved that finding that for the boot animation. If you know the name of the file, you can do a search through Terminal Emulator with the following commands:
Code:
su get super user privileges
cd /system/media choose a starting point for your search
find –name PowerOn.ogg name of the boot sound on the SM-G903W
This shows the file to be located in /system/media/audio/ui. Put the sound you want in the Download folder. I’ve named mine bootsound.ogg to show another use of the mv command. Use the following commands in Terminal Emulator:
Code:
su get super user privileges
mount -o rw,remount /system remount system with read /write permissions
cd /system/media/audio/ui go to the folder containing PowerOn.ogg
ls confirm we’re in the right folder
mv PowerOn.ogg PowerOn.ogg.bak rename PowerOn.ogg
mv /data/media/0/Download/bootsound.ogg . move bootsound.ogg
mv bootsound.ogg PowerOn.ogg rename bootsound.ogg
ls confirm the change has been made
exit leave super user mode
Reboot your device and verify the boot sound works. The shutdown sound is not used in the stock ROM. You can add a shutdown sound in the same manner by placing PowerOff.ogg in /system/media/audio/ui. Note: If PowerOn.ogg or PowerOff.ogg do not play, check your file permissions. Set them to the same values as the remainder of the files in the directory, usually 644.
Wrap up
Everyone needs to start somewhere. My goal in starting this thread was to provide that starting point, and a path forward for those new to modifying an Android device. That is why I started with a stock not-too-old device, and showed how to take it to manually changing the boot animation and sound. Why manually, when there are apps for that? An App can only accomplish a single task, such as changing the boot animation. At the command line you can do almost anything. You won’t be stopped by the lack of an App.
Much of the material covered by this guide is specific for a device. Those with Samsung devices came out far ahead, and those with a Galaxy S5 neo may just have hit the jackpot. The general sequence for all devices is the same. You’ll just need to dig for those devilish details.
There are two things that should stick out:
1. Use a not too old device by the same manufacturer as your target when starting. It’s far cheaper than bricking a bleeding edge device.
2. Backup, backup, backup! This can’t be stressed enough. Losing hours or days of work is very depressing, and often leads to dropping a project.
Good luck modding your device. This forum is one of the best, if not THE best place for resolving those devilish details that you will encounter.
The Next Step: Changing the Boot Logo
First, thanks to Near_07 for his post Galaxy S9 and S9+ Boot logo. I modified his package to make one for the Samsung Galaxy S5 neo. Note that his script is for the same exynos platform. This is critical for packages containing binaries.
I unpacked the pile to a new directory on my PC.
The first thing I did was to verify paths and filenames in the script "update-binary". I opened the file using WordPad on my PC for ease of reading. The file contains references to "/dev/block/platform/11120000.ufs/by-name/UP_PARAM", which does not exist on the S5 neo. I used Terminal Emulator to check for something close and found "/dev/block/platform/13540000.dwmmc0/by-name/PARAM ". I copied the file to the Download directory, and from there to my PC. Opening the archive, I found that it contained the file "logo.jpg". Bingo! I was in the right place. I copied the "update-binary" back to the Download directory on the S5 neo, and used Jota Text Editor to change ALL the references from 11120000.ufs to 13540000.dwmmc0; and UP_PARAM to PARAM. I then copied the modified "update-binary" back to replace the original on my PC. Why did I use Jota Text Editor on the S5 neo, instead of notepad on my PC? Unix, Linux, and Android use different end of line sequences than the PC. There are programs for the PC capable of generating Android compatible files, but I'm sticking with software already mentioned in this tutorial.
Choosing or Creating a New Boot Logo:
Choose or create a new .jpg image, the same size as your screen for your new boot logo. I've attached the original logo.jpg from my S5 neo to this post. I used that as a starting point, moving and adding elements to mate with my boot animation. I've included a demo copy in the zipped package. I've also attached a copy of the first image in my boot animation sequence. The powered by Android Nougat element fades in as the animation runs.
How to Change the Boot Logo:
You are rooted and have TWRP installed if you've been following along. These are pre-requisites. STOP NOW if they are not installed.
Download the file S5neo_Boot_Logo_Changer
Unzip the file to an empty directory
Replace logo.jpg with your desired logo. Note the name MUST be exactly the same.
Use 7-Zip to compress the contents of your working folder, with 'Store' as the compression method
Copy the resulting archive to the Download folder on your S5 neo
Re-boot your S5 neo into the Recovery mode
Install the package, re-boot, and enjoy!
Removing Bloatware (or fun with scripts)
Bloatware consists of the unwanted apps generously added to your phone by Google, the manufacturer, and your carrier. There can literally be a hundred or more of these apps on your phone. So how do you get rid of them? You can use a package found on this site, but that can be problematical. You may have a different view of bloatware than the package’s author. You may not know what each APK deleted by the package does, and delete one you actually want on your phone. If this happens you’ll need to restore from backup, factory reset the phone, or even re-flash the firmware. My preference is to archive the APK on my desktop so that hopefully I can restore the APks with the package manager.
To start, grab one of the packages to delete bloatware for your version of Android, for as close to your phone as possible. I used this one by Windforce. The contents of updater-script may include a section that looks like this:
Code:
run_program("/sbin/rm", "-rf", "system/app/AASAservice");
run_program("/sbin/rm", "-rf", "system/app/BluetoothMidiService");
run_program("/sbin/rm", "-rf", "system/app/CloudGateway2017");
run_program("/sbin/rm", "-rf", "system/app/GooglePrintRecommendationService");
There are many tools such as word processors, and text editors that you can use to strip out the unwanted bits so that you end up with something like this:
Code:
AASAservice
BluetoothMidiService
CloudGateway2017
GooglePrintRecommendationService
Save it as a file, ensuring that you have an Android (Unix) end of line character. We end up with a list of folders containing the unwanted APKs. Next we need a script to archive the APKs.
The following script has been designed to run in the ‘Download’ folder, from the Terminal Emulator, or ADB (Android Debugging Bridge). It was written on my desktop using Notepad++, to ensure the proper end-of-line character was used. The script, and APK lists must be copied to the Download folder from the desktop. To access the Download folder from the Terminal Emulator or ADB, Super User or root permissions are required. File permissions allowing root to execute the script must be set. Finally the script must be run from within a shell.
Code:
mount -o rw,remount /system # mount /system for read/write
tempdir=/system/app/app # temporary folder for APKs to be archived
mkdir $tempdir
while read apkname # loop parses file for APK names to archive
do
mv /system/app/$apkname $tempdir/$apkname
done < sysapp.txt # supplied list of APKs to be archived
tar -czvf sysapp.tar.gz $tempdir # archive APKs
rm -rf $tempdir # remove temporary folder recursively
rm -rf /cache/* # clear cache contents
rm -rf /data/dalvik-cache/* # clear dalvik-cache contents
reboot
exit 0
After the script has executed, you’ll note the icons for the archived APKs remain on the apps screen, and are still listed under Apps. The must be manually removed. You’ll find that ‘Uninstall’ is now available in both places for the archived apps.
Attached is a .zip file containing the script, and data files I used on a Samsung Galaxy S5 neo (SM-G903W).

Categories

Resources