[Q] MAC Address Keeps changing - Nexus 4 Q&A, Help & Troubleshooting

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...

Related

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

[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

[Q] Android 4.2: "Public" folder for every user?

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?

[Q] Nexus 4 changes MAC-Adress after reboot

Hi,
at first sorry for my english.
My Nexus 4 Stock ROM KK 4.4 KRT16O Rootet (SuperSU Pro, BusyBox Pro) changes its WiFi MAC-Adress after rebooting Device.
Is there any way to Fix this?
Sample MAC:
00:11:22:C5:F1:37
First 6 Numbers are always the same... last 6 changed
Wagi99 said:
Hi,
at first sorry for my english.
My Nexus 4 Stock ROM KK 4.4 KRT16O Rootet (SuperSU Pro, BusyBox Pro) changes its WiFi MAC-Adress after rebooting Device.
Is there any way to Fix this?
Sample MAC:
00:11:22:C5:F1:37
First 6 Numbers are always the same... last 6 changed
Click to expand...
Click to collapse
I've the same problem of you and i'm intrigued that nobody answered. Have you find a way to fix this ?
No fix found.
I have no solution found so far.
I am grateful for every tip
Wagi99 said:
No fix found.
I have no solution found so far.
I am grateful for every tip
Click to expand...
Click to collapse
Thanks !
Found this... Works Fix for Bluetooth and MAC adress:
HTML:
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

Nexus 4 bluetooth address not sticking - and persist forder doesn't exists. HELP

Okay, my Nexus 4 is fine except for this problem. Wifi, mobile data, nfc... Just wanted to say that.
One day, I noticed that every time I turn on and off the bluetooth, my bluetooth MAC address changes. So I have to pair everything manually again. Such a pain...
So I searched XDA, and found some helpful posts. They said 'make a new folder in /persist, make a file named .bdaddr, type in 6 charactors, give some permissions, and reboot.'
However, I noticed that I didn't have persist folder in my root directory. I've seen it before on my phone, so it looked very strange.
I just went forward and made persist folder on root. It was made successfully. I went inside the folder. Strangly, it was not empty. Three folders(lost+found, sensors, svoperapps) were already there. I ignored them and made bluetooth folder, make a file, bla bla.... and I rebooted.
My bluetooth problem was still there. Mac address keeps changing!
When I went to my phone's root again, the persist folder was nowhere to be seen. I made it again and went inside. There were four folders inside. Three which was mentioned above, and the bluetooth folder that I made was still there. Even the .bdaddr file was still there.
TL;DR : My /persist folder disappers with reboot, but the contents inside it is intact when I make it manually again.
What can I do? Please help me.....
Hi! I had the same issue in december. Actually, my N4 suddenly started to act strange till I get the red light of death problem. Before changing battery, it was not even booting, couldn't use recovery or anything else. So I went to 'debrick' it using LG tools and a tutorial. It worked and I flashed stock again.
Unfortunately, bluetooth and wifi were affected by that procedure. They both work though. Bluetooth keeps changing but wifi didn't start changing before yesterday. Really annoying. Since my router at home stores MAC addresses, I was able to retrieve my original MAC Address.
I've tried this procedure 100 times so I'll tell you what and when you have to pay attention for errors:
- The /persist folder does exist. To reach it, you'll need root access via adb shell. Make sure you use 'su' till you get '[email protected]' in shell (adb shell)
- In my case, both bluetooth and wifi folder were already there, so I just created '.macaddr' in '/persist/wifi'
- In your case, create a '.btaddr' file in '/persist/bluetooth' folder. I used 'touch' to create files while in shell
- Set the bluetooth address as you wish with 'echo': echo -n "address" > .btaddr
- Attention: please notice that you will have to try it out the 'echo' thing. Pretty much all instructions I read stated that I had to use 'echo -en' printing HEX values (\xFF) to the '.macaddr' file. That didn't work at all. Instead, I printed ANSI values. That way it worked. Once you created the file and printed its values you can check it using some sort of explorer with supersu. If you printed HEX values, you should end up with 6 bytes while with ANSI you will get 12 bytes (chars). This is easy to spot after you reboot because if you manage to check the address it will show up with a lot of "00". That means it's incomplete and once you turn bt on it will change to something more bt-like address.
- Now you set the owners and permissions:
- chown root:root /persist/bluetooth
- chmod 755 /persist/bluetooth
- chown bluetooth:bluetooth /persist/bluetooth/.btaddr
- chmod 660 /persist/bluetooth/.btaddr
- Reboot and check if it worked.
MagnoT said:
Hi! I had the same issue in december. Actually, my N4 suddenly started to act strange till I get the red light of death problem. Before changing battery, it was not even booting, couldn't use recovery or anything else. So I went to 'debrick' it using LG tools and a tutorial. It worked and I flashed stock again.
Unfortunately, bluetooth and wifi were affected by that procedure. They both work though. Bluetooth keeps changing but wifi didn't start changing before yesterday. Really annoying. Since my router at home stores MAC addresses, I was able to retrieve my original MAC Address.
I've tried this procedure 100 times so I'll tell you what and when you have to pay attention for errors:
- The /persist folder does exist. To reach it, you'll need root access via adb shell. Make sure you use 'su' till you get '[email protected]' in shell (adb shell)
- In my case, both bluetooth and wifi folder were already there, so I just created '.macaddr' in '/persist/wifi'
- In your case, create a '.btaddr' file in '/persist/bluetooth' folder. I used 'touch' to create files while in shell
- Set the bluetooth address as you wish with 'echo': echo -n "address" > .btaddr
- Attention: please notice that you will have to try it out the 'echo' thing. Pretty much all instructions I read stated that I had to use 'echo -en' printing HEX values (\xFF) to the '.macaddr' file. That didn't work at all. Instead, I printed ANSI values. That way it worked. Once you created the file and printed its values you can check it using some sort of explorer with supersu. If you printed HEX values, you should end up with 6 bytes while with ANSI you will get 12 bytes (chars). This is easy to spot after you reboot because if you manage to check the address it will show up with a lot of "00". That means it's incomplete and once you turn bt on it will change to something more bt-like address.
- Now you set the owners and permissions:
- chown root:root /persist/bluetooth
- chmod 755 /persist/bluetooth
- chown bluetooth:bluetooth /persist/bluetooth/.btaddr
- chmod 660 /persist/bluetooth/.btaddr
- Reboot and check if it worked.
Click to expand...
Click to collapse
First, thank you for helping! I really appriciate it!
However, I have a problem. When I type echo -n "address" > .bdaddr into adb shell, it says "can't create .btaddr: Read-only file system". I've tried mount -o rw,remount /persist but nothing happens.....
Can you help me again please? It's my first time using adb shell....
P.S. can you just give me your .bdaddr file? I made the file in my explorer and gave it permissions, but it is not working. If you can, please send it to my email :
update : I got someone else's .bdaddr file and did everything. However, the problem is still the same. Everytime I turn on bluetooth, last six digits of my bluetooth mac address changes... Any ideas on what happened to my N4? It seems that my N4's damage is different to others
Hi, in my case name of file should be /persist/bluetooth/.bdaddr instead of /persist/bluetooth/.btaddr. With .bdaddr bluetooth is working with .btaddr is not working.

Categories

Resources