how to keep modified system file - Xiaomi Mi A1 Questions & Answers

I modified a system file parameter (i'm rooted). It's related with wifi mss clamping. But when i close wifi, or a pass from wifi to mobile, or i change wifi, this parameter return to previous setting and i have to change system file another time. How can i fix the system file and avoid changing? Thanks

You could try changing the file permissions once you modify it (chmod 444). Use chmod 644 to edit the file. This method works fine for controlling the navikeys led backlight (no timeout), so maybe it can be used for your purpose too.

Related

Post-Root Setup Instructions?

I know many of us are new to the whole rooting thing. I'm coming from the Windows Mobile world of custom ROMs, kitchens, etc., but I do have some linux experience. However, I can't for the life of me figure out how to do a lot of what comes "standard" in MoDaCo's ROM. Obviously it would be easier to simply install Paul's ROM and be done with it, but I'd really like to learn how to do it on my own too.
So, that being said, maybe we can pull together some tutorials, guides, and/or links to existing guides which explain how to go about setting up our Rooted phones manually. Here are some of the built-in mods the MoDaCo ROM comes with which would be nice to be able to do manually or on a one-off basis:
Included in MoDaCo 1.1 'core':
Rooted with 'adb remount' permission and superuser APK
A2SD included (fully automatic thanks cyanogen!) create a EXT2 partition as your second partition to use. dalvik-cache remains on device.
Added Jbed Java
Added Dropbear SSH running by default, check 'About' screen for password (port 2222). You can now remove this by running /system/bin/removedropbear.sh
Added Notes app from Dragon
Added Spare Parts (run it and switch the 2 animation types to 'fast' for an even better experience!)
Added android-wifi-tether 1.60 pre3 (props to the developer, this is a great app!)
Added WiFi Status indicator, with kind permission of Andrew Schwimmer
Added busybox 1.15.2 tweaked such that 'get information' in Swapper now works as desired
Added nano 2.09 text editor for use in shell mode
Added parted and sqlite tools
Added terminfo and settings to boot.img to allow nano etc. use
Added files required for Debian linux including loxley's updated bootdeb script
Moved Quickoffice to data partition to allow easy uninstall
Moved Google Maps and Google Voice Search to data partition to allow easy update
Silenced boot sound (it's still there and can be reactivated with a file edit)
Click to expand...
Click to collapse
*********
*********
!Working!
Wireless Tethering:
http://android-wifi-tether.googlecode.com/
Go to the "Downloads" tab and download version 1.61-pre
!Not Working!
Superuser Whitelist App
I found two threads here that describe how to install Superuser.apk.
http://forum.xda-developers.com/showthread.php?t=582140
http://forum.xda-developers.com/showpost.php?p=4897587&postcount=5
Using the first one, I was able to get the files onto the phone and I used the chmod commands found in the second file in the hopes this would work; however, whenever I try to use it, nothing happens. The ES File Explorer, in particular, used to work with MoDaCo. When I'd try to browse as root, Superuser would pop-up and ask if I wanted to grant the app permissions. Now it just hangs there (black screen) and ES File Explorer says I don't have root access. Other Root apps work fine though, it's just they don't seem to be dependant on Superuser Whitelist.
'adb remount' permission
This requires that the default.prop file be edited from ro.secure=1 to ro.secure=0. Unfortunately, I can't seem to get this file to stick. If I use the mv command using adb shell, I get some kind of permissions error. If I use the cp command when booting into the recovery menu and using adb shell, the file reverts to the original on boot. Or maybe it's simply not being overwritten, but not throwing any errors either
I think I may have found a thread that will help with the default.prop changes. Looks like this has to be done in the recovery.img which apparently overwrites any modifications in the root of the device on each reboot. I'll post an update if/when I figure it out.
HOWTO: Unpack, Edit, and Repack Boot Images
http://forum.xda-developers.com/showthread.php?t=443994
The adb remount permission issue is driving me crazy. Please keep us updated if you figure out a way of resetting that without installing a new ROM.
I ended up modifying one of the MoDaCo update scripts to set up ADB Remount, Superuser.apk, and Busybox. It's been working fine for me, but be sure to do a backup before you apply the update. Check it out here:
http://forum.xda-developers.com/showthread.php?t=593952

[Q] No Write access to /etc, /system/etc

Hi guys,
I read that i need to change a line to wpa_supplicant.conf in order to be able to connect to ad-hoc networks.
First of all, my wpa_supplicant.conf file is not in /data (/data is empty), but it is in /etc/wifi/ & system/etc/wifi/
Secondly, i have no write access even though i have flashed with the aufs_overlay_rw patch.
Any input on how i can change my access to be able to save the config file?
Thanks
p0inte said:
Hi guys,
I read that i need to change a line to wpa_supplicant.conf in order to be able to connect to ad-hoc networks.
First of all, my wpa_supplicant.conf file is not in /data (/data is empty), but it is in /etc/wifi/ & system/etc/wifi/
Secondly, i have no write access even though i have flashed with the aufs_overlay_rw patch.
Any input on how i can change my access to be able to save the config file?
Thanks
Click to expand...
Click to collapse
You can boot into recovery and manually mount system and data and so on there , then either push/pull stuff with adb , or go in there with adb shell and for instance copy the file to sdcard (don't forget to mount it in that case 8)
Id don't know if tha file requires you to chmod or anything though , maybe someone else can help you there.
I had to chmod framework-res.apk on my X10mini. You might have luck if you google it or search all of the subforums here.
Well, thanks to HDCR.Jacob & danne_jo and their hard work on the WildFire v8, ad-hoc support comes with the rom.
I guess that solves my problem

Sounds crazy, but build.prop edits not persisting through hard reboot.

I know this will sound crazy, but when I edit the build.prop file with root explorer to change the LCD density, then after a hard reboot the nook reverts to default settings. As in, I change the LCD setting to ANYTHING, and after a hard reboot the nook ALWAYS boots to 161 LCD density.
Soft reboots will retain my build.prop edits.
My just flashed the most recent nightly, had the same problems on the previous nightly.
I tried copying the build.prop file to my SD-card, then editing it, then deleting the one in the system folder, then moving the new/edited build.prop file into the system folder. This did not work as well.
Frankly I'm stumped.
Anyone else have any ideas?
Make sure you mount /system/ r/w in root explorer... somtimes people forget and just mount / as r/w but that doesn't work.
DizzyDen said:
Make sure you mount /system/ r/w in root explorer... somtimes people forget and just mount / as r/w but that doesn't work.
Click to expand...
Click to collapse
Thanks for the quick reply, but I am only mounting /system/ as r/w. The file IS being changed, the actual change to the LCD density setting is there and persists. The nook just ignores it and loads 161.
EDIT:
I just tried adb pulling build.prop, changing the LCD density in notepad++, and adb pushing it back to /system. It still hard reboots to LCD density 161 no matter what I change it to.
EDIT2:
Here's an even crazier thing. When I adb pull the build.prop and open it, the LCD density setting says what I changed it to, but it's like the nook is disregarding that setting and defaulting to 161.
EDIT3:
Here's a link to my build.prop file and a logcat if anyone smarter than I can find anything wrong. http://dl.dropbox.com/u/20309200/build.prop http://dl.dropbox.com/u/20309200/logcat.txt

Can't edit files in / with Chainfire boot.img and systemless root

So I'm trying to edit a start up script in / (or anywhere really) and I'm not able to edit the files due to access denied errors.
Do we need a custom kernel (like flar's) to edit files in the root (/)? I'm able to echo into files under /sys/ just fine but I can't open them in a text editor.
Thanks!

How to modify hosts file on Samsung Galaxy Core Prime?

I added a website that i want to block in hosts file like this "127.0.0.1 www.example.com" but still it isn't blocked.The hosts file is in UNIX format.On my desktop that specific site it is blocked but on android isn't.I use Chrome as default browser,and i also clear data/cache.I also want to know if it is possible to block subpages and how do i do it?For ex www.example.com/something/like/this.html
fleX_ said:
I added a website that i want to block in hosts file like this "127.0.0.1 www.example.com" but still it isn't blocked.The hosts file is in UNIX format.On my desktop that specific site it is blocked but on android isn't.I use Chrome as default browser,and i also clear data/cache.I also want to know if it is possible to block subpages and how do i do it?For ex www.example.com/something/like/this.html
Click to expand...
Click to collapse
To modify your hosts file, try this guide:
How to edit 'etc/hosts' file in non-rooted phone?
I'm using LineageOS 14.1 and don't want nor need to root it. How can I remount /system rw and edit /system/etc/hosts? All answers in "How to edit 'etc/hosts' file?" expect a rooted phone.
android.stackexchange.com
I already saw that post.The phone is rooted and i used twrp to copy modified hosts file from sdcard to system/etc but the sites are still working.
But how the hosts file should look like?Mine is like this:
127.0.0.1 localhost
127.0.0.1 www.youtube.com
.I also tried to change permissions to rw-r-r but no effect.

Categories

Resources