[New Feature] Android installer

Discuss newly added features or request new features.
hugbug
Developer & Admin
Posts: 7645
Joined: 09 Sep 2008, 11:58
Location: Germany

Re: [New Feature] Android installer

Post by hugbug » 15 Oct 2015, 14:04

Time reported in web-ui is almost always correct because it is converted to a string in browser from UTC-time sent to browser by NZBGet.

Check the timestamps in the log-file. If they are wrong you need a time correction. This is possible due to differences between Linux platforms. The binary was compiled for a certain platform and the statically linked C-library searches for a certain file containing time zone info. Android may not have that file in the location where the library looks for it. I don't know details, it's possible that the library looks for some env. var which is not set too.

Nedle
Posts: 49
Joined: 06 Aug 2014, 10:24

Re: [New Feature] Android installer

Post by Nedle » 15 Oct 2015, 14:11

hugbug wrote:Time reported in web-ui is almost always correct because it is converted to a string in browser from UTC-time sent to browser by NZBGet.

Check the timestamps in the log-file. If they are wrong you need a time correction. This is possible due to differences between Linux platforms. The binary was compiled for a certain platform and the statically linked C-library searches for a certain file containing time zone info. Android may not have that file in the location where the library looks for it. I don't know details, it's possible that the library looks for some env. var which is not set too.
Ah, didn't think about checking logs. It was indeed 2 hours off, simple time correction fixed it. I'm running Python 2.6 on android, which might actually be the reason the new VideoSort with the new guessit library doesn't work too well, seems like support for python 2.6 was removed recently. Think the issues were also present prior to 08-19 but the support for python 2.6 was probably getting worse this last year anyway.

Code: Select all

Guessit history
0.10.4 (2015-08-19)
-------------------------------------------
* Remove support for python 2.6

hugbug
Developer & Admin
Posts: 7645
Joined: 09 Sep 2008, 11:58
Location: Germany

Re: [New Feature] Android installer

Post by hugbug » 15 Oct 2015, 14:28

1. Created an issue about time zone - https://github.com/nzbget/android/issues/2. Not that I'm going to work on it any time soon though.

2.
Nedle wrote:seems like support for python 2.6 was removed some time ago:
The latest VideoSort uses guessit "0.9.4" but it's possible that python 2.6 were not supported before 0.10 but the lack of support was admitted/documented only in 0.10.

3. Can you please point me to a guide for installing python on android?

4. Have you tried python3 provided on python-for-android page? I would make VideoSort-code python 3 compatible as I did EMail.py and Logger.py but guessit is a big library and it require other 5 libraries. I don't know if all or any of them work with python 3.

hugbug
Developer & Admin
Posts: 7645
Joined: 09 Sep 2008, 11:58
Location: Germany

Re: [New Feature] Android installer

Post by hugbug » 15 Oct 2015, 14:40

5. Have you tried this python 2.7 build ?

Nedle
Posts: 49
Joined: 06 Aug 2014, 10:24

Re: [New Feature] Android installer

Post by Nedle » 16 Oct 2015, 08:21

1. Doesn't seem to be much interest in the android version so I understand that priority is low. However, an android device such as a nexus player, fireTV seem to be quite well suited for running as a cheap NAS. My FireTV has a HDD attached to it which is shared to the network, downloads and sorts all my media and also runs kodi.

2. Yeah that was what I figured too.

3. Honestly it is usually just installing an android APK which has python embedded into it.

4. Nope, only need python for the PP-scripts and python3 wasn't supported so never bothered with it.

5. Yeah I have tried that before, and just did again. It does run on android and VideoSort 6.1 now works properly, however I'm getting a bunch of warnings with this version:

Code: Select all

