[GUIDE][7.1.1] Making The System Half-Writable & Convert The Apps To Be System-Apps - Sony Xperia X Guides, News, & Discussion

[GUIDE][7.1.1] Making The System Half-Writable & Convert The Apps To Be System-Apps
Okay. This is my first guide. My English isnt that so good. I tried something for my phone. I thought maybe it will helps you too.
HERE IS MY EASY GUIDE FOR UNINSTALL SYSTEM-APPS ON NOUGAT 7.1.1 VERSION 34.3.A.0.244 (AND ALSO MAKE THE SYSTEM HALF-WRITABLE?)(I DONT KNOW MUCH THESE SUBJECTS SORRY)
-Requires
- Version 34.3.A.0.244
- Magisked
- TWRPed
Note: Here is my TWRP and Magisking Guide Here Here Here
Installation
1. First Install
a. Android Terminal
b. Busybox By Meefik
2. Open Busybox and Install.
3. Open The Terminal Emulator. Its just like this
Code:
F5121:/ $
and type "su" just like this (NOT "Su", just "su" with little S)
Code:
F5121:/ $ su
press okay (on your keyboard)
Now this dollar symbol changed the like this #
Code:
F5121:/ #
That was First Step of terminal. Now the second step, type this command carefully
Code:
busybox mount -o rw,remount,rw /system
rw,remount,rw
-These are not dots, These are virgules.(commas)
Type and enter. If it doesnt give any error message just like this "mount: '/dev/block/bootdevice/by-name/system'->'/system': Device or resource busy" or something, congrats you did.
-Now you can delete your system-apps using Link2SD.
-But you cant still convert the u-apps to system-apps using Link2SD!
If you want convert user-apps to system-apps, use Root Explorer.
- User-apps located at root/data/app
- So cut the folder (wanted to convert system-app) from data/app
- Paste to root/system/app
- Restart The Phone
- I know this is manual guide for converting apps but it simple and easy.
(When some apps converted, maybe doesnt work. You have been warned.)
+thanks for the SoNyek for post
+commands from YasuHamed. Thanks. His guide is here

Related

[How To] Enable Non-Market apps on Captivate (consolidated)

