felikcat / unlimited-hotspot

Remove speed restrictions on your hotspot internet (iOS, iPadOS, Android, Quectel), and allows hotspots on any plan (rooted Android & Quectel only).
Do What The F*ck You Want To Public License
127 stars 6 forks source link

How to undo changes of v5 from 3/12/23? #1

Closed MrEngineerMind closed 1 year ago

MrEngineerMind commented 1 year ago

I have a limited Hotspot plan on a phone running andorid 10.

Without realize that you just posted a new v5 Magisk module, I installed the v5 from 3/12/23 and it appeared to work (the "remaining hotspot data" doesn't decrement)

However, I need to revert the hotspot back to the original "limited" state, but even after "removing" this module from magic and doing a reboot, the "remaining hotspot data" is still staying the same (as if the module is still loaded and functioning).

I thought that uninstalling a magisk module will return the phone to to pre-module install state.

So, how can I get the hotspot working as it originally was?

felikcat commented 1 year ago

I added Magisk module uninstall support in v6, which I released just now and was testing on my Pixel 4a (5G) running Android 13 CalyxOS. This should be fixed now.

I delete the props so it gets set back to its defaults, I don't set those props manually; a few OSes like GrapheneOS have the defaults to unblock hotspot usage and to not set the 'dun' APN type: https://github.com/GrapheneOS/platform_frameworks_base/commit/d4e03e77dd590e3ed89af8b72d5c09f875fc46b0 https://github.com/GrapheneOS/platform_build/commit/b22db418509758b781699898dc43c1c1d3a94999

MrEngineerMind commented 1 year ago

I am using stock Android 10 pixel 4a (non-5G).

My cellular service includes hotspot functionality, so I don't want to totally disable it, I just want to return it to the original "limited" functionality.

So, how can I do that?

...or are you saying that if I install v6, then uninstall it, it will undo the changces of the 3/12/23 v5 and return it to the original "limited" functionality?

felikcat commented 1 year ago

Reinstall Unlimited Hotspot to get v6, then uninstall it, and it'll do that for you.

MrEngineerMind commented 1 year ago

I am a little confused about something and I just want to make sure I understand what you are saying correctly so I won't accidently mess up my phone's network settings...

With my general knowledge of typical windows install/Uninstall processes, the uninstall process will simply "reverse" the changes that the "install" did.

And a quick glance of your uninstall.sh (again I have limited unix/java experiance) looks like it is taking advantage of a feature in android that allows the uninstall process to reverse the original changes that the install script did - meaning the uninstall process does not need to know what the original values for each setting were because android kept a copy of them and it is then instructed to restore them.

If this understanding is correct, then thats pretty cool!

However, I did notice that the install script of the 3/12/23 v5 was different than the v5 you posted a few days ago, so in your uninstall script you specifically have a section called "Specific to Unlimited Hotspot v5 only:" and I just wanted to make sure you are including all the lines needed to undo the changes that the 3/12/23 v5 did and not just the v5 you posted a few days ago.

So does the current v6 uninstall undo all the changes that the 3/12/23 v5 did?

(if you need a copy of the 3/12/23 v5, let me know and I can post a link)

felikcat commented 1 year ago

It removes the prop(erty), and the OS itself sets it again to its default value, but only if it was used in the first place.

The v4 version is also uninstalled, see here for that v4: https://github.com/mohamadxmuhaimin/unlimited-hotspot/blob/master/service.sh

MrEngineerMind commented 1 year ago

I never installed v4, just the v5 from 3/12/23 (not the v5 from a few days ago).

I installed v6 and uninstalled it, but the hotspot data usage still does not decrement as it originally did.

Remember, the v5 you had posted a few days ago was significantly different than v5 from 3/12/23, so is it possible additional reset lines need to be added to the v6 uninstall script to undo all the changes that the 3/12/23 v5 did?

felikcat commented 1 year ago

Open your terminal emulator and run: su, then getprop | grep tether; those props are the only things I've changed in v4, v5, and v6 that would cause the hotspot to not decrement like that.

If they're still there, try removing it first with resetprop -d net.tethering.noprovisioning, then if that doesn't work do resetprop -p -d net.tethering.noprovisioning and so on for the others if needed.

I'm thinking I should manually set those instead of using OS defaults, since those that have to install Magisk aren't going to be flashing alternative OSes that stop Android from saying you're using a hotspot to begin with. Also that having a direct line of comparison between a detected hotspot and non-detected hotspot whenever desired is a good idea.

MrEngineerMind commented 1 year ago

I am a linux novice, so I don't know how to intepret this..

I opened a terminal and got the "$" prompt. I entered "get prop | grep tether" ( | = pipe char) I clicked return and got the response " 1| "

What does that mean?

felikcat commented 1 year ago

Means grep failed (1) to find anything. It's getprop and not get prop however.

I'd try doing: su, then resetprop tether_dun_required 1; resetprop net.tethering.noprovisioning true; resetprop tether_entitlement_check_state 1 to see if that works.

MrEngineerMind commented 1 year ago

I recently cloned my phone due to the original phone's battery going bad and fortunately I never installed your module on that old phone, so I was able to do the "getprop | grep tether" on it and it also returned nothing, so something else changed that is causing the hotspot to not decrement for some reason.

But I did find a possible bug with your uninstall script....It contains the "-d" option, which I'm assuming is suppose to delete the specified property. But my device did not recognize that option because when I installed your v6 module, it made two persistant changes (quickpoweron, warmboot) that still existed after doing an uninstall of the v6 module, so I wanted to delete them to try to bring my phone back to the pre-v5 module condition.

In looking at this page (https://topjohnwu.github.io/Magisk/tools.html) it appears that "--delete" (instead of "-d") should be used to delete properties and sure enough, when I used "-p --delete" for those two properties, they were permanently deleted from my device.

felikcat commented 1 year ago

Thank you for notifying me of that, v7 will use --delete instead of -d.