Fri Oct 16 10:04:06 2015	INFO	VideoSort61: WARNING: linker: libpython2.7.so has text relocations. This is wasting memory and prevents security hardening. Please fix.
Fri Oct 16 10:04:07 2015	INFO	VideoSort61: WARNING: linker: _collections.so has text relocations. This is wasting memory and prevents security hardening. Please fix.
Fri Oct 16 10:04:07 2015	INFO	VideoSort61: WARNING: linker: operator.so has text relocations. This is wasting memory and prevents security hardening. Please fix.
Fri Oct 16 10:04:07 2015	INFO	VideoSort61: WARNING: linker: itertools.so has text relocations. This is wasting memory and prevents security hardening. Please fix.
Fri Oct 16 10:04:07 2015	INFO	VideoSort61: WARNING: linker: _bisect.so has text relocations. This is wasting memory and prevents security hardening. Please fix.
Fri Oct 16 10:04:07 2015	INFO	VideoSort61: WARNING: linker: _heapq.so has text relocations. This is wasting memory and prevents security hardening. Please fix.
Fri Oct 16 10:04:07 2015	INFO	VideoSort61: WARNING: linker: time.so has text relocations. This is wasting memory and prevents security hardening. Please fix.
Fri Oct 16 10:04:07 2015	INFO	VideoSort61: WARNING: linker: strop.so has text relocations. This is wasting memory and prevents security hardening. Please fix.
Fri Oct 16 10:04:07 2015	INFO	VideoSort61: WARNING: linker: _functools.so has text relocations. This is wasting memory and prevents security hardening. Please fix.
Fri Oct 16 10:04:07 2015	INFO	VideoSort61: WARNING: linker: _struct.so has text relocations. This is wasting memory and prevents security hardening. Please fix.
Fri Oct 16 10:04:07 2015	INFO	VideoSort61: WARNING: linker: _json.so has text relocations. This is wasting memory and prevents security hardening. Please fix.
Fri Oct 16 10:04:07 2015	INFO	VideoSort61: WARNING: linker: binascii.so has text relocations. This is wasting memory and prevents security hardening. Please fix.
Fri Oct 16 10:04:07 2015	INFO	VideoSort61: WARNING: linker: datetime.so has text relocations. This is wasting memory and prevents security hardening. Please fix.
Fri Oct 16 10:04:07 2015	INFO	VideoSort61: WARNING: linker: cStringIO.so has text relocations. This is wasting memory and prevents security hardening. Please fix.
Fri Oct 16 10:04:07 2015	INFO	VideoSort61: WARNING: linker: unicodedata.so has text relocations. This is wasting memory and prevents security hardening. Please fix.
Fri Oct 16 10:04:08 2015	INFO	VideoSort61: WARNING: linker: _io.so has text relocations. This is wasting memory and prevents security hardening. Please fix.
Fri Oct 16 10:04:08 2015	INFO	VideoSort61: WARNING: linker: zlib.so has text relocations. This is wasting memory and prevents security hardening. Please fix.
Fri Oct 16 10:04:08 2015	INFO	VideoSort61: WARNING: linker: _socket.so has text relocations. This is wasting memory and prevents security hardening. Please fix.
Fri Oct 16 10:04:08 2015	INFO	VideoSort61: WARNING: linker: libcrypto.so has text relocations. This is wasting memory and prevents security hardening. Please fix.
Fri Oct 16 10:04:08 2015	INFO	VideoSort61: WARNING: linker: libssl.so has text relocations. This is wasting memory and prevents security hardening. Please fix.
Fri Oct 16 10:04:08 2015	INFO	VideoSort61: WARNING: linker: _ssl.so has text relocations. This is wasting memory and prevents security hardening. Please fix.
To try any of this yourself install an *.apk with python embedded into it, the python files will be a /data/data/<package name>. For python2.7, the one you linked they have uploaded an example apk here:
https://code.google.com/p/android-pytho ... loads/list
The wiki also explains also how you can run it from shell, which is what I use to use to run the python PP-scripts.

Python 2.6 for android can be found here, I've been using PythonForAndroid_r5.apk:
https://code.google.com/p/python-for-an ... loads/list

When I was googling this yesterday I also found someone who compiled static python for android:
http://forum.xda-developers.com/android ... 2-t2958679

This is a flashable *.zip and you can just run python after that from shell as python will be installed to /system/python and the executables are placed in /system/bin. Just tested and this also works well with VideoSort 6.1. However name resolution doesn't work for this version. Tried opening some websites using urllib and always get the same error, <Name or service not known>. Someone reported it in his thread as well and the creator suggests a fix by adding a line to /system/etc/resolv.conf but that didn't fix anything for me.

hugbug
Developer & Admin
Posts: 7645
Joined: 09 Sep 2008, 11:58
Location: Germany

Re: [New Feature] Android installer

Post by hugbug » 16 Oct 2015, 08:48

Thanks for all the info.

An unrelated question: do you need to use IP for news servers in NZBGet or domain names work?

Nedle
Posts: 49
Joined: 06 Aug 2014, 10:24

Re: [New Feature] Android installer

Post by Nedle » 16 Oct 2015, 12:04

Had to use IPs

Nedle
Posts: 49
Joined: 06 Aug 2014, 10:24

Re: [New Feature] Android installer

Post by Nedle » 16 Oct 2015, 19:50

On lollipop editing libdaemon.so persist through a reboot, however on my FireTV running kitkat it doesn't persist through a reboot.

Lollipop it is at: /data/app/net.net.nzbget-1/lib/arm/libdaemon.so
Kitkat it is at: /data/app-lib/net.nzbget.nzbget-1 or /data/data/net.nzbget.nzbget/lib/libdaemon.so (they are linked)

hugbug
Developer & Admin
Posts: 7645
Joined: 09 Sep 2008, 11:58
Location: Germany

Re: [New Feature] Android installer

Post by hugbug » 16 Oct 2015, 19:57

How is this possible? That would mean the system stores the original files or the whole apk somewhere and restores from it? This is unlikely.

Nedle
Posts: 49
Joined: 06 Aug 2014, 10:24

Re: [New Feature] Android installer

Post by Nedle » 16 Oct 2015, 20:11

hugbug wrote:How is this possible? That would mean the system stores the original files or the whole apk somewhere and restores from it? This is unlikely.
Not quite sure, changing the permissions didn't work either. On lollipop /data/app contains folders with the package of the corresponding app as name, inside is base.apk and the lib folder which contains libdaemon.so. On kitkat /data/app only contains the apks of all the apps, so it might use that apk to restore the libdaemon file in /data/app-lib?

Post Reply

Who is online

Users browsing this forum: No registered users and 12 guests