build.prop permission settings for 6.0 - Android Q&A, Help & Troubleshooting

I managed to get myself stuck in a boot loop by editing build.prop on my android 6.0 Nexus 7 tablet. I added the linero.sf.hwrotation=0 at the end of the file and saved it and then when I rebooted, it made no difference. I then changed the permissions on the build.prop file to 666 then now after the Google logo it gets stuck on a blank screen.
My device is rooted and I have twrp. So I'm thinking hopefully I can boot into recovery mode then could I somehow reset the permissions? Can someone kindly guide me through what I need to do? What should the permissions be? Why was that line not working in the first place? Should I remove that hwrotation line?
Thanks

The permission should be 0744

jwoegerbauer said:
The permission should be 0744
Click to expand...
Click to collapse
Thank you. I booted into TWRP recovery mode and used the file manager to chmod the build.prop file to 0744 and rebooted it. Now it seems to be working.
Any ideas why my hwrotation setting is being ignored? only thing I can think of is that maybe it isn't supported on android 6.0? because most of the guides that are about that seem to refer to android 4.

ahmed123 said:
Any ideas why my hwrotation setting is being ignored? only thing I can think of is that maybe it isn't supported on android 6.0? because most of the guides that are about that seem to refer to android 4.
Click to expand...
Click to collapse
Try to make it persistent.
Example
Code:
# possible values: 0 = Landscape, 90 = Portrait, 180 = Reverse Landscape, 270 = Reverse Portrait
persist.ro.sf.hwrotation=180

jwoegerbauer said:
Try to make it persistent.
Example
Code:
# possible values: 0 = Landscape, 90 = Portrait, 180 = Reverse Landscape, 270 = Reverse Portrait
persist.ro.sf.hwrotation=180
Click to expand...
Click to collapse
Just tried that, still no difference. The boot google logo and android animation is still in portrait for some reason. When android starts up then you can see it flip to landscape which is the user setting part that I applied.

Related

[Q] Cyanogen: Set net.hostname at boot

