[Q] How to change device name? - Nexus 6 Q&A, Help & Troubleshooting

Hi,
I'm rooted and have recently tried changing the device name of my Nexus 6 via terminal using:
Code:
setprop net.hostname <new-hostname>
This works as expected, however the change isn't persistent and doesn't seem to survive a reboot.
Does anybody know how I can make the change stick?

even play store apps can't change it

Script it. Init.d, su.d, tasker, script manager.

Related

[Q] Need help writing a script for temporary MVNO support on MIUI

Hey folks!
As some probably might have noticed, Galnet's awesome Miui ROM doesn't support MVNO providers. Fortunately some clever guy (thank you very much aziztcf) has found a solution that allows MVNO users like me to use the data connection without having to tick the data roaming checkbox.
Also the R icon is being hidden by this temporary fix. The only problem is that the "fix" only lasts until you restart your phone or enter flightmode. This means a lot of typing.
So aziztcf said a script might be ideal so you don't have to enter adb or your terminal emulator app every startup.
However I am stuck there as I never wrote a script before.
My question. Can anybody point me in the right direction? This is with what i came up so far.
The idea is to change the gsm.sim.operator.numeric/alpha to match the actual provider ones. So in my case i want it to be 23201 and A1, also I want to change the .isroaming to false and alter the beginning of the IMSI to match the original provider.
I placed this "script" in etc/init.d but it isn't working.
#!/system/bin/sh
#
#getprop
#setprop gsm.sim.operator.numeric 23201
#setprop gsm.sim.operator.alpha "A1"
#setprop gsm.operator.isroaming false
#setprop ril.IMSI 23201xxxxxxxxxx
thanks in advance guys!
Good luck!
really? is that everything you have? -.- anybody else?
perfectlysquare said:
really? is that everything you have? -.- anybody else?
Click to expand...
Click to collapse
I have created a file named roam (without extension) with this:
Code:
#!/system/bin/sh
su
setprop gsm.sim.operator.numeric 21407
setprop gsm.sim.operator.alpha "movistar"
setprop gsm.operator.isroaming false
setprop ril.IMSI 21407xxxxxxxxx
then i execute using "sh roam" and then when i close the terminal emulator, it works. but now, I'm using the APN of movistar, not the APN from my operator. I dont know if this is the solution for the MVNOs...
For execute this script every time you reboot, you can put the script in /etc/init.d/roam. ¿?
(sorry for my english)
Solution?
perfectlysquare said:
Hey folks!
As some probably might have noticed, Galnet's awesome Miui ROM doesn't support MVNO providers. Fortunately some clever guy (thank you very much aziztcf) has found a solution that allows MVNO users like me to use the data connection without having to tick the data roaming checkbox.
Also the R icon is being hidden by this temporary fix. The only problem is that the "fix" only lasts until you restart your phone or enter flightmode. This means a lot of typing.
So aziztcf said a script might be ideal so you don't have to enter adb or your terminal emulator app every startup.
However I am stuck there as I never wrote a script before.
My question. Can anybody point me in the right direction? This is with what i came up so far.
The idea is to change the gsm.sim.operator.numeric/alpha to match the actual provider ones. So in my case i want it to be 23201 and A1, also I want to change the .isroaming to false and alter the beginning of the IMSI to match the original provider.
I placed this "script" in etc/init.d but it isn't working.
#!/system/bin/sh
#
#getprop
#setprop gsm.sim.operator.numeric 23201
#setprop gsm.sim.operator.alpha "A1"
#setprop gsm.operator.isroaming false
#setprop ril.IMSI 23201xxxxxxxxxx
thanks in advance guys!
Click to expand...
Click to collapse
I think I have found a solution. (I have the same problem) - You need Root for this to work!
Here's what I did:
1.) Installed Busybox from PlayStore (open downloaded app and hit Install-Button within App)
2.) Installed SManager from PlayStore
3.) With SManager created a script named "netinit.sh" in system/bin
4.) Wrote the script (manually within SManager Editor!!! - didn't work when I pasted the lines into the file.):
#!/system/bin/sh
setprop gsm.sim.operator.alpha "A1"
setprop gsm.operator.isroaming false
getprop | grep operator
5.) With Smanager set the script to execute on boot and notify.
6.) With Smanager set the Permissions on the script to allow all access. (Found in Properties of script)
7.) Did a reboot and waited for the script notification BEFORE I unlocked the SIM.
8.) Voilá!
Hope, it works for you too!
Regards,
YogiwanKenobi said:
I think I have found a solution. (I have the same problem) - You need Root for this to work!
Here's what I did:
1.) Installed Busybox from PlayStore (open downloaded app and hit Install-Button within App)
2.) Installed SManager from PlayStore
3.) With SManager created a script named "netinit.sh" in system/bin
4.) Wrote the script (manually within SManager Editor!!! - didn't work when I pasted the lines into the file.):
#!/system/bin/sh
setprop gsm.sim.operator.alpha "A1"
setprop gsm.operator.isroaming false
getprop | grep operator
5.) With Smanager set the script to execute on boot and notify.
6.) With Smanager set the Permissions on the script to allow all access. (Found in Properties of script)
7.) Did a reboot and waited for the script notification BEFORE I unlocked the SIM.
8.) Voilá!
Hope, it works for you too!
Regards,
Click to expand...
Click to collapse
I follow this steps on miui v5, I don t know what I am doing wrong but it does not work...
razorinc said:
I follow this steps on miui v5, I don t know what I am doing wrong but it does not work...
Click to expand...
Click to collapse
Hi,
Does the script start?
Do you get an error in the console, when you manually run the script?
KR
Yogi
After I make a script I restart the phone, but launcher freezes...

