[Q] Android 4.2: "Public" folder for every user? - Nexus 7 Q&A, Help & Troubleshooting

Hi folks!
I searched the forum, but couldn't find a proper solution yet.
Is it possible to create a shared ("public") folder, which is accessible for every user on the N7?
As the user accounts seem to be managed under /data/media/ID I already tried:
adb shell
su
mkdir /data/media/pub
chmod 777 /data/media/pub
chown media_rw.media_rw /data/media/pub
ln -s /data/media/pub /data/media/0/pub
So logically the symlink is correct, unfortunately the user doesn't have access to /data/media (which I suspected), so the symlink to /data/media/pub is inaccessible for user 0.
Also other locations doesn't seem to work. On / and /mnt I cannot create a folder, as this is read-only mounted by default, and I don't want to fiddle around with various "mount -o rw/ro" scripts on bootup etc.
Does anybody managed to create a shared folder for every user?
Thanks in advance!

ryazor said:
Hi folks!
I searched the forum, but couldn't find a proper solution yet.
Is it possible to create a shared ("public") folder, which is accessible for every user on the N7?
As the user accounts seem to be managed under /data/media/ID I already tried:
adb shell
su
mkdir /data/media/pub
chmod 777 /data/media/pub
chown media_rw.media_rw /data/media/pub
ln -s /data/media/pub /data/media/0/pub
So logically the symlink is correct, unfortunately the user doesn't have access to /data/media (which I suspected), so the symlink to /data/media/pub is inaccessible for user 0.
Also other locations doesn't seem to work. On / and /mnt I cannot create a folder, as this is read-only mounted by default, and I don't want to fiddle around with various "mount -o rw/ro" scripts on bootup etc.
Does anybody managed to create a shared folder for every user?
Thanks in advance!
Click to expand...
Click to collapse
I'm having the same problem. I have a owner account in which I put some files (4 Gb) that should be available to every user. But user 10 and 11 can't access these files. Where Can I put those files, so that every account can easily access them?