Android 2.2 sets the default hostname to android_dfhjkahdjksf or something equally useless.
To override this in Cyanogen 6.1 you need to set the net.hostname property with setprop Eg:
# setprop net.hostname mickey
My problem is when I try to set this up at boot, something always overwrites my change with the default. I have tried putting it in my init.rc, /etc/init.d and /data/local/userinit.sh and it is always reset to default by the time the phone has booted.
Does anyone have any more ideas about how to permanently set the hostname? It would be a good option to have in cyanogenmod.
UP. I'm very interesting too.
The root filesystem is stored in the boot.img and is expanded to a ramdisk every time you reboot. For changes to be permenant, you need to extract the boot.img file, extract the kernel and ramdisk sections, modify the ramdisk image with your changes, then recombine the kernel and ramdisk to a new boot.img and reflash it. You'll probably need to do this on a linux machine that understands unix permissions and ramdisk/cpio filesystems as well as having a good knowledge of linux and unix commands. See this thread:
http://forum.xda-developers.com/showthread.php?t=551711
note: your kernel may use a different "--base 0x19200000" option when building the kernel boot image.
Is there not a way to add a correlating line to the build.prop file?
EDIT: This doesn't work - whatever is setting the net.hostname writes out after build.prop is read.
I'm looking...
I did a search in the /system/etc directory for any file doing setprop (I'm using a miui rom) and found the following script. I did the setprop for net.hostname in there and it too is being overwritten.
search command:
grep -H -r setprop /system/etc
/system/etc/init.goldfish.sh
I'm running out of ideas other than using autostart to set it after reboot.
EDIT2: doh. I think I already knew this but it dawned on me that the default net.hostname comes from concatenating the "android_id" (found in the secure database table) to the end of "android_".
So seems more likely to reset it after reboot using a script (gscript to launch it manually or use autostart to launch it automatically at the end of reboot cycle).
Property net.hostname originate from services.jar (ConnectivityServices.java):
Code:
// setup our unique device name
String id = Settings.Secure.getString(context.getContentResolver(), Settings.Secure.ANDROID_ID);
if (id != null && id.length() > 0) {
String name = new String("android_").concat(id);
SystemProperties.set("net.hostname", name);
}
Maybe CM guys would change this to add another "if /proc/sys/kernel/hostname is different than localhost, use it for net.hostname too" condition.
I'm not using CM so it is up to you guys to make a feature request.
Another approach would be to set service in init.rc that would start your net.hostname changing script on some property being set just after net.hostname is set. You could use also:
Code:
on property:net.hostname=android_blahblah
...but that wouldn't be so handy since you will have to change that line in init.rc every time you make a factory reset.
Really interesting, thx !
BlaY0 said:
Property net.hostname originate from services.jar (ConnectivityServices.java):
Code:
// setup our unique device name
String id = Settings.Secure.getString(context.getContentResolver(), Settings.Secure.ANDROID_ID);
if (id != null && id.length() > 0) {
String name = new String("android_").concat(id);
SystemProperties.set("net.hostname", name);
}
Maybe CM guys would change this to add another "if /proc/sys/kernel/hostname is different than localhost, use it for net.hostname too" condition.
I'm not using CM so it is up to you guys to make a feature request.
Another approach would be to set service in init.rc that would start your net.hostname changing script on some property being set just after net.hostname is set. You could use also:
Code:
on property:net.hostname=android_blahblah
...but that wouldn't be so handy since you will have to change that line in init.rc every time you make a factory reset.
Click to expand...
Click to collapse
Thanks a lot. I've been looking for this for the past hour or so. Traditional linux methods to set the hostname don't work... I think I'll add an option in cyanogenmod settings for this and submit it to Gerrit. Look for it to show up within the next day or two.
That's great m8! Cheers
Sent from my HTC Legend
underscores in hostnames are bad
The main thing I want to do is get rid of that underscore. Several of the places I hook up with with WiFi attempt to enter the hostname supplied during the DHCP conversation into a DNS. But underscore is illegal for this purpose.
Numbat.
Questions or Problems Should Not Be Posted in the Development Forum
Please Post in the Correct Forums
Moving to Q&A

[Q]setprop from script to change ro. properties

Just say i want to change properties of something in the build.prop... now this would normally be done by setprop...
But what if i want to disable the phone function ... i cannot call setprop on a read only property (ro.) like follows:
Code:
setprop ro.phone.function 0
Is there a way around this ... or some way that i can change the like starting with "ro.phone.function=" in a sh file?
Thanks
Kris
How to modify ro.(read only) property
Hi
I've released setpropex program, which can modify value of ro. property.
http://t.co/mMtzylU7
It uses ptrace, so you need root permission to use it.
thanks.
i00 said:
Just say i want to change properties of something in the build.prop... now this would normally be done by setprop...
But what if i want to disable the phone function ... i cannot call setprop on a read only property (ro.) like follows:
Code:
setprop ro.phone.function 0
Is there a way around this ... or some way that i can change the like starting with "ro.phone.function=" in a sh file?
Thanks
Kris
Click to expand...
Click to collapse
hi can you compile it for me I need it but I don't know compiling thanks
It still works
goroh_kun said:
Hi
I've released setpropex program, which can modify value of ro. property.
[link]
It uses ptrace, so you need root permission to use it.
thanks.
Click to expand...
Click to collapse
In KitKat algorithm has changed (androidcodesearch.com/source/bionic/libc/bionic/system_properties.c). But with some modification in your code it still works. General idea and generic code are correct. Thanks!
andr_andr said:
In KitKat algorithm has changed (androidcodesearch.com/source/bionic/libc/bionic/system_properties.c). But with some modification in your code it still works. General idea and generic code are correct. Thanks!
Click to expand...
Click to collapse
Have you published the changes somewhere? Having a working setpropex for KitKat would be great.
Does this still work on Nougat?

Changing font size and screen gamma CM7

Is there a way to do this? I had a Nook Color and it there was an app to change the gamma. Anyone know of an app that can do this for our TouchPads?
You can change the LCD density in the build.prop. Adjust it in increments of 10 until you find what you like.
Sent from XDA Premium on Thunderbolt
Stock dpi is 160.
I'm running 140 (slightly smaller). Valid is 0 to 255, but numbers over 240 caused issues with other devices so not a bad idea to have a current recovery backup.
How to edit your dpi manually:
Get Root Explorer from Market and scroll down to system, and tap it to open it. Then at the top, tap the [ Mount R/W ] button. It'll change to [ Mount R/O ] so you have read/write privilege. (If you're using a different editor, you'll have to figure out how to get read/write privilege.) Then long-press on your build.prop file, choose "edit".
Scroll down until you find this line (bottom section in ADDITIONAL BUILD PROPERTIES):
ro.sf.lcd_density=160
Tap to position your cursor at the end of the line and carefully change 160 to 140:
ro.sf.lcd_density=140
When done, tap the menu button, choose "save and exit" and tap the top button in Root Explorer to change back to [ Mount R/W ] and reboot.
There are other programs that let you edit system files, but you need one that uses root since this is a system file that can't be edited with some file managers.
Colchiro said:
Stock dpi is 160.
I'm running 140 (slightly smaller). Valid is 0 to 255, but numbers over 240 caused issues with other devices so not a bad idea to have a current recovery backup.
How to edit your dpi manually:
Get Root Explorer from Market and scroll down to system, and tap it to open it. Then at the top, tap the [ Mount R/W ] button. It'll change to [ Mount R/O ] so you have read/write privilege. (If you're using a different editor, you'll have to figure out how to get read/write privilege.) Then long-press on your build.prop file, choose "edit".
Scroll down until you find this line (bottom section in ADDITIONAL BUILD PROPERTIES):
ro.sf.lcd_density=160
Tap to position your cursor at the end of the line and carefully change 160 to 140:
ro.sf.lcd_density=140
When done, tap the menu button, choose "save and exit" and tap the top button in Root Explorer to change back to [ Mount R/W ] and reboot.
There are other programs that let you edit system files, but you need one that uses root since this is a system file that can't be edited with some file managers.
Click to expand...
Click to collapse
Does 140 give you any market app compatibility issues with some apps (Maps) for example. I know on my Thunderbolt there are only a few DPI's to chose from or I have app compatibility errors and can't update apps.
I use Nitrality from the market to change the DPI. It's under the UI section of the application I believe. I set my DPI at 200 and now I can actually see my icons.
180 Seems good. 160 a little too smal and 200 a bit too big for my taste.
I'm on 150 right now and think I'll keep it there until something goofy, like missing market apps happens.
Had that problem on the Nook and didn't even know it until I flashed a version with 160 dpi and instantly had about 6 updates in Market.
How does one get back to 160 dpi? The bar in nitrality wont go below 182 in portrait or landscape
Sent from my HTC Eva 4G using Tapatalk
For reason I'm getting launcher force close with anything under 160. Any idea why?
Mine's set to 150 and I just opened LPP, backed it up and uninstalled it. (I use it on my phone, but not optimal for tables, IMO. No FC's here.
Please post non development Questions into General Forum of device when there is no direct Q & A Forum.

!!SOLVED!! [Q] stuck in tablet mode: auto-rotation off = landscape

Something strange has started happening, if I turn off auto rotation my XZU sticks in landscape mode.
If I turn on auto rotate then phone will do what I expect and operate in portrait and landscape mode. However, if I am lying down in bed I want the non auto mode to make phone stick to portrait mode.
I suspect the problem is related to having used Xposed framework and App Settings to override DPI and make Google Maps easier to read the car. However, disabling that module and Xposed doesn't fix the problem.
My c6802 xzu is running 4.4.4, unlocked bootloader, rooted with dual recovery.
I'd go poking at build.props but I don't know what to look for, and I've searched but most results about people wanting auto rotate control apps.
Thanks for reading and more thanks for any help.
Paul
you can force orientation of specific apps with app settings xposed module. Try that?
For example the youtube app does not respond to lock orientation setting so it will enter landscape mode if you rotate the phone so I forced the app to stay in portrait mode with the xposed module
Yes, I know I can force specific apps into specific orientations but I actually want everything to auto rotate when that setting is enabled.
e.g. I browse the web in portrait most of the time, but some websites only really work in landscape.
I just want my Xperia Z Ultra to behave like it always used to.. I.e. fixed portrait, or auto.
FIXED!
FIXED!
a few blank lines added for easy reading
Code:
$ adb shell
[email protected]:/ $ su -
[email protected]:/ #
# sqlite3 /data/data/com.android.providers.settings/databases/settings.db
SQLite version 3.7.6.3-Titanium
Enter ".help" for instructions
Enter SQL statements terminated with a ";"
sqlite> select * from system;
1|volume_music|11
2|volume_ring|5
... snip loads and loads...
3990|volume_voice_earpiece|2
3996|volume_music_headset|8
3997|volume_music_bt_a2dp|8
4007|media_button_receiver|com.amazon.mp3/com.amazon.mp3.playback.service.HeadsetControlsReceiver
sqlite> select * from system where name='accelerometer_rotation';
3970|accelerometer_rotation|1
sqlite> select * from system where name='user_rotation';
3638|user_rotation|3
sqlite> update system set value=0 where name='user_rotation';
sqlite> select * from system where name='user_rotation';
3638|user_rotation|0
sqlite> ^D
no need for a reboot, turned on auto-rotate and voila, device no longer thinks its a tablet.
note that the only sqlite3 binary I could find was one in the Titanium Backup Root app:
[email protected]:/ # find / -name sqlite3
/data/data/com.keramidas.TitaniumBackup/files/sqlite3
with thanks to Jakub Czaplicki for his post to StackExchange:
http://android.stackexchange.com/qu...fault-screen-orientation-in-android-specified

Rotate screen issue

I have issue with screen rotation, it does not work anymore even with screen rotation is enabled. My device 7T Pro is rooted.
History:
I was having issue with HDMI mirror, the second display was always flipped either portrait or landscape.
I tried multiple tutorials that sets device properties like the following:
```
adb shell setprop persist.demo.hdmirotation portrait
adb shell setprop persist.demo.hdmirotationlock false
adb shell setprop persist.demo.singledisplay true
```
However, it does not solve the issue. When I removed these props, the HDMI issue resolved, but the device wouldn't rotate any more.
Any one would help, thanks in advance
akhalifah said:
I have issue with screen rotation, it does not work anymore even with screen rotation is enabled. My device 7T Pro is rooted.
History:
I was having issue with HDMI mirror, the second display was always flipped either portrait or landscape.
I tried multiple tutorials that sets device properties like the following:
```
adb shell setprop persist.demo.hdmirotation portrait
adb shell setprop persist.demo.hdmirotationlock false
adb shell setprop persist.demo.singledisplay true
```
However, it does not solve the issue. When I removed these props, the HDMI issue resolved, but the device wouldn't rotate any more.
Any one would help, thanks in advance
Click to expand...
Click to collapse
Maybe you need to restore "build.prop" file located at system folder
Found any solution? Even with my rooted device and these settings it won't work.

Categories

Resources