How to keep env variable when SuperSu-ing?

I have a problem with SuperSU as well as Superuser app on my Razr i. The Razr i has its default LD_LIBRARY_PATH set like this:
LD_LIBRARY_PATH=/vendor/lib:/system/lib:/system/lib/arm
But when I have a su-App, it only sees this one
LD_LIBRARY_PATH=/vendor/lib:/system/lib
resulting in non-working apps because of missing libraries ("Openvpn Settings" in this case). The same happens when I'm sending a "su" on adb shell. I'm wondering now how I could set the default library path now...normally it should be possible to either call "su" with some special parameters to handle over the variables or to somewhere set those default values (they must come from somewhere). But at least the apps seem to not offer that?
BerniG said:
I have a problem with SuperSU as well as Superuser app on my Razr i. The Razr i has its default LD_LIBRARY_PATH set like this:
LD_LIBRARY_PATH=/vendor/lib:/system/lib:/system/lib/arm
But when I have a su-App, it only sees this one
LD_LIBRARY_PATH=/vendor/lib:/system/lib
resulting in non-working apps because of missing libraries ("Openvpn Settings" in this case). The same happens when I'm sending a "su" on adb shell. I'm wondering now how I could set the default library path now...normally it should be possible to either call "su" with some special parameters to handle over the variables or to somewhere set those default values (they must come from somewhere). But at least the apps seem to not offer that?
Click to expand...
Click to collapse
Try this (it usually works in Linux):
- Install Android Terminal Emulator
- Open it and type "su - "
- Allow via SuperSu or Superuser the Android Terminal Emulator to become root
- Edit .bashrc or .bash_profile with desired LD_LIBRARY_PATH you need.
- Save it
- Done!!

[REQUEST] Is there any module to change the hostname (name of the device)?

Hello, Magisk fans and devs.
The title is pretty self-explanatory. There are some ROMs that allow to customize the hostname of the device (the one that looks like "android-2120ee3b45...") to a more friendly one.
I know there are some apps that allow also this but it'd be nice to find a Magisk module that does that in a simpler way (and without the need to run the name changer app every time the device is rebooted).
Sincerely, thanks!
A module just for that feels a little like overkill... Use the resetprop tool and a boot script to change net.hostname to your desired value.
Add the following to an empty file in /magisk/.core/service.d.
Code:
#!/system/bin/sh
resetprop net.hostname [I]<new value>[/I]
Set the file's permissions to 755 (rwxr-xr-x) and restart.
That will change the hostname to your desired value on each reboot of your device.