I figured out that each user has a directory under /mnt/shell/emulated (0, 10, 11, etc.). So I created a directory "public" via root under /mnt/shell/emulated/public and made it worldwide writable via chmod -R 777 /mnt/shell/emulated/public. Afterwards I created public folders in each user directories.
It works like a charm when mounting via:
Code:
mount -o bind,allow_other /mnt/shell/emulated/public/ /mnt/shell/emulated/0/public/
I tried to build a simple script and it works when executing it in root shell via ADB. Unfortunately I didn't manage to automate this on boot. I couldn't find any "init.d" directory and also via "Script Manager - SManager" it wasn't working.
Code:
#!/system/bin/sh
PUBLIC_DIR=public
if [ -d /mnt/shell/emulated/$PUBLIC_DIR ]; then
for USER_PATH in /mnt/shell/emulated/*; do
if [ -d $USER_PATH/$PUBLIC_DIR ]; then
busybox mount -o bind,allow_other /mnt/shell/emulated/$PUBLIC_DIR $USER_PATH/$PUBLIC_DIR
fi
done
fi
Any ideas?

It's a start. It would be nice to incorporate it in an app.
It would be even better if it is a standard option in Android 4.2
Sent from my HTC Wildfire S A510e using xda app-developers app

adonet said:
It's a start. It would be nice to incorporate it in an app.
It would be even better if it is a standard option in Android 4.2
Click to expand...
Click to collapse
I agree. At the moment, it seems to be possible only with a lot of fiddle and root including busybox. I don't know, if Google ever will implement such a feature, since it kind of breaks the separation idea of multi user spaces.
I hope, I'm able to figure out, how to get the script working. Everything works except the mount line which requires root privileges. Furthermore the script works correctly when executed from root shell via ADB.
Regards!

Did the updated super SU change anything?
Sent from my HTC Wildfire S A510e using xda app-developers app

I found an easy to implement solution to make a shared directory on the Nexus 7
I used ES file-explorer and set the setting so that it had all the read and write permissions and can go upwards to /
Then I make a new directory in /storage/emulated and give it some name. E.g. /storage/emulated/allusers
Then select the properties of this directory and change it so that everyone has all available permissions.
Now copy the files you want to share in this directory and change the permissions of these files as well.
Now you van change to another account and still read and write these files.
It's a bit of a hassle but it works
★******************
Well I Was too quick. The directory I created suddenly disappeared. I can't find the contents anymore. Where o where would these files go?
Jeroen
Sent from my Nexus 7 using xda app-developers app

Has anyone tried “mkdir /data/media/legacy/pub" instead of “mkdir /data/media/pub"?
I noticed that every user has full access to this legacy folder... In fact, I kinda use this folder to move files between different users!

Well, yes it works. Need to be root though. But it works. Thanks a lot.

I found a solution.
Use the android/obb folder since it is shared space. I added a Movies folder there can can access it from multiple accounts. For MX player to see the movie files I had to uncheck the recognize no media option under settings but it works.

Thank you, I'll try this option too, Better than the solution mentioned above that needs root.

BigJArm said:
I found a solution.
Use the android/obb folder since it is shared space. I added a Movies folder there can can access it from multiple accounts. For MX player to see the movie files I had to uncheck the recognize no media option under settings but it works.
Click to expand...
Click to collapse
I too created a folder in obb but i am not able to access it any reasons??

BigJArm said:
I found a solution.
Use the android/obb folder since it is shared space. I added a Movies folder there can can access it from multiple accounts. For MX player to see the movie files I had to uncheck the recognize no media option under settings but it works.
Click to expand...
Click to collapse
How about using a folder /data/local/tmp for a similar purposes?

Related

[Q] droid x download permissions issue

so im stuck and can not figure this out. for some reason the permissions for the download folders on my sd card do not have any user permissions checked. i can not download anything at all but the market is fine as it is on the internal memory i suppose. the only reason i came across the user permissions issue was because i found another post where someone had the same problem with downloading and corrected the issue by using root explorer and manually adding user permissions to any folder he used for downloading. now... here is my problem... i used root explorer and when i try to add user permissions to these folders, the settings that changed do not stick. i check mark the 3 boxes and accept the changes but if i go back into that folders specific permissions, they are unchecked once again. how can i get it to not revert back or better yet how can i just resolve the issue in whole so i dont have to keep fixing folder permissions on the sd card for app that downloads? i dont see why the sd card of all places would start having these permission issues. the guys post i came across tried to tie this issue to the fix permissions option in rom manager saying it may have caused the problem but i didnt use rom manager to fix permissions until this problem started. i was on liberty 1.5 rom then reverted back to rooted stock where i still have the problem with all downloading except the market again. any help would be greatly appreciated!
58 views and not a single response? wow.... so very shocking to see that, i bet if i had post this in the dev forum i would have gotten 15+ responses just to say that im in the wrong section then anther 30 for people to argue back and fourth on how everyone is being rude or that this is the reason devs stay in irc...
Give this a try if you have the sdk and adb set up.
from a command prompt:
1) adb devices (make sure that your phone shows up)
2) adb shell
3) su (assuming you have rooted your phone)
4) cd /mnt/sdcard/download (or whatever the folder on your sdcard for downloads is called)
5) chmod 777 /mnt/sdcard/download (or whatever your download folder is called)
this should change the permissions on your sdcard to have full permissions.
thanks for your reply! im grateful, but wouldnt that only change the permissions for the "download" folder? which is mostly only a default location for apps such as the browser?
The way sysadmin-x is suggesting makes the permissions way different than they are by default, I wouldn't recommend doing it that way.
If you want to change permissions on the entire sd card to what they are by default, try running(as root)
Code:
chown -R system:sdcard_rw /mnt/sdcard && chmod -R 075 /mnt/sdcard
Edit: that code messes up the permissions on one folder, after running that you should also run
Code:
chown -R root:root /mnt/sdcard/.android_secure && chmod -R 000 /mnt/sdcard/.android_secure
Just do this: download a terminal emulator from the market. Open the app. Type su and press enter. Give it root access. Type chmod 777 /sdcard and press enter.
Please note you need root to do this

[HOW-TO] Move /data/data to SDCard

As some people experienced, default partinitioning of internal ROM is a bit missed than usual needs and our ZTE's still complains about disk space running out.
One of the solutions is to move /data/data to SD-ext partinition (only with A2SD enabled!)
how to do that?
Start an adb shell
Code:
rm -r /system/sd/data
cp -pr /data/data /system/sd/data
cd /data/data
now use
Code:
du -hs *
to check which directories are the biggest and contains non-critical software added by user (eg another music player or GPS navigation) and remove them to reduce disk usage (system will start to complain about disk space).
Use text editor to create a file "05data"
Code:
#!/system/bin/sh
# mount /system/sd/data to /data/data
if [ -d /system/sd/data ];
then
/system/xbin/mount -o bind /system/sd/data /data/data
fi
then push it to android device
Code:
adb remount
adb push path_to_file /etc/init.d/05data
adb shell chmod +x /etc/init.d/05data
Disclaimer:
I am using GSF B27 rom with A2SD, solution to symlink /data/data with /system/sd/data folder failed on my phone (bootloop) so I've created solution mentioned above. Binding than symlinking is safer, because original /data/data is a failover container for user files.
to move data to SD card it needs apps2sd text in init.rc then the bin files! ex this:
#!/system/bin/sh
# mount /system/sd/data to /data/data
if [ -d /system/sd/data ];
then
/system/xbin/mount -o bind /system/sd/data /data/data
if it have that then edit it!
and then the init files in /system/etc/init.d maybe them can edit on Linux or if can't then needs to use other program or then notepad or other programs on windows to edit init.d folder files...
then... it needs APP2SD files which works on Blade...
Now the Data(s)/APP(S) moving needs to be enabled....
If wants something else DATA to move SD Card then I don't know how... (maybe with File Explorer apps)...
Hi!
I am using GSF b27 on my Blade and because I was running out of internal memory, created a partition using clockworkmod (v5) recovery, following this tutorial:
http://android.modaco.com/topic/331205-guide-how-to-get-more-free-space-for-your-apps/
After reboot and trying to (re)install some apps, nothing changed...all my apps are still installed on my internal memory (that is full).
I checked the folder /system/sd but all the folders inside it are empty...it looks like A2SD is not running!
Isn't A2SD included in GSF27 and supposed to run automatically after a ext partition has been created?
Any help is welcome! Thanks
Tuc
A2SD is enabled after you create an ext2 partinition, right.
Now You have to copy *all* directories from /data/data to /system/sd/data
(how-to in post #1) AND delete directories of no-so-critical applications like Your another MP3 player or less played game from /data/data folder. You should have ~50MiB free on /data partiniton
Then, creating an initscript mentioned above will make an overlay of /system/sd/data folder on /data/data folder, so all needed files are on their place. Overlay instead of symlinking is better, because You have (stil aging, so old) backup of most important things, so in case of ****up You'll loose less.
Thanks for those details.
Everything went smooth until the following command:
adb shell chmod +x /etc/init.d/05data
Click to expand...
Click to collapse
ADB answers "Bad mode"...
I'm really not familiar with this ADB tools
EDIT: The folders in system/sd are still empty...Is there any SIMPLE solution to activate A2SD without ADB shell stuffs???! I don't mind uninstall all my apps to re-install them in this system/sd folder, I just need to know how to activate automatic installations in this folder instead of the internal memory... Thanks
Tuc
It's not about deleting apps and installing them.
It's about moving ALL data from /data/data to /system/sd/data, removing unnecessary files from /data/data (to get more free space to make android stop to complain about free space) and creating overlay from SD card on /data partiniton to make them back.
There's no directory called /system/sd/* on my LG P690. Can't I use the /sdcard/data directory or the /data/sdext2/data instead?
abhishek046 said:
There's no directory called /system/sd/* on my LG P690. Can't I use the /sdcard/data directory or the /data/sdext2/data instead?
Click to expand...
Click to collapse
yes u can
Blade Q Maxi aps2 sd
Hi I need help in moving apps to SD on a Blade Q Maxi phone.Tried with a terminal emulator app but no luck.Please assist.
it works on other ROMS, like TouchWiz?

[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:

Can't move TWRP backup files to PC

So, before I do a firmware update (In this case 4.2.2 to 4.3 OTA) I do a Titanium backup and a TWRP backup and copy both sets of backup files to my PC; it obviously makes no sense to only have backups on the device you are backing up. I upgraded to TWRP 2.6.0.0, did a full backup, and as usual I went to copy my backup files over to my Windows 7 computer using Windows Explorer and I can only get a couple of the files to move over. No warning, no error, no nuttin. This has always worked before......Did something change, and if so, how do I fix it?
I see from another post that TWRP changed the permissions of the backup files in the latest version of the program, and in my case the location as well. The workaround is to a) change the permissions on all those backup files, which I could see the nightmare problems that could cause later on when doing a restore and/or the security issues or b) doing an adb pull.
SOLVED.
The adb pull did the trick. All files were transferred over to my PC.
I had several issues getting adb to work:
1) I had an old version of the SDK installed on my PC which was causing a devices not recognized problem or something similar.
2) I didn't notice the message about verifying the RSA on my phone, which once verified, fixed the phone "offline" problem.
3) The screen lock on my phone was coming on after its timeout and locking me out from seeing the phone.
reverted to twrp 2.5.0.0
Same problem here with Google Nexus i9250 / twrp 2.6.0.0 / win7 64bit. Tried to copy backup of (BOOT/SYSTEM/DATA) via MTP or ftp from Nexus to PC. Only the first two files (boot.emmc.win/-md5) were copied. After downgrading to twrp 2.5.0.0 everthing was fine.
I had the same problem. It is caused by strange suid permissions set by TWRP. Solved it using chmod 0664 /data/media/0/TWRP/... (as root)
I was not able to adb pull before changing the files' permissions.
More details here:
http://forum.xda-developers.com/showpost.php?p=44120545&postcount=14
(Google found that HTC One thread first, so I didn't search any further)
Type this in Terminal Emulator:
su
busybox chown - R 1023.1023 /data/media/*
That should solve all permissions problems.
I had no trouble at all by doing the following:
Access the sdcard from /data/media/0
Copy data.ext4.win and system.ext4.win to a temporary location.
(The "Set UID" and "Set GID" permissions were automatically removed. If not, you can change them from here.)
Copy the files to PC using MTP.
The remaining backup files from the TWRP directory can be copied normally.
Done
Note: You can instead just change the permissions on these two files inside the TWRP directory, but I did the temporary location copy just to be safe.
Mercado_Negro said:
Type this in Terminal Emulator:
su
busybox chown - R 1013.1023 /data/media/*
That should solve all permissions problems.
Click to expand...
Click to collapse
coming up with chown: unknown user -
is that a space between 1023 and /data?
daryllh said:
coming up with chown: unknown user -
is that a space between 1023 and /data?
Click to expand...
Click to collapse
I'm sorry, I made a mistake there. The correct command is:
su
busybox chown -R 1023.1023 /data/media/*
I wrote 1013.1023 and it's 1023.1023
Mercado_Negro said:
I'm sorry, I made a mistake there. The correct command is:
su
busybox chown -R 1023.1023 /data/media/*
I wrote 1013.1023 and it's 1023.1023
Click to expand...
Click to collapse
After I did this command, my pc can't detect the back up
handols said:
After I did this command, my pc can't detect the back up
Click to expand...
Click to collapse
Did you plug/unplug your device after running this command? There shouldn't be any problems. Furthermore, now you should be able to copy your TWRP and TiBu backups successfully to your computer. It's a pretty straight forward process.
Im on twrp 2.5.0.0 with Android 4.3. I cant copy the BACKUP folder directly to my PC with the default windows explorer because the backup isnt stored in /sdcard/TWRP. How can I fix this? I used to be able to do this without adb push/pull...
Mercado_Negro said:
I'm sorry, I made a mistake there. The correct command is:
su
busybox chown -R 1023.1023 /data/media/*
I wrote 1013.1023 and it's 1023.1023
Click to expand...
Click to collapse
Thanks for this. I'm able to backup TWRP folder to PC now :highfive:
Since my original post 3 months ago I updated all my programs to 4.3 friendly versions as each was released (superuser 1.0.2.1, Windows drivers, TWRP 2.6.3.0, etc.) and now I don't need to do adb pulls any more and I can just copy and paste files from my phone to my pc and all files are copied over without missing any of them. Now I see the updated programs are already starting to show up for Android 4.4; here we go again.
Now see 0 / legacy emulated
Mercado_Negro said:
I'm sorry, I made a mistake there. The correct command is:
su
busybox chown -R 1023.1023 /data/media/*
I wrote 1013.1023 and it's 1023.1023
Click to expand...
Click to collapse
Hi just wondering, Is there a way to cancel this command (just add a +R maybe) I did it on my phone and I think it may be the cause that I have a Legacy emulated 0 path problem Ive searched around and cant seem to find a solution. Thanks
NightCrawler504 said:
Hi just wondering, Is there a way to cancel this command (just add a +R maybe) I did it on my phone and I think it may be the cause that I have a Legacy emulated 0 path problem Ive searched around and cant seem to find a solution. Thanks
Click to expand...
Click to collapse
What's the problem? That's a valid path.
Legacy emulated 0
Mercado_Negro said:
What's the problem? That's a valid path.
Click to expand...
Click to collapse
I have an external sd (sdcard1) = /storage/sdcard1 so gr8 but then I have emulated (??) Storage/emulated/legacy and Storage/emulated/0 and sdcard0 storage/sdcard0 they were complety different folders been reading around seems to be a problem with cm when I go from 4.2 and over my phone is a e970 att, cant delete the emulated folder... already erased all my data previously, any help will do,I'm almost sure it had nothing to do with the chown command but had to give a try.
NightCrawler504 said:
I have an external sd (sdcard1) = /storage/sdcard1 so gr8 but then I have emulated (??) Storage/emulated/legacy and Storage/emulated/0 and sdcard0 storage/sdcard0 they were complety different folders been reading around seems to be a problem with cm when I go from 4.2 and over my phone is a e970 att, cant delete the emulated folder... already erased all my data previously, any help will do,I'm almost sure it had nothing to do with the chown command but had to give a try.
Click to expand...
Click to collapse
No, it doesn't have anything to do with this command since it's just a way to set different permissions.

[Q] MAC Address Keeps changing

Everything was good until I started messing with the 4.4 roms. Now no matter what I do. Full Wipe, Factory Image restore, try different Roms/Kernels, etc, my MAC Address will reset after every reboot. This is an issues as I use Mac Filtering on my router. Any Ideas?
The same is happening to me and I can't find a way to fix it!
It sucks because my main connection (my University wifi) doesn't let me connect if I have a different MAC Address.
I'm using this app to change my MAC (temporarily) https://play.google.com/store/apps/details?id=com.jworksbr.macspoofer
You need root to make it works.
Anyway, I'm still trying to find a way to get my original MAC address back.
joaocadide said:
The same is happening to me and I can't find a way to fix it!
It sucks because my main connection (my University wifi) doesn't let me connect if I have a different MAC Address.
I'm using this app to change my MAC (temporarily) https://play.google.com/store/apps/details?id=com.jworksbr.macspoofer
You need root to make it works.
Anyway, I'm still trying to find a way to get my original MAC address back.
Click to expand...
Click to collapse
I ended up using http://forum.xda-developers.com/showthread.php?t=2347060
For mac address:
- In /persist directory create wifi directory. In the new directory create a file named .macaddr (don't miss the dot!)
Edit the file and put 12 random hex numbers in it (0-9, A-F), save.
- Set execute and read permissions for everybody on /persist/wifi directory and change owner of .macaddr to wifi:wifi and permission to 660 (read/write for owner and group and nothing else).
In command line:
Code:
chown root:root /persist/wifi
chmod 755 /persist/wifi
chown wifi:wifi /persist/wifi/.macaddr
chmod 660 /persist/wifi/.macaddr
- run /system/bin/conn_init program. Can be run in root explorer(choose Linux Script Handler when you open it), or in adb shell:
Code:
su
/system/bin/conn_init
Then reboot and check if the changes got applied in settings
I cant get my original one back but at least I have a static MAC.
..
chainup said:
For me it's only the last 6 numbers/letters that keep changing on reboot. For both Wifi and Bluetooth. Is it the same for you guys?
Click to expand...
Click to collapse
Yeah first are always 11:22:33
Thank you, bandit97!
It's working fine now! =D
bandit97 said:
I ended up using http://forum.xda-developers.com/showthread.php?t=2347060
For mac address:
- In /persist directory create wifi directory. In the new directory create a file named .macaddr (don't miss the dot!)
Edit the file and put 12 random hex numbers in it (0-9, A-F), save.
- Set execute and read permissions for everybody on /persist/wifi directory and change owner of .macaddr to wifi:wifi and permission to 660 (read/write for owner and group and nothing else).
In command line:
Code:
chown root:root /persist/wifi
chmod 755 /persist/wifi
chown wifi:wifi /persist/wifi/.macaddr
chmod 660 /persist/wifi/.macaddr
- run /system/bin/conn_init program. Can be run in root explorer(choose Linux Script Handler when you open it), or in adb shell:
Code:
su
/system/bin/conn_init
Then reboot and check if the changes got applied in settings
I cant get my original one back but at least I have a static MAC.
Click to expand...
Click to collapse
i came from your link too but this didn't work for me
anyone know why?
Hi. This has been driving me crazy! My Nexus 4 also gets a new Mac address on each reboot. My local WiFi hotspot thinks i am a new customer every time I visit (as it uses Mac address filtering) which is frustrating. I got onto Google about it but they said i should return the phone to the retailer (didn't get it on the Play store). I tried reverting the phone to Android 4.3, resetting etc but nothing works. I the phone was fine at first so I can only assume it is a hardware fault. Does anyone have any more incite into this or a solution?
Could someone explain how I run the commands in an adb shell? I'm familiar with adb and android toolkit etc. Many thanks! PS. I tried it using root explorer and it did not work
Sent from my Nexus 4 using xda app-developers app
Where is /persist directory?
bandit97 said:
I ended up using http://forum.xda-developers.com/showthread.php?t=2347060
For mac address:
- In /persist directory create wifi directory. In the new directory create a file named .macaddr (don't miss the dot!)
Edit the file and put 12 random hex numbers in it (0-9, A-F), save.
- Set execute and read permissions for everybody on /persist/wifi directory and change owner of .macaddr to wifi:wifi and permission to 660 (read/write for owner and group and nothing else).
In command line:
Code:
chown root:root /persist/wifi
chmod 755 /persist/wifi
chown wifi:wifi /persist/wifi/.macaddr
chmod 660 /persist/wifi/.macaddr
- run /system/bin/conn_init program. Can be run in root explorer(choose Linux Script Handler when you open it), or in adb shell:
Code:
su
/system/bin/conn_init
Then reboot and check if the changes got applied in settings
I cant get my original one back but at least I have a static MAC.
Click to expand...
Click to collapse
Where is the /persist directory found? Does this work on unrooted phones? I have the Chinese S5 phone which changed Mac address every time I reboot or turn off and on the wifi. This has me logging in to my router to add a new mac every time.
You DO need to be rooted
ayonbaxter said:
Where is the /persist directory found? Does this work on unrooted phones? I have the Chinese S5 phone which changed Mac address every time I reboot or turn off and on the wifi. This has me logging in to my router to add a new mac every time.
Click to expand...
Click to collapse
Hello, you need not only root access, but a file manager capable of mounting read-write permissions, like ES File Explorer (free on Google Play).
If you have a Terminal Emulator, this will help. If not, find one on the Play Store. My favorite is from developer Jack Palevich, found here.
Otherwise, you won't see the directory on a stock file manager, especially if you're NOT rooted. Although I am on CM 10.2, this has plagued me as well when I was running CM11.
Good luck!
furboom1240 said:
Hello, you need not only root access, but a file manager capable of mounting read-write permissions, like ES File Explorer (free on ).
If you have a Terminal Emulator, this will help. If not, find one on the Play Store. My favorite is from developer Jack Palevich, found .
Otherwise, you won't see the directory on a stock file manager, especially if you're NOT rooted. Although I am on CM 10.2, this has plagued me as well when I was running CM11.
Good luck!
Click to expand...
Click to collapse
i have the same problem, i cant find the /persist directory. i installed ES file exloprer but on / there is no /persist folder only these folders:
acct, cache, config, custom, d, data , dev, etc, mnt, proc ,protect_f,protect_s, root, sbchk, sbin, sdcard, sys,system, vendor
can i create a persist folder or do i have a bigger problem with my system?
Lack of Details
tommy0014 said:
i have the same problem, i cant find the /persist directory. i installed ES file exloprer but on / there is no /persist folder only these folders:
acct, cache, config, custom, d, data , dev, etc, mnt, proc ,protect_f,protect_s, root, sbchk, sbin, sdcard, sys,system, vendor
can i create a persist folder or do i have a bigger problem with my system?
Click to expand...
Click to collapse
First of all, do you have Superuser-managed root access? In order for me to assist, you need to answer that. The /persist directory should certainly exist, as it was so on all devices I own, rooted or not. When browsing the filesystem, please be careful what you mess with. Even with root access, you must exercise judgment in what you modify.
As always, Root Responsibly.
Stay custom, my friends...

Categories

Resources