regebro / tzlocal

A Python module that tries to figure out what your local timezone is
MIT License
184 stars 58 forks source link

Bug with my hardware and tzlocal #102

Closed givemhell closed 2 years ago

givemhell commented 3 years ago

Hey I ran into a bug with my hardware I'm going to link you to the issue and chat I had with another dev

Let me know if you think this is something you can work out if not I totally understand I'm not running anything that's common but please definitely let me know if you think you could solve this issue much love and thanks in advance =]

https://github.com/bobloy/Fox-V3/issues/153#issuecomment-711276227

regebro commented 3 years ago

You get that error, because the file /system/bin/getprop exists, which indicates that you are running this on an Ubuntu phone, but for some reason, when we try to execute that getprop command, it fails.

That's pretty weird.

givemhell commented 3 years ago

Any suggestions as to what I should do? Like I said I'm definitely on an unconventional setup XD

givemhell commented 3 years ago

Screenshot_20201019-093055

regebro commented 3 years ago

Could you see if you can find the file tzlocal/unix.py, and change the line that says:

androidtz = subprocess.check_output(['getprop', 'persist.sys.timezone']).strip().decode()

to

androidtz = subprocess.check_output(['/system/bin/getprop', 'persist.sys.timezone']).strip().decode()

ie giving it the full path to getprop? That's the only idea I have.

givemhell commented 3 years ago

doing a scan now for anything called tzlocal in my phone now, i wouldn't even know where to begin to look for it and im pretty sure if i search unix.py ima get alot of results but il search that next

il let you know if i find it and il give it an edit and hopefully everything works out

givemhell commented 3 years ago

So the scan locked up after 400000 files scanned so I'm going to try again tonight at work maybe look at some sub directorys I'd assume its somewhere in the linux files and not in the directory that trys to pull the command

givemhell commented 3 years ago

So I was able to finally track down the file, I made the edit and it gave the same error.

If you look at the picture of the getprop file there is also a "real path" I tried that as well and I get the same error. Turns out after looking for the "toolbox" that didn't even exist...

I also noticed that in the unix.py Are we under Termux on Android? I'm not running the termux terminal my terminal is called nethunter terminal

I did install the termux terminal but I still got the same error

Could my getprop file maybe not contain the same data as the normal rooted phone would?

I overlayed kali on my oxygenOS is (standard os for oneplus phones) but could kali maybe of modified the file or replaced it?

regebro commented 3 years ago

I don't know why getprop doesn't work for you, it's possible that it's Kali that is the problem, no idea.

I can't help you with that, though, we'd need to talk to Kali people.

givemhell commented 3 years ago

They used to be on GitHub but they archived the repo and moved to another site when I get home from work il find it and link it here and talk to them and hopefully we can get it figured out 😉

regebro commented 3 years ago

Any progress on that?