Create module magisk replace build.prop

Hello everyone, I try to create a module to replace my build.prop because I do not please change it (system play only).
I do not understand much to magisk modules, can someone make me the module or I can put my build,prop please?
Or if impossible to replace the buil.prop by magisk, can be add the line :
persist.debug.wfd.enable=1
Thank you I've been trying since yesterday and I really can't do it so it seems to be simple
You don't need a module to do that.
Edit: For future reference... I've been reminded that persist props are, well, persistent. No boot script is needed, just run the resetprop command and the value will remain set even across reboots. Until a new value is set, of course.
Simplest way is to just use a boot script and the resetprop tool:
Code:
resetprop persist.debug.wfd.enable 1
Or if you really want to use a module you'll just have to add the line to system.prop and nothing else:
Code:
persist.debug.wfd.enable=1
Or you could use MagiskHide Props Config and the custom prop feature.
And Magisk doesn't actually alter the build.prop file:
https://github.com/Magisk-Modules-R...etting-a-custom-prop-or-removing-a-prop-value
Thank you for this quick response. I'm going to try to figure out how to do this script because I really don't know all this
Hi, I solved the problem with the module activated and in termux
Code:
su
Props resetprop persist.debug.wfd.enable 1
Now he finds the TV but restarts the phone as soon as he connects on it
If you're having problems creating a boot script it might be easier to use the MagiskHide Props Config module. It'll do it for you.
Hi, I aI think I did it. Here's how to do it with the installed module magiskhide props
Code:
su
Props resetprop persist.debug.wfd.enable=1
He finds me the TV, but as soon as he connects to the phone restarts is there a way to solve this problem?
chuppito said:
Hi, I aI think I did it. Here's how to do it with the installed module magiskhide props
Code:
su
Props resetprop persist.debug.wfd.enable=1
He finds me the TV, but as soon as he connects to the phone restarts is there a way to solve this problem?
Click to expand...
Click to collapse
I'm not sure what you're doing there, but that's not right...
If you're gonna use MagiskHide Props Config, just run
Code:
su
props
And then pick the "Add/edit custom props" menu (#4). Follow the on-screen instructions to set your prop.
If you're going to use resetprop as a standalone tool you run:
Code:
su
resetprop persist.debug.wfd.enable 1
That will only survive until a reboot though, which is why you would have to put the line in a service.d boot script if you want it to be permanent.
Edit: For future reference... I've been reminded that persist props are, well, persistent. No boot script is needed, just run the resetprop command and the value will remain set even across reboots. Until a new value is set, of course.
If I use props, I have no options
If I use setprop it doesn't tell me anything
Edit :
With props where I have more options I managed to do.
It was already on 1 while it started again several times.
I watch as soon as I get home if it connects or restarts as soon as it tries
The TV is well detected but as soon as I try to connect, the phone makes a small reboot
chuppito said:
If I use props, I have no options
If I use setprop it doesn't tell me anything
Edit :
With props where I have more options I managed to do.
It was already on 1 while it started again several times.
I watch as soon as I get home if it connects or restarts as soon as it tries
Click to expand...
Click to collapse
Does your edit mean you figured it out? If you didn't, here goes:
From your first screenshot, showing the props module ui, it tells you to "Enter the prop to set". So if you enter persist.debug.wfd.enable you'll get to the next screen where you can enter your desired value (and also see what the current value, if any, is).
The second screenshot is exactly as it should be. You're not supposed to get any feedback if it works.
About your other issues, I have no idea...
Yes I was able to understand how it works. I found a post for other problems on xda, if I understand, google deleted files last July to make this trick obsolete and sell its chomecast

Magisk boot script help for pixel 2 xl

Hi guys,
I'm trying to make a script to enable the android 11 notification shade blur in my pixel 2 xl,, so far I have managed to successfully enable it with ADB with this command:
adb shell
taimen:/ $ su
taimen:/ # setprop ro.surface_flinger.supports_background_blur 1
taimen:/ # stop
taimen:/ # start
It does work fine but as soon as the phone reboots it is lost
I made a magisk module and also managed to make a setprop mod with magiskhide that does indeed successfully add ro.surface_flinger.supports_background_blur 1 in build.prop, but the mod does not work unless I adb and input the command
adb shell
taimen:/ $ su
taimen:/ # stop
taimen:/ # start
I believe this is to restart system UI.
Is there any way to do this in magisk automatically at boot?
When I input in termux
su
# stop
The phone seems to try to restart the UI but it gets stuck in google logo, unlike when I do it via adb the screen goes blank and comes back alive when I input via adb
# start
I'm a complete noob in this stuff, I would really like to make a magisk script or module that let me do this, it would be useful to try first via termux to avoid a magisk boot loop in case something goes wrong with this script. The notification blur is actually the only reason I unlocked the bootloader an rooted the phone...
Thanks in advance.
You should use Magisk's resetprop tool.
All you should need in your boot script is this:
Code:
resetprop ro.surface_flinger.supports_background_blur 1
Try using service.d first, but if that doesn't work move the script to post-fs-data.d.
Or, if you're using a module, use a system.prop file.
Does "magiskhide props config 5.3.6" uses resetprop?
I did try that in service.d and post-fs-data.d
As I said, the property does seem to be changed with the setprop, since after a restart of the phone all I need to do is
Adb shell
Su
Stop
Start
And I get the blurred notification shade...
Yes, MagiskHide Props Config uses resetprop (but there you generally don't need to change to late_start service or post-fs-data, the default should be fine most of the time).
With resetprop you shouldn't need to run stop/start. That's the difference.
I did not try the delay option. I really don't know what else I could try though...
Maybe there's a delayed script I could run with the stop/start command?
Edit: sorry if I understand what you're saying, should I delete the magiskhide props config key and instead do it manually? That way I should no need the stop/start command.
I thought you had been doing it manually all along... To quote your first post: "I'm trying to make a script", "I made a magisk module and also managed to make a setprop mod".
If the stop/start commands need to be included for this to work, making your own boot script with the resetprop command and stop/start commands is the way to go.
Yeah yeah sorry, I did manage to make the module, the setprop mod I was referring to was via magiskhide...
My problem is when I try to run this stop/start script in termux
#!/system/bin/sh
su
cd
cd data/adb
stop
start
The phone goes to google logo and is stuck there, I'm afraid if I do that with magisk I could get a non booting phone...
Does this script sounds good to you?
#!/system/bin/sh
resetprop to.surface_flinger.supports_background_blur 1
stop
start
BTW I really appreciate your help!
Edit: just ran this script from termux and stuck at google logo...
Edit 2: if anyone is wondering or maybe it helps someone I ended up making this simple script in service.d
resetprop to.surface_flinger.supports_background_blur 1
Then I discovered all I needed was the terminal command
# killall surfaceflinger
And Systemui does successfully restart with the blurred background, so I created a home screen shorcut with this terminal command and all I need to do is hit the shorcut shortly after booting and it works, it's not automatic but it gets the job done...
Thanks @Didgeridoohan for your help... XDA rocks!
Hello!
I don't know if you're still looking for this but decided to share anyway.
Attached to this post is a Magisk module that enables Background Blur that survives reboots....
It's weird that a simple Magisk module with a system.prop doesn't work but ok... had to create this version which uses a service.sh script to do the job.
You'll need Magisk, obviously.
Enjoy!
Cheers!
Thank you for making this. The double restart is kinda annoying tho
Typhus_ said:
Hello!
I don't know if you're still looking for this but decided to share anyway.
Attached to this post is a Magisk module that enables Background Blur that survives reboots....
It's weird that a simple Magisk module with a system.prop doesn't work but ok... had to create this version which uses a service.sh script to do the job.
You'll need Magisk, obviously.
Enjoy!
Cheers!
Click to expand...
Click to collapse
Is this module device specific or will it work on other devices running Android 11?
rodken said:
Is this module device specific or will it work on other devices running Android 11?
Click to expand...
Click to collapse
It should work on any device running Android 11.
Typhus_ said:
It should work on any device running Android 11.
Click to expand...
Click to collapse
Perfect - functions as expected on OnePlus 8 OOS 11.
How about android 13?

Categories

Resources