(additional CHOWN notes added below. If you are getting "chown: unknown user/group system:system" read them!
Ok, we do have a WHOLE other thread that was made a sticky already, but you need to read the WHOLE thing to get all the properly interesting parts. I'll make sure I keep this OP up to date.
The following methods enable side loading and installing of apps onto the captivate, without the need of a program on a computer attached via the SDK. There are multiple methods, and for the most part, these methods that have worked flawlessly for many users here on this forum. We're just collecting them all in one post for speed and clarity.
Methods that assist in loading applications, without modification to the settings (a.k.a still need a computer attached) can be found at the collective wiki, http://samsungcaptivate.wikia.com/wiki/How_to_Sideload
ALL METHODS REQUIRE ROOT & BUSYBOX:
Root your phone, see http://forum.xda-developers.com/showthread.php?t=725555
Busybox : http://www.appbrain.com/app/stericson.busybox
Please, save a clean, un-altered backup copy of this file. To be safe. Rarely does corruption occur, but if it does, it won't be good.
Method 1: From Win7x64, Samsung Drivers, Android SDK installed.
This method uses the tools you already have at hand, as part of the SDK. All instances in code blocks are run inside of the command prompt. You will need to know where you installed your SDK, and the tools directory therein.
Once rooted, go install BusyBox installer from the App Market/AppBrain etc and run it. It will download and install the latest version for you.
From my Win7x64, with USB Debugging ON. Ensure that you phone is UNLOCKED as it the SU app will ask for permission for 'UNKOWN' in the following command.
Connect to PC, and Eject/Safely Remove the SD card, and "Turn off USB Storage" on the phone.
open command prompt, follow along:
Code:
> c:
> cd \android\tools
> adb shell
$ su
# cp /dbdata/databases/com.android.providers.settings/settings.db /sdcard/settings.db
# exit
$ exit
mount the SD cards to the pc,
"USB Connected select to... ", Mount
mine mounted as H:
Code:
> copy H:\settings.db settings.db
> sqlite3 settings.db
~> update secure set value="1" where name="install_non_market_apps";
1 row updated
~> .quit
> copy settings.db H:\settings.db
Eject the drive, safely remove, etc.
"Turn off USB storage" etc, to mount it back to the phone
Code:
> adb shell
$ su
# cp /sdcard/settings.db /dbdata/databases/com.android.providers.settings/settings.db
# chmod 660 /dbdata/databases/com.android.providers.settings/settings.db
# chown system.system /dbdata/databases/com.android.providers.settings/settings.db
# exit
$ exit
> adb reboot
Bam. Done.
Method 2: with Root Explorer
(courtesy of kirbo20)
This is a pretty easy process. I went in to Root Explorer - dbdata - databases - com.android.providers.settings, copied settings.db to my sd card, edited it on my pc with a db editor changed 0 to a 1 next to non market apps. Copied it back to the original directory, rebooted and installed a non market app.
(added by gotfolk)
again using FF plug in..
Click Secure on the left pane
click on install_non_market_apps
click edit
number 3 states value click there and type in 1. hit ok
(/gotfolk)
Please use caution. If you want to make sure the db save properly open it on your sd card before you copy and replace the original. It should open up as a readable table. If it opens up in a txt editor its corrupt. This permanently enables non market apps. You can not toggle it on and off.
( This is a sqlite3 database file, you can find many GUI editors that will be able to handle the editing, including a FF plugin. Search "SQLite" )
Method 3: with Root Explorer & Sqlite Editor & Terminal Emulator
(courtesy of ice3186)
- Open Root Explorer
- Browse to /dbdata/databases/com.android.providers.settings/
- copy settings.db to the root of your sd card ( /sdcard/ )
- Click on the newly copied settings.db in /sdcard/, with SQLite Editor installed, you can open and edit it here.
- Select the "secure" table, and update the value of 'install_nonmarket_apps' from 0 to 1, and save.
- close out of SQLite editor
- copy the modified file ( /sdcard/settings.db ), and browse back to /dbdata/databases/com.android.providers.settings/ and paste
- confirm the overwrite if asked and then open again to confirm it's been changed.
- open Terminal Emulator
Code:
$ su
# chmod 660 /dbdata/databases/com.android.providers.settings/settings.db
# chown system.system /dbdata/databases/com.android.providers.settings/settings.db
# reboot
- reboot phone.
No PC, no Mac, no drivers, no SDK. Viola.
Method 4: Mac & Android SDK
You will see "[sdcard]" through this method...I don't own a Mac so I'm guessing a bit.
This method uses the tools you already have at hand, as part of the SDK. All instances in code blocks are run inside of the Terminal. You will need to know where you installed your SDK, and the tools directory therein.
Once rooted, go install BusyBox installer from the App Market/AppDroid etc and run it. It will download and install the latest version for you.
From a Max OS X, with USB Debugging ON. Ensure that you phone is UNLOCKED as it the SU app will ask for permission for 'UNKOWN' in the following command.
Connect to Mac, and Eject/Safely Remove the SD card, and "Turn off USB Storage" on the phone.
open Terminal, follow along:
Code:
> cd /android/tools
> ./adb shell
$ su
# cp /dbdata/databases/com.android.providers.settings/settings.db /sdcard/settings.db
# exit
$ exit
mount the SD cards to the Mac,
"USB Connected select to... ", Mount
mine mounted as [sdcard]
Code:
> cp [sdcard]/settings.db settings.db
> ./sqlite3 settings.db
~> update secure set value="1" where name="install_non_market_apps";
1 row updated
~> .quit
> cp settings.db [sdcard]/settings.db
Eject the drive, safely remove, etc.
"Turn off USB storage" etc, to mount it back to the phone
Code:
> ./adb shell
$ su
# cp /sdcard/settings.db /dbdata/databases/com.android.providers.settings/settings.db
# chmod 660 /dbdata/databases/com.android.providers.settings/settings.db
# chown system.system /dbdata/databases/com.android.providers.settings/settings.db
# exit
$ exit
> ./adb reboot
Method 5: Android SDK only
Of course, this also requires root and BusyBox.
From the android sdk tools folder in a command prompt:
note: all linux/mac should use './adb' in place of just 'adb', and place quotes on the echo statement between echo and |
Code:
adb shell
su
chmod 666 /dbdata/databases/com.android.providers.settings/settings.db
exit
exit
adb pull /dbdata/databases/com.android.providers.settings/settings.db settings.db
echo update secure set value = 1 where name = 'install_non_market_apps';|sqlite3 settings.db
adb push settings.db /dbdata/databases/com.android.providers.settings/settings.db
adb shell
su
chmod 660 /dbdata/databases/com.android.providers.settings/settings.db
chown system.system /dbdata/databases/com.android.providers.settings/settings.db
reboot
NOTICE
You must chown the settings.db file and reboot once it is back in its original location. If you do not, you will not be able to alter settings such as WiFi,GPS, default Ringtones, etc. It's also highly likely that you may wish to chmod to 660 (-rw-rw---), so I've tacked that in here and above.
Code:
> adb shell
$ su
# chmod 660 /dbdata/databases/com.android.providers.settings/settings.db
# chown system.system /dbdata/databases/com.android.providers.settings/settings.db
# exit
$ exit
> adb reboot
Chown Note
In the event that you are getting "chown: unknown user/group system:system" please try 1000.1000 as this has been reported to work on several of the samfirmware-released roms that fail with this message.
Absolutely do not use someone else's settings.db unless you specifially make it a point replace android_id with your android_id!
Special Note
Any of these adb comments can be run from Terminal Emulator (Android Terminal Emulator, free) from the su command. I use the ADB here as it is a lot easier to type into. Terminal Emulator will provide you with a shell that is an exact match of the 'adb shell' command, as they both simply provide the shell to you.
Result:
After completing this process you will be able to load non-market apps directly from the APK files, SDK tools, tools such as DroidExplorer and apps such as APKtor.
You will be able to download the APKs directly, and then install from your favorite file browser (e.g. MyFiles(s), Astro(f), RootExplorer($)...)
Tools
SQLite Administrator (Win, GUI, no FF required) http://sqliteadmin.orbmu2k.de/
SQLite Manager (FF addon, search for it)
Application links
Root Explorer http://www.appbrain.com/app/com.speedsoftware.rootexplorer
SQLite Editor http://www.appbrain.com/app/com.speedsoftware.sqleditor
Terminal Emulator http://www.appbrain.com/app/jackpal.androidterm
BusyBox http://www.appbrain.com/app/stericson.busybox
bump.. settings.db people.. please read the threads!!
good stuff!!!
Ok. I can find settings.db with root explorer. i can copy it and i put it in my sdcard folder but nothing is there when i try to find it on my computer. Im trying to use SQlite editor on firefox. Im also on a powermac g4 if that makes a difference. I did download sqlite editor on my phone and I can find where to change the values for installing non market apps but when I change from a zero to a one it denies me. Please help
Ok, so let me make sure I have your process:
- Rooted
- Installed busybox ?
- Installed Root Explorer
- copied settings.db to /sdcard
-- cant see the file when mounted to Mac, thus can't edit with FF plugin
-- SQLite editor for android wont allow access..
(is this the SQLite Editor you used? http://www.appbrain.com/app/com.speedsoftware.sqleditor)
Try installing "Android Terminal Emulator" from the market (http://www.appbrain.com/app/jackpal.androidterm)
- open Terminal Emulator
$ su
# cd /sdcard
# chmod 777 settings.db
# exit
- Open the sqlite editor, and make the change
- back to Terminal Emulator
$ su
# chmod 660 settings.db
- proceed with rest of instructions.
how many more threads do we need on the same thing? We already have ALL of this info posted, several times.
designgears said:
how many more threads do we need on the same thing? We already have ALL of this info posted, several times.
Click to expand...
Click to collapse
Please read my initial post, first few lines. I explained why, specifically: Consolidation.
Thanks I will give it a try later today.
Sent from my SAMSUNG-SGH-I897 using XDA App
- OP updated to reflect stock ownership settings for 'chown'
Also, which sqlite app are you using? I'll put that up as method 3 if it works out nicely for you.
fixed a typo in the chown command.. bad copy paste.. bad.. doh.
added method 3 courtest of ice3186
added links to Root Explorer ($), SQLite Editor ($) and Android Terminal Emulator (free) and added the chmod/chown commands to method 3, as they were skipped by accident.
bump** for newcomers, sry.
thanks max for adding the third method. this was by far much easier than the first two methods. I have a hard time getting my mac to talk to my phone sometimes and it was good to not have to plug the lil guy in at all. Worked like a charm
myself and ice3186 are glad we could be of help
If I had accidentally deleted the settings.db how should I go about recovering my phone? Now I have the issue that my phone won't boot past the boot animation and I'm notbsure what to do
mkslt4 said:
If I had accidentally deleted the settings.db how should I go about recovering my phone? Now I have the issue that my phone won't boot past the boot animation and I'm notbsure what to do
Click to expand...
Click to collapse
Did you make any kind of backup before hand?
You may have to use someone else's settings.db and then do a factory reset.
Depending on how much you've done with the phone I'd suggest deciding on doing a the reboot process for rooting, but choosing to clear data. This may rebuild it, I am not sure.
my dbdata directory is empty.. My phone is less then 2 hours old and i have some market apps installed..
xetrev said:
my dbdata directory is empty.. My phone is less then 2 hours old and i have some market apps installed..
Click to expand...
Click to collapse
Oh, if it's running, then this folder isn't actually empty.
What are you using to browse this folder?
i followed this guide to a T yesterday when i did this. I used option 1, ADB commands on terminal since i'm a mac and it was super easy, did it in about 5 minutes.
this is just my opinion but i think everyone should try playing with the ADB commands, they're actually really useful and educational to know. and if you should brick your phone, just use clockwork recovery to restore it.
that being said, maybe you should add a disclaimer that when done on a mac, the adb commands require a "./" in front (so adb reboot becomes ./adb reboot). cp, chown, and chmod commands don't need it though (or at least i didn't).

[GUIDE] ADB Workshop and Guide for everyone

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 !
Reserved for possible extension of topic
Great, saves a lot of questions/answers & search
Every new user should read this!!
Thread stuck as valuable reference thread
Just to add, if I may, a little about the permissions...
============================================================
File permissions for Unix... which Android is based, just so those who tinker with the file permissions may know what they are getting into.
============================================================
Use the chmod command to set file permissions.
The chmod command uses a three-digit code as an argument.
The three digits of the chmod code set permissions for these groups in this order:
1.Owner (you)
2.Group (a group of other users that you set up)
3.World (anyone else browsing around on the file system)
Each digit of this code sets permissions for one of these groups as follows. Read is 4. Write is 2. Execute is 1.
The sums of these numbers give combinations of these permissions:
0 = no permissions whatsoever; this person cannot read, write, or execute the file
1 = execute only
2 = write only
3 = write and execute (1+2)
4 = read only
5 = read and execute (4+1)
6 = read and write (4+2)
7 = read and write and execute (4+2+1)
Chmod commands on file apple.txt (use wildcards to include more files)
Command Purpose
chmod 700 apple.txt Only you can read, write to, or execute apple.txt
chmod 777 apple.txt Everybody can read, write to, or execute apple.txt
chmod 744 apple.txt Only you can read, write to, or execute apple.txt Everybody can read apple.txt;
chmod 444 apple.txt You can only read apple.txt, as everyone else.
Detecting File Permissions
You can use the ls command with the -l option to show the file permissions set. For example, for apple.txt, I can do this:
$ ls -l apple.txt
-rwxr--r-- 1 december december 81 Feb 12 12:45 apple.txt
$
The sequence -rwxr--r-- tells the permissions set for the file apple.txt. The first - tells that apple.txt is a file. The next three letters, rwx, show that the owner has read, write, and execute permissions. Then the next three symbols, r--, show that the group permissions are read only. The final three symbols, r--, show that the world permissions are read only.
Compliments and full credit from:
http://www.december.com/unix/ref/chmod.html
Amazing thread just what I needed lol thanks!
cooolone2 said:
Just to add, if I may, a little about the permissions...
============================================================
File permissions for Unix... which Android is based, just so those who tinker with the file permissions may know what they are getting into.
============================================================
Use the chmod command to set file permissions.
The chmod command uses a three-digit code as an argument.
The three digits of the chmod code set permissions for these groups in this order:
1.Owner (you)
2.Group (a group of other users that you set up)
3.World (anyone else browsing around on the file system)
Each digit of this code sets permissions for one of these groups as follows. Read is 4. Write is 2. Execute is 1.
The sums of these numbers give combinations of these permissions:
0 = no permissions whatsoever; this person cannot read, write, or execute the file
1 = execute only
2 = write only
3 = write and execute (1+2)
4 = read only
5 = read and execute (4+1)
6 = read and write (4+2)
7 = read and write and execute (4+2+1)
Chmod commands on file apple.txt (use wildcards to include more files)
Command Purpose
chmod 700 apple.txt Only you can read, write to, or execute apple.txt
chmod 777 apple.txt Everybody can read, write to, or execute apple.txt
chmod 744 apple.txt Only you can read, write to, or execute apple.txt Everybody can read apple.txt;
chmod 444 apple.txt You can only read apple.txt, as everyone else.
Detecting File Permissions
You can use the ls command with the -l option to show the file permissions set. For example, for apple.txt, I can do this:
$ ls -l apple.txt
-rwxr--r-- 1 december december 81 Feb 12 12:45 apple.txt
$
The sequence -rwxr--r-- tells the permissions set for the file apple.txt. The first - tells that apple.txt is a file. The next three letters, rwx, show that the owner has read, write, and execute permissions. Then the next three symbols, r--, show that the group permissions are read only. The final three symbols, r--, show that the world permissions are read only.
Compliments and full credit from:
http://www.december.com/unix/ref/chmod.html
Click to expand...
Click to collapse
Thanks! Added
ih4ckback said:
Amazing thread just what I needed lol thanks!
Click to expand...
Click to collapse
Thanks, all goes to Adrynalyne
Thanks for the guide. Helped me pick out the stupid stupid mistakes I was making...so just a problem. I'm able to use fastboot easily but I seem to be unable to use ADB still on my windows 7. It says there are no devices and I'm dang well sure I have USB debugging on. Is it because Windows 7 is missing drivers for the nexus one or something else?
wonderful guide. I would like to add it to the guides thread.
Really awesome work, thumbs up.
But we should also take a guide on installing adb with Ubuntu/Linux, which isn't a very difficult thing...
mm7490 said:
Really awesome work, thumbs up.
But we should also take a guide on installing adb with Ubuntu/Linux, which isn't a very difficult thing...
Click to expand...
Click to collapse
If I got time tomorrow I could do that. I work primarily in Linux also
Sent from my Samsung Fascinate using Tapatalk Pro
This is good but I have a problem, when I try to remove an .apk file from /system/app it fails and says 'rm failed, Directory not empty'
I have followed exact instructions many time but never succeeded :s any help!!
(I am runnging these commands in device mod)
when I am in recovery mod I get this prompt ~ # and I am not able to enter su mod. how to get rid of this??
Well when the $ changes to # it means you have SU access
mustafa.aziz said:
This is good but I have a problem, when I try to remove an .apk file from /system/app it fails and says 'rm failed, Directory not empty'
Click to expand...
Click to collapse
Please give us the exact command(s) you entered
Here are the commands I entered after adb shell;
su
mount -o rw,remount /dev/block/stl9 /system
rm /system/app/mytouchmusic-signed.apk
exact message returned is 'rm failed for mytouchmusic-signed.apk, Directory not empty'
mustafa.aziz said:
Here are the commands I entered after adb shell;
su
mount -o rw,remount /dev/block/stl9 /system
rm /system/app/mytouchmusic-signed.apk
exact message returned is 'rm failed for mytouchmusic-signed.apk, Directory not empty'
Click to expand...
Click to collapse
Ok i think you need to do a recursive force delete which should be rf but i am not too sure! could somebody please confirm/ correct this?
Well, I don't think so ^^ As he doesn't want to erase a whole directory, but only a file.
What surprises me the most is the returned message... You're trying to delete an apk, and it says it's a directory :/
Could you please give us the output of this :
Code:
su
mount -o rw,remount /dev/block/stl9 /system
ls -l /system/app/mytouch*
Perhaps you don't even need the su and mount lines, but I'm not sure about that, and that can't harm your system ^^
Khoral said:
Well, I don't think so ^^ As he doesn't want to erase a whole directory, but only a file.
Click to expand...
Click to collapse
I know he doesn't want to delete a whole directory, but since the apk isn't compressed perhaps android looks at is as a directory and not a file? i don't know since what was returned suggested that it was a directory i presumed it was a directory! :S
mustafa.aziz said:
Here are the commands I entered after adb shell;
su
mount -o rw,remount /dev/block/stl9 /system
rm /system/app/mytouchmusic-signed.apk
exact message returned is 'rm failed for mytouchmusic-signed.apk, Directory not empty'
Click to expand...
Click to collapse
rm -rf /blah/blah
here is your desired output:
sh-3.2# su
su
sh-3.2# mount -o rw,remount /dev/block/stl9 /system
mount -o rw,remount /dev/block/stl9 /system
sh-3.2# ls -l /system/app/mytouch*
ls -l /system/app/mytouch*
-rw-r--r-- root root 299838 2008-08-01 18:00 mytouchmusic-signed.apk
sh-3.2#

How to Install/Remove System Apps on Android [MUST HAVE ROOT]

########## IMPORTANT UPDATE ##########
There is an APP available that makes this much simpler
* No Console Commands Needed
* You still MUST HAVE ROOT
* It must be installed on internal memory to work correctly
* Be sure you know what a system app does before you remove it.
* If you remove a vital app you could mess up your system completely.
The APP is Called: "System APP Remover"
Here's a Link to Download it: http://www.megaupload.com/?d=ZFC2C1R7
Mirror Download Link: http://www.mediafire.com/?h3n3ftbwilshcvn
######################################
Here are the console commands for installing/removing system apps in android console emulator, very easy ; )
You must have ROOT and console emulator, I found this very helpful, so I hope it helps others as well...
_____________________________________________________________________________________
Install App to System:
Place APK file in the root folder on your sd card.
Open terminal and enter these commands:
# su
# mount -o remount,rw -t yaffs2 /dev/block/mtdblock3 /system
# cat /sdcard/filename.apk > /system/app/filename.apk
# mount -o remount,ro -t yaffs2 /dev/block/mtdblock3 /system
# reboot
_____________________________________________________________________________________
Remove App from System (Be careful what you remove):
# mount -o remount,rw /system
# rm /system/app/Filename.apk
[Optional, to make read-only again]
# mount -o remount,r /system
[When Finished]
# reboot
_____________________________________________________________________________________
****KEY****
"#" means root command will follow
[Notes are in these brackets and aren't commands]
- ENJOY
ALSO...
**** I'm new to Android APP creation, but if anyone can automate this script to make a simple One-Click GUI APP that would be awesome, all I ask is that you put my name in the co-dev/"Thanks to" list for the app, just so I can say I helped ;-) ****
- CuriousAndroid
I am trying to reinstall some files I uninstalled. I went to the following link on this site and found some apps that people said could be removed - http://forum.xda-developers.com/showthread.php?t=773142
however, my Act1 video player now quits whenever I receive an incoming text, so I need to reinstall some programs and see which one is causing the problem
I downloaded an app called Android Terminal Emulator by Jack Palevich. I tried a "reboot" command (without the #) but it said reboot operation not permitted. Is this the Emulator I need to reinstall files? Am I doing something wrong?
--------------
EDITED:
ok nevermind, i realized the "su" command gives superuser access needed for the reboot....going to try to install files now
yeah, to use any root commands "su" must be used first otherwise the shell will think your just some generic user with limited privileges and nothing will work.
It's very important to identify any apps you plan on removing before you attempt it to make sure it isn't needed by another process.
You got lucky, some apps once removed can cause the whole rom to fail, so be careful!
- CuriousAndroid
well i think i messed something up...is there a way to recover back to stock after using the sdx stock app remover? i removed the video player but tried reinstalling it...when i uninstalled it from sdx, i noticed my other video player (Act1) would quit whenever i'd get an incoming text
i have all the .apks backed up, but after attempting to reinstall the stock video player, it hangs in MyFiles...then i reset back to factory (no Act1), and it can't play my videos, i get the error "No applications can perform this action"
Is there a way to recovery back to stock with all applications installed and in tact? i have all the .apks, but this video player won't work, after following your instructions above
thanks
It will work. Check the following:
* All shell commands are CASE-sensitive, so if the app is called Vending.apk you can't type vending.apk
* for the command to work you must have the apk on the root of your SDcard, not in sub-directories.
* if you have a copy of the rom you installed you can unzip it on your PC and find the system app folder, which you can use to cross-refference with the system/app folder on your phone to see if your missing something else.
in terminal you can list system apps like this:
# su
# cd /system/app/
# ls | more
[that will allow you hit space bar to navigate through app list if it's longer than a page,press ESC when done to go back to prompt]
* If all else fails you can backup your settings to your sd card and re-install your rom (as a last resort)
-Good Luck
curiousandroid said:
Install App to System:
Place APK file in the root folder on your sd card.
Open terminal and enter these commands:
# su
# mount -o remount,rw -t yaffs2 /dev/block/mtdblock3 /system
# cat /sdcard/filename.apk > /system/app/filename.apk
# mount -o remount,ro -t yaffs2 /dev/block/mtdblock3 /system
# reboot
_____________________________________________________________________________________
Remove App from System (Be careful what you remove):
# mount -o remount,rw /system
# rm /system/app/Filename.apk
[Optional, to make read-only again]
# mount -o remount,r /system
[When Finished]
# reboot
_____________________________________________________________________________________
****KEY****
"#" means root command will follow
[Notes are in these brackets and aren't commands]
- ENJOY
ALSO...
**** I'm new to Android APP creation, but if anyone can automate this script to make a simple One-Click GUI APP that would be awesome, all I ask is that you put my name in the co-dev/"Thanks to" list for the app, just so I can say I helped ;-) ****
- CuriousAndroid
Click to expand...
Click to collapse
When I am doing the first part here of installing app to system I dont just simply do that first I can already have an app ready to go that I want to move to sd card right? I am just making sure I didnt have to do that simply first before I even start moving the apps. This site has be great and thanks for everybody help. Wish I would have known have this site way back when.
What is "yaffs2" standing for? I type "yaffs" instead of "yaffs2". What has this done to my system? Do I have to expect any "side-effects"?
When I call # ls | more to list the directories content, the apk is listed but it is not installed yet. Is there anything else i have to do?
yaffs is nand flash filesystem
yaffs2 is more elaborate updated version
yaff2 has greater support
so if your device isnt supported by yaffs1, it may not work.
it's best to follow the commands as they're written.
apps still appear as apks in system/apps folder after installation.
Haha thats funny!! I downloaded this app.. put it on my sdcard.. installed it and when i tried to open it it said " Shame on you for trying to pirate a 1.00 app "
If you have Applanet just go there and look for Systemapp Remover - it's a bit older version but seems to do the job.
By mistake my contacts.apk is removed. Above trick also not worked. my phone is LG GT540. Pl suggest any other way.
rajhan9412 said:
By mistake my contacts.apk is removed. Above trick also not worked. my phone is LG GT540. Pl suggest any other way.
Click to expand...
Click to collapse
Grab the contacts.apk from the rom you're running and push it back in. Btw titanium backup removes system/apps without terminal commands while allowing to to make a backup first in case u want. it back or for little hickups such as this.
Sent from transparent xda app by theimpaler747
I did everything right, and the apps that I removed disappeared from the app drawer. But, after I reboot my phone, they show up again.
What can I do?
In terminal type
ls system/app
Hit enter and see if said apps are in the list
Sent from my HTC Sensation 4G using XDA App
i got a better method.
app is called app quarantine
it need root and is totally free
it can quaratine every app including rom apps and system apps
really that thing awesome. no manuall backup needed anymore and as long you dont brick the os you can easy try and error - but of course still be carefull and login and activate com.brain.logic.provider lol
Hi there i use root explorer and that is the easiest way i think to remove system apps on android phones [root required] you can download root explorer from the market or get it from 4shared just search for root explorer.apk install it and navigate to /system/apps/ and the app you wish to delete long press the app and delete make sure you mount as read/write instead of read only.
Hope this helps 
@0mpranav
actually its not and actually you didnt read my post
i advertise this little peace of freeware because it really made my day (im not related in anyway to the developer)
the quarantine removes it but store it automatically in another directory
just multiselect and press one button DONE
no need to single delete something because you always should backup first
for example turns out on samsungs device EMAIl application is also related to exchange sync - huh i was happy to restore it
really take a look -
btw i hate the root explorer - for some taksts might be usefull but fileexpert is way better in that and its free as the quaratine app is too
bofh999 said:
actually its not and actually you didnt read my post
i advertise this little peace of freeware because it really made my day (im not related in anyway to the developer)
the quarantine removes it but store it automatically in another directory
just multiselect and press one button DONE
no need to single delete something because you always should backup first
for example turns out on samsungs device EMAIl application is also related to exchange sync - huh i was happy to restore it
really take a look -
btw i hate the root explorer - for some taksts might be usefull but fileexpert is way better in that and its free as the quaratine app is too
Click to expand...
Click to collapse
You were right mate got problems in upgrading my nexus one coz i deleted the .odex system apps directly without any backup but upgraded to 2.3.6 with some trial and error method but lost root access any help would be appriciated 
@0mpranav
Installing system app
Hi, i have the same problem. I tried Root Explorer, and the Shell Commands method (with Cat command), the files i copy are in there, with all the permissions and everything, but when i reboot, none of them are installed, and my "contacts" app is still broken. Can anyone help please?
Nevermind, found the problem. I needed the exact files for my Atrix 4G with the same android version.

[TIPS][SCRIPTS][ROOT]egingell's scripts. Updated 11/22/13 11:30 MST

I will be using this thread to post my scripts and link them to other threads as needed. For this thread, I am assuming you know what you're doing. You don't need mad hacking skills and you don't need to be an expert (I'm sure as hell not), but knowing your way around the file system and basic shell scripting are helpful.
Some background: I am using the stock ROM and kernel (SGS2 - GB27, SGS4 - MDC), so all of my tips revolve around using stock and all of my scripts (even the flashable ones) will work without flashing from recovery (just extract the script from the ZIP and execute it while the phone is in phone-mode - you know... powered on ).
You are welcome to use my scripts in your apps. I only ask that you give me some credit.
I am not responsible for bricking your phone. I have only tested my scripts on my personal Samsung Galaxy S2 and S4 from Sprint. You are welcome to try on your phone, but I offer no warranties or guarantees as to whether they will work or not. Back up your ****!
All of this requires root!
Below is a list of the scripts I have written for y'alls. Enjoy.
Custom df: Shows where irregular mounts ("mount -o bind") are mounted. [ Forum post | Download ]
Currently doesn't work on my SGS4.
Easily move Phonesky.apk and GoogleServicesFramework.apk to /system or /preload for Multi DPI Play Store. [ Forum post | Download ]
Untested on my SGS4, but there's no reason to think that it won't work.
Use your SGS2's internal SD card for Link2SD instead of making a second partition on your external SD card (although, depending on the setup, you may still need to make a tiny partition on your external SD card) and your external SD card as your internal SD card [ Forum post ]
Untested on my SGS4. I have no need for it.
Clean up Link2SD: Delete files associated with Link2SD when uninstalling it. It does not revert the links Link2SD makes. It only deletes the mount scripts. [ Forum post | Download ]
If you use the debuggerd script to enable init.d, running this script will cause you to lose init.d.
Untested on my SGS4, but there's no reason to think that it won't work.
Delete Samsung's bloatware from the Sprint SGS2. [ Forum post | Download ]
Untested on my SGS4, but there's no reason to think that it won't work; however, it was written specifically for the SGS2's bloatware. See thread S4 System Apps Safe To Remove for a list of SGS4 bloatware apps.
Google Home Launcher (from Kit Kat).
Works on Jelly Bean.
Below are some other tweaks.
You can use custom boot animations with the stock ROM. All you need to do is swipe a "/system/bin/bootanimation" binary file from another ROM (such as @rujelus22's Blu Kuban FL24 (ICS) or Blu Kuban GB27 (JB 4.1.2)), paste it into "/system/bin", and make it executable.
For JB 4.2.2, make sure the user and group are root and shell respectively. This doesn't seem to be a problem with JB 4.1.2 and below. It's also possible that my initial testing involved a boot animation that didn't work on my SGS4, so if it works with root as both user and group, then roll with it. :good:
Also for JB 4.2.2, use the file from a JB 4.2.2 ROM, such as The Blu Kuban S4.
You can enable init.d scripts very easily by renaming "/system/bin/debuggerd" to "/system/bin/debuggerd.bin", replace it with the following, and make both files executable. If "/system/bin/debugger.bin" already exists, then edit "/system/xbin/busybox run-parts /system/etc/init.d" into "/system/bin/debuggerd".
As with the above, make sure the user and group are root and shell.
Code:
[color=green]#!/system/bin/sh[/color]
LOG=/data/debuggerd.log
echo "$(date)" > $LOG
echo "init.d" >> $LOG
/system/xbin/busybox run-parts /system/etc/init.d 1>>$LOG 2>>$LOG
echo "$(date) finished" >> $LOG
echo debuggerd.bin launched >> $LOG
exec /system/bin/debuggerd.bin
Below are some tips.
Most of the things you can do with a custom kernel, you can do with the stock kernel, it just requires more work and more risk.
If you replace an odexed system app with a deodexed system app, make sure you delete the app's ODEX file (it's the same file name except with the extension .odex).
Conversely: if you replace a deodexed system app with an odexed system app, you better have the ODEX file to go with it.
You can clear the dalvik-cache without a custom kernel by deleting the contents of "/data/dalvik-cache". You can even delete an individual app's dalvik-cache by finding the file "/data/dalvik-cache/[email protected]@[email protected]" or "/data/dalvik-cache/[email protected]@[email protected]" and delete it.
You can manually uninstall a system app's update by finding the file "/data/app/.apk" and delete it.
You can manually delete all user data by deleting the contents of "/data/data". You can even delete an individual app's data by finding the folder "/data/data/" and delete it.
Making scripts and binaries executable:
They must be on an EXT formatted filesystem (e.g. /data, /system, /preload).
They must be at least readable and executable by the user 'shell' (755 (read/execute for all, write only for user - "u=rwx,a=rx" if your busybox supports that method) is what I usually use).
Code:
chown root:shell ""
chmod 755 ""
chmod u=rwx,a=rx "" # busybox must support symbolic modes
Changing file permissions requires read/write access to the filesystem on which the file resides:
Code:
mount -o remount,rw /system # make the /system partition read/write
mount -o remount,ro /system # make the /system partition read only
The stock kernel is considered "production" whether or not it's rooted; therefore, you cannot use ADB to push or pull files directly to or from protected partitions, nor run ADB as root, nor use ADB's remount command, so you have to use unprotected partitions as a sort of buffer. You can, however, access the ADB shell and issue the "su" command wherein you can use "cp" to copy files to or from protected partitions prior to using ADB to push or pull the desired file. However, there is an app aptly named [root] adbd Insecure by @Chainfire that patches the ADB daemon to get around this limitation.
Example:
Code:
c:/android-sdk> adb shell
[email protected]:/ $ su
[email protected]:/ # cp /system/bin/debuggerd /sdcard/debuggerd
[COLOR="green"]-- open a new command prompt window --[/COLOR]
c:\android-sdk> adb pull /sdcard/debuggerd debuggerd
c:\android-sdk> adb push debuggerd /sdcard/debuggerd
[COLOR="green"]-- switch to the first command prompt window --[/color]
[email protected]:/ # mount -o remount,rw /system
[email protected]:/ # cp /sdcard/debuggerd /system/bin/debuggerd
[email protected]:/ # chown root:shell /system/bin/debuggerd
[email protected]:/ # chmod 755 /system/bin/debuggerd
[email protected]:/ # mount -o remount,ro /system
Some noteworthy files and folders:
/proc/self/mountinfo: If you can read it, it tells you where your partitions and folder binds are mounted.
/proc/partitions: Shows all of your SD card's partitions, how many blocks each has, and their vold numbers (eg "179 1 30578964 mmcnlk0p1").
/dev/block/platform/dw_mmc/by-name: This folder contains symlinks to your internal eMMC's partitions indexed by what they are for (eg UMS for your internal SD card - "realpath /dev/block/platform/dw_mmc/by-name/UMS" will print out the device path (ie "/dev/block/mmcblk0p11")).
/dev/block/platform/dw_mmc/by-num: This folder is like the previous except that they are indexed by partition number (eg "p11").
/proc/version: Shows what version of Linux is currently being used.
/data/system/batterystats.bin: Delete this when your battery is fully charged and still plugged in to recalibrate it.
Footnotes:
For "/data/app", "/data/data", and "/data/dalvik-cache" files you need to know the package name. There are various apps that will tell you, including Link2SD (mentioned above), Titanium Backup, and the web URL of the app in the Play Store (ex: https://play.google.com/store/apps/details?id=com.devname.appname).
More:
Random boot sound using your notification sounds
Make ADB work for all users - Jelly Bean 4.2.2 (Updated 07/15/13 00:35 MST)
Stock ROM - SGS4 - init.d
No-data restore tips
SGS4 Bloatware Remover
Make apps run faster and increase battery life
Random boot sound using your notification sounds
The attached ZIP contains a script that can be run pre or post boot. It just needs to be executable.
Preboot requires init.d. See the OP for enabling it if you are on a stock rooted ROM and requires the file to be readable and executable ("chmod 755" works fine).
Postboot requires an app such as Scripter (ROM Toolbox) or Script Manager to execute the script at boot.
Requires the variable $RANDOM. You can make sure it's available from the command line ("echo $RANDOM").
Use this script at your own risk. I provide no warranties or guarantees.
What does this script do?
Check for carrier boot up sounds (sub folders in the "/system/media/audio/ui" folder) and moves them to "/system/media/audio/notifications" renaming them as needed.
Create symlinks in the above folders to "/system/media/audio/ui/PowerOn.ogg".
Check if "/system/media/audio/notifications/PowerOn.ogg" is present and copy it to "/system/media/audio/ui/PowerOn.ogg" it's not.
Count the number of files in "/system/media/audio/notifications".
Grab a random number between 1 and the number of files found inclusive (math notation: "[1, numFiles]").
Go through "/system/media/audio/notifications" and copy the file at index random to "/system/media/audio/ui/PowerOn.ogg".
Notes:
The stock file is included. If you want a different sound in its place, you can either comment out that line in the script and delete the "/system/media/audio/notifications/<subfolder>_PowerOn.ogg" files from "/system/media/audio/notifications" or just replace "/system/media/audio/notifications/PowerOn.ogg" with some other sound file and still delete the "/system/media/audio/notifications/<subfolder>_PowerOn.ogg" files from "/system/media/audio/notifications".
If you want more sounds, just copy them to "/system/media/audio/notifications" (OGG files only).
The script does not check for valid files and blindly renames the destination file to "PowerOn.ogg".
It does not look in "/sdcard/media/audio/notifications" or anywhere else for audio files.
I do not recommend using alarms or ringtones files as they are usually looped which can cause the media scanner to get stuck and overheat your phone or tablet - those files may continue to play even if you can't hear them.
If you can't hear a sound on boot, it is likely that the file is either invalid or has no audio (ex: my /system/media/audio/ui/BST/PowerOn.ogg has no audio).
It was tested and works on a Samsung Galaxy S2 (stock JB 4.1.2) and a Samsung Galaxy S4 (stock JB 4.2.2) both from Sprint and using stock kernels.
There's no obvious reason it won't work on other phones and tablets with other ROMs from other carriers.
Nice work E.
cerj said:
Nice work E.
Click to expand...
Click to collapse
:good:
Make ADB work for all users - Jelly Bean 4.2.2 (Updated 07/15/13 00:35 MST)
With Android 4.2.2, ADB now requires RSA keys. This poses a problem when attempting to connect to the device's ADB server from the device itself and the device won't ask for authorization unless it's connected via USB. Well, there's hope, yet.
For the following, I'm assuming you used my method for adding init.d support to your device.
Use these scripts at your own risk. I provide no warranties or guarantees.
Add the following script to /system/bin/debuggerd. If you use an alternate method, please note that it must be executed by the debugger daemon. You must do this first or you'll have to manually restart the debugger daemon after editing this file and executing the run-once script (next step), so edit this file first and save it.
Code:
if [ ! -e "/.android" ]; then
busybox mount -o rw,remount /
mkdir /.android
mount -o bind /data/.android /.android
busybox mount -o ro,remount /
fi
Then run this script once from the device (not over ADB on your PC).
Code:
[COLOR="Green"]#!/system/bin/sh[/COLOR]
HOME=/data
adb kill-server
adb start-server
stop adbd
cat /data/.android/adbkey.pub >> /data/misc/adb/adb_keys
echo "" >> /data/misc/adb/adb_keys # Add a blank line at the end of the file
start adbd
HOME=/
adb kill-server
stop debuggerd
start debuggerd
Notes:
You can also find the abdkey.pub file on your Windows' PC here, C:\Users\<user name>\.android\adbkey.pub. Copy it to your device by whatever means necessary, then append it to /data/misc/adb/adb_keys and you won't need to initially use the USB to allow the PC connection. Not really necessary unless your PC has no USB or you've broken your USB cable.
This may have inadvertently corrected the mounting issue introduced in Jelly Bean 4.2.2.
You can also allow other Android 4.2.2 devices, but it requires ADB version 1.0.31 and for you to manually append the contents of /data/.android/adbkey.pub from device A (the one you want to use to ADB on) to /data/misc/adb/adb_keys on device B (the target device).
Don't delete /data/.android
This won't fix apps. Just allow you to use ADB to connect to your device from itself.
Tested on my SGS4. No reason it won't work on other devices.
If you already have a /data/.android directory, you may not need to do this. On my SGS4, HOME defaults to "/" which the ADB daemon can't write to, so it can't make the RSA key.
The run-once script temporarily changes HOME to "/data", a writable directory, so the ADB daemon can write the RSA key then it append it to the allowed clients file then restarts the debugger daemon thus binding /data/.android to the /.android directory allowing all Linux users ADB access to the device.
Reassigning HOME to a new value on one user only changes its value for that user which is why I'm binding /data/.android to /.android.
Code:
# Example
[email protected]:/ $ echo $HOME
/
[email protected]:/ $ HOME=/data
[email protected]:/ $ echo $HOME
/data
[email protected]:/ $ su 1000
[email protected]:/ $ echo $HOME
/
Alternatively (much easier):
Make the .android folder in /data (mkdir /data/.android).
Add the script, the first code block in this post, to your debuggerd file or an init.d script.
Restart the debugger (stop debuggerd; start debuggerd) or reboot the phone.
Restart ADB (stop adbd; start adbd).
Copy the newly created public key to the allowed clients (cat /data/.android/adbkey.pub >> /data/misc/adb/adb_keys; echo "" >> /data/misc/adb/adb_keys).
Restart the ADB server (adb kill-server; adb start-server).
SGS4 Bloatware Remover
I have written a live-script to delete all of the SGS4 bloatware except GoogleContactsSycAdapter and SecLauncher3. If you want to delete those, remove the "#" from that line in the script. If you want to exclude an app, add a "#" to that line and put the app name in quotes (ie AppName / becomes "#AppName" / (including the forward slash) or just remove that line. If you remove the last item (YouTube in this case), remove the forward slash from the previous line.
Use this scripts at your own risk. I provide no warranties or guarantees.
What this script does:
Move the app's APK and ODEX to /sdcard/SystemAppsBackup.
Delete its dalvik-cache.
Reboot the phone. If it doesn't reboot, you'll have to do this yourself.
What this script does not do:
Delete the app's data. Because the script doesn't know the package name.
Delete its Play Store update (located in /data/app). Because the script doesn't know the package name.
Mount the SD card if it's not mounted. If you want backups, make sure the SD card is mounted.
Care if you delete a system app you wanted to keep. Most apps that you would want to keep may be available in the Play Store.
Restore apps.
Notes:
Apps will crash left and right when you execute this script in running mode. Don't fret, this is normal.
This is a live-script which means you have to manually execute the script either with a terminal emulator, a script executor like Scripter, or ADB.
This is not flashable.
If executing via ADB in Recovery mode, you may need to mount the SD card to /storage/sdcard0 manually or settle for no backups.
If you restore an app from /sdcard/SystemAppsBackup, make sure you get the ODEX file if present and set the permissions for both to 644.
This list is based off the list in the thread, S4 System Apps Safe To Remove.
Here You Go Guys, I took me about 30 mins, but I have successfully added all the app in the Op to a flashable Zip.
The Zip is base of TrulyClean v1.6 script code, I just deleted his ;delete/system/...apk and replaced it with all the ones from the OP
bigtobitobs said:
Here You Go Guys, I took me about 30 mins, but I have successfully added all the app in the Op to a flashable Zip.
The Zip is base of TrulyClean v1.6 script code, I just deleted his ;delete/system/...apk and replaced it with all the ones from the OP
Click to expand...
Click to collapse
Looks like you're deleting bloatware, perhaps you should post that in the right thread... or at least a more appropriate thread.
Sent from my SGS4.
egingell said:
Looks like you're deleting bloatware, perhaps you should post that in the right thread... or at least a more appropriate thread.
Sent from my SGS4.
Click to expand...
Click to collapse
LOL OMG I am so sorry, I had multiple tabs open and put this in the wrong forum. Please Delete
bigtobitobs said:
LOL OMG I am so sorry, I had multiple tabs open and put this in the wrong forum. Please Delete
Click to expand...
Click to collapse
Would that I could.
Sent from my SGS4.
Make apps run faster and increase battery life using Xposed App Settings.
Did you install GravityBox on your SGS4 then uninstall it and now you can't hear your games or music?
I think it has to do with GravityBox's "Volume Steps" option not undoing when GB is uninstalled. This is how I fixed it (forum post).
Stock ROM - SGS4 - init.d
I recently found out that my debuggerd hack to enable init.d support on my stock SGS4 wasn't working. So, I did this and now it works.
Make a file named "install-recovery.sh" and drop it into /system/etc. Whatever script you put in here will execute at boot up so long as the user/permissions are correct.
Code:
chown shell:shell "/system/etc/install-recovery.sh"
chmod 755 "/system/etc/install-recovery.sh"
chmod u=rwx,a=rx "/system/etc/install-recovery.sh" # busybox must support symbolic modes
Use this script at your own risk. I provide no warranties or guarantees.
My "/system/etc/install-recovery.sh" script:
Code:
[COLOR="Green"]#!/system/bin/sh[/COLOR]
LOG="/data/install-recovery.log";
echo "Executing install-recovery.sh" > $LOG;
echo "" >> $LOG;
echo "$(date) install-recovery hack..." > $LOG
echo "" >> $LOG
echo "init.d" >> $LOG
[COLOR="green"]# I can't get run-parts to work for some reason, but this will run every *.sh script in /system/etc/init.d as root.[/COLOR]
for N in /system/etc/init.d/*.sh; do
su -c "$N" 1>>$LOG 2>>$LOG
done;
Notes:
Mount binding (in JB 4.2.2+) seems to work. E.g. mount -o bind /folder1 /folder2
$(date) does not provide the correct date (mine said: "Wed Apr 15 13:24:13 MST 1970").
The Package Manager is not available. (There may be other unavailabilities, but I don't intend to test it thoroughly.)
Somethings I discovered recently while doing a no-data system restore for the second time in the same night and some tips relating to system restores:
* When doing a no-data restore, disabled/frozen system apps remain disabled.
* Apps that can't be disabled even with Titanium Backup will not remain disabled after a reboot and will sometimes crash/FC repeatedly until uninstalled.
* If an app won't open or FCs, try converting it to a system app and back to user app or vice versa.
* Don't integrate system app updates into the ROM. In the event that you have to do a no-data restore, those updates will be retained.
* Don't convert user apps to system apps for the same reason.
* Disregard the previous two tips if disk space is a problem. It's just more time consuming (redownloading updates, reintegrating, and reinstalling) after a restore.
* Save all modified system files, such as /system/bin/debuggerd, /system/build.prop, /system/etc/install-recovery.sh, and if your ROM uses /system/etc/unit.d, any modified or extra files there. If you use them, you'll need them after a restore.
* For a smoother post no-data restore, use Titanium Backup's labels so you can batch-uninstall those pesky system apps you don't want.
SGS2 - JB 4.1.2 GB27
SGS4 - JB 4.2.2 MF9
any command for updater script to make directory in root of android ??
HassanMirza01 said:
any command for updater script to make directory in root of android ??
Click to expand...
Click to collapse
Creating directories in / and all the files contained therein must be redone on every boot. That said, you just need to make root writable and make the directory.
mount -o remount,rw /
mkdir /whatever
mount -o remount,ro /
Note: Every time you wish to create, modify, or delete files you'll have to make root writable.
Sent from my LG-H811 using Tapatalk
egingell said:
Creating directories in / and all the files contained therein must be redone on every boot. That said, you just need to make root writable and make the directory.
mount -o remount,rw /
mkdir /whatever
mount -o remount,ro /
Note: Every time you wish to create, modify, or delete files you'll have to make root writable.
Sent from my LG-H811 using Tapatalk
Click to expand...
Click to collapse
Actually.... I wanna add some files within folder in root of android root... So i need to use above three commands nd then after making directory, i should extract files to that folder ??
HassanMirza01 said:
Actually.... I wanna add some files within folder in root of android root... So i need to use above three commands nd then after making directory, i should extract files to that folder ??
Click to expand...
Click to collapse
Yes.
Sent from my LG-H811 using Tapatalk
:good:

MAKING SYSTEM WRITABLE - [Z5] [Nougat] AFTER ROOT

after ROOTING Nougat 32.3.A.0.376 (E6833 E6853 E6883) (E6633 E6653 E6683 ), we will still face ERROR while removing system apps, because GOOGLE has changed file system properties in Android N to READ ONLY
in order to make system directory WRITABLE, install busybox, and terminal,
type these lines and enter one by one in #terminal
Code:
su
mount -o rw,remount /system
ORRR
Code:
su
busybox mount -o rw,remount,rw /system
-----------
What???
Why ??? I still can not write anything on the SYSTEM partition
I have full ROOT access and everything , no reboot or error issue !!
Please share if you find any solution to that
chinmoy32 said:
Why ??? I still can not write anything on the SYSTEM partition
I have full ROOT access and everything , no reboot or error issue !!
Please share if you find any solution to that
Click to expand...
Click to collapse
Mee too unable to write on system
download terminal on google play
open terminal
write "su" command and give root permission
then you will see "#"
after that, write this command:
Code:
echo 0 > /sys/kernel/security/sony_ric/enable
then you write this command:
Code:
mount -o rw,remount /system
if you see "#" again, it worked
but if you see "mount: Operation not permitted" it has not, sorry
Credits: https://forum.xda-developers.com/showpost.php?p=70677335&postcount=92
I did what @serajr described here:
https://forum.xda-developers.com/xp...-kernel-dm-t3301605/post70595975#post70595975
works like a charm, system always writable!
Can any of you share here your perfectly rooted working kernel for Z5 E6683 DSDS ????
chinmoy32 said:
Why ??? I still can not write anything on the SYSTEM partition
I have full ROOT access and everything , no reboot or error issue !!
Please share if you find any solution to that
Click to expand...
Click to collapse
i found a workaround and it goes
installing busybox
installing terminal
and writing following codes
Code:
su
'to give terminal root access
busybox mount -o rw,remount /system
later using ROOT APP REMOVER i manage to remove all bloatware!
toncheee said:
I did what @serajr described here:
https://forum.xda-developers.com/xp...-kernel-dm-t3301605/post70595975#post70595975
works like a charm, system always writable!
Click to expand...
Click to collapse
@serajr workaround was fo when rootkernel4.51 wasn't able to support Nougat kernel
however if you follow carefully, the lines mentioned
Code:
on post-fs
export LD_PRELOAD libNimsWrap.so:libdrmfix.so
and
Code:
write /sys/kernel/security/sony_ric/enable 0
will switchoff SONYRIC and will fix DRM
the issue is NOT sony RIC,
Google in general with or without any security/rootaccess changed the system folder properties from default Writable in <+ 6.01 Android version to READABLE ONLY from android 7.xx
so when i followed the both method of altering file via notepad++ in the ramdisk folder using N kernel and rootkernel version4.5, I ended up having fully root system with READLY ONLY ACCESS to /system partition and i could only switchoff the apps but can't remove!
YasuHamed said:
@serajr workaround was fo when rootkernel4.51 wasn't able to support Nougat kernel
however if you follow carefully, the lines mentioned
Code:
on post-fs
export LD_PRELOAD libNimsWrap.so:libdrmfix.so
and
Code:
write /sys/kernel/security/sony_ric/enable 0
will switchoff SONYRIC and will fix DRM
the issue is NOT sony RIC,
Google in general with or without any security/rootaccess changed the system folder properties from default Writable in <+ 6.01 Android version to READABLE ONLY from android 7.xx
so when i followed the both method of altering file via notepad++ in the ramdisk folder using N kernel and rootkernel version4.5, I ended up having fully root system with READLY ONLY ACCESS to /system partition and i could only switchoff the apps but can't remove!
Click to expand...
Click to collapse
I also think the issue is not the RIC but something to do with the Nougat filesystem itself.
I can delete all the files and folders with any file managers I like but like after 1 sec they all reappear as nothing ever happened to them !!!
How strange is that ??
It shows file sizes when I delete them and take times to delete the folders with , say for 500MB
but they still reappear after just 1 refresh or 1 sec.
I cant figure it out at all for the sake of my sanity --- why the hell this is happening ????
https://www.dropbox.com/sh/2kf8wg3g13pv869/AACB3l8iPJHJnBlpnGorRqrha?dl=0
@bungadudu @chinmoy32
I followed bungadudu-s steps and it worked i can change permissions and prove it with link i provided.
And chenges, yes they stick after reboot and i can rename files allso, but:
after reboot i have to repeat this steps if i want to change something elsewhere, old changes do stick aroind though
I deletet phone to 0 mb in twrp, flashed AU nougat .372 with flashtool, rebooted into twrp, flashed zip file provided in link, then flashed supersu in link and rebooted, no custom kernel used
Next i will try to copy modified thermal files now and see if they stick after reboot and if kernel aduitor uses them, see you later
Observations:
-i changed permissions from file /system/build.prop and changed lcd density to 320 and i have bootloop
working on how to boot it up...
YasuHamed said:
after ROOTING Nougat 32.3.A.0.372 (e6833 e6853 e6883) (E6633 E6653 E6683 ), we will still face ERROR because GOOGLE has changed file system properties in Android N to READ ONLY
in order to make system directory WRITABLE, install busybox, and terminal,
type these lines and enter one by one in terminal
Code:
su
busybox mount -o rw,remount /system
-----------
Click to expand...
Click to collapse
Please share the exact name / way to install busybox and terminal
i.e. which version of busybox I need to install from where ?? Which terminal app you used ?? if possible please share the links
https://www.dropbox.com/s/d9ie598b618feiz/recovery.log?dl=0
i managed to get somesort of log from twrp in link from previous post will this sufice?
i am reflashing my phone so i can not look at versions, for now i used:
when i reboot it i can look into busybox version
SR3-SuperSU-v2.79-SR3-20170114223742, on top of that i installed pro:
https://play.google.com/store/apps/details?id=eu.chainfire.supersu.pro
busyboxpro
https://play.google.com/store/apps/details?id=stericson.busybox.donate
terminal from romtoolbox pro:
https://play.google.com/store/apps/details?id=com.jrummy.liberty.toolboxpro
those are some apps i support so i dot know if it makes a diference from non paid
chinmoy32 said:
Please share the exact name / way to install busybox and terminal
i.e. which version of busybox I need to install from where ?? Which terminal app you used ?? if possible please share the links
Click to expand...
Click to collapse
chinmoy32 said:
Please share the exact name / way to install busybox and terminal
i.e. which version of busybox I need to install from where ?? Which terminal app you used ?? if possible please share the links
Click to expand...
Click to collapse
I install both of them via play.google.com
https://play.google.com/store/apps/details?id=stericson.busybox&hl=en
&
https://play.google.com/store/apps/details?id=jackpal.androidterm&hl=en
later i opened terminal and ran those commands
later i installed System App remover
https://play.google.com/store/apps/details?id=com.jumobile.manager.systemapp&hl=en
granted it SU rights and removed HANGOUTS and GOOGLE MOVIES etc
It seems to work to some extend but if you want to go tweak it up, kablaaam
i did not managed to boot it up after bootloop sadly, i need my phone so this is it for me this week
stipi69 said:
https://www.dropbox.com/s/d9ie598b618feiz/recovery.log?dl=0
i managed to get somesort of log from twrp in link from previous post will this sufice?
i am reflashing my phone so i can not look at versions, for now i used:
when i reboot it i can look into busybox version
SR3-SuperSU-v2.79-SR3-20170114223742, on top of that i installed pro:
https://play.google.com/store/apps/details?id=eu.chainfire.supersu.pro
busyboxpro
https://play.google.com/store/apps/details?id=stericson.busybox.donate
terminal from romtoolbox pro:
https://play.google.com/store/apps/details?id=com.jrummy.liberty.toolboxpro
those are some apps i support so i dot know if it makes a diference from non paid
Click to expand...
Click to collapse
I just clean install 372 and patched the kernel once again .................
tried the terminal commands ---- both commands were successful (without any errors )
but still the deleted apps and the edited files came back to normal as before
I did not manage to delete anny apps as my phone crashed before, i am glad you get commands to work.
oh, by the waj roomtoolbox is great as you can make shortcuts of the commands and then you klik it one after another and you get rid of the typing
example (first shortcut command depends of busybox install folder i think)
1.st shortcut "cd /su"
2.nd shortcut "su"
3.rd shortcut "echo 0 > /sys/kernel/security/sony_ric/enable"
4.th shortcut "mount -o rw,remount /system"
that way some people can do this quick and you dont need to remember commands, and you can experiment quicker.
sorry i dont know howto annything else for now
chinmoy32 said:
I just clean install 372 and patched the kernel once again .................
tried the terminal commands ---- both commands were successful (without any errors )
but still the deleted apps and the edited files came back to normal as before
Click to expand...
Click to collapse
stipi69 said:
I did not manage to delete anny apps as my phone crashed before, i am glad you get commands to work.
oh, by the waj roomtoolbox is great as you can make shortcuts of the commands and then you klik it one after another and you get rid of the typing
example (first shortcut command depends of busybox install folder i think)
1.st shortcut "md /su"
2.nd shortcut "su"
3.rd shortcut "echo 0 > /sys/kernel/security/sony_ric/enable"
4.th shortcut "mount -o rw,remount /system"
that way some people can do this quick and you dont need to remember commands, and you can experiment quicker.
sorry i dont know howto annything else for now
Click to expand...
Click to collapse
I just managed to restart my phone successfully after changing the LCD density to 320 [I also use this value since always ]
But then I carefully just deleted 1 single app and booom--- boot loop
PS. i used root explorer to just click mount as R/W and then do anything to system partition --
Great you magaged it, and yes 320 seems so right.
And i asume there is no way to break bootloop?...other than reflashing?
I had trouble afterwards on downgrading to.253, 3x times error on start, even after reseting " power & + " and couple of full wipes in twrp.
I had to flash lineage from twrp and boot it up and only then flashtool succeeded pushing. 253.
This nougat will be fun i see
If there is something to try tell me i will flash it once more tonight, otherways i can do it on weekends
Oh i did not tell, i managed to copy modified thermal files with no error and then changed lcd density so i can not 100% tell which caused bootlop, since i did not reboot in between...
chinmoy32 said:
I just clean install 372 and patched the kernel once again .................
tried the terminal commands ---- both commands were successful (without any errors )
but still the deleted apps and the edited files came back to normal as before
Click to expand...
Click to collapse
there is another way which i did not try because the busybox commands worked for me
its about flashsing updater script
delete_recursive(
"/system/app/GoogleAnalyticsProxy",
"/system/priv-app/GoogleBackupTransport",
"/system/priv-app/textinput-chn-xxhdpi",
);
https://forum.xda-developers.com/showpost.php?p=70920831&postcount=2015

Categories

Resources