calculate android esn
authorpeak3d <pfau@peak3d.de>
Wed, 19 Jul 2017 15:38:51 +0000 (17:38 +0200)
committerpeak3d <pfau@peak3d.de>
Wed, 19 Jul 2017 15:38:51 +0000 (17:38 +0200)
addon.xml
resources/lib/NetflixSession.py

index 6fb3a89385b6d669020a48bfac9c5bcd275c8391..d26c343867cbb768b3970adebc70da1e096e66a9 100644 (file)
--- a/addon.xml
+++ b/addon.xml
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
 <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
-<addon id="plugin.video.netflix" name="Netflix" version="0.11.14" provider-name="libdev + jojo + asciidisco">
+<addon id="plugin.video.netflix" name="Netflix" version="0.11.15" provider-name="libdev + jojo + asciidisco">
   <requires>
     <import addon="xbmc.python" version="2.24.0"/>
     <import addon="script.module.beautifulsoup4" version="4.3.2"/>
   <requires>
     <import addon="xbmc.python" version="2.24.0"/>
     <import addon="script.module.beautifulsoup4" version="4.3.2"/>
index d2be1cdd9ba7ea92dfa7a318e9a0dcba510d25ef..ca4bd5cc0272449d88bfaaf71a96ce508b17acb4 100644 (file)
@@ -2299,11 +2299,29 @@ class NetflixSession:
             :obj:`str` of :obj:`str
             ESN, something like: NFCDCH-MC-D7D6F54LOPY8J416T72MQXX3RD20ME
         """
             :obj:`str` of :obj:`str
             ESN, something like: NFCDCH-MC-D7D6F54LOPY8J416T72MQXX3RD20ME
         """
-        esn = ''
+        # we generate an esn from device strings for android
+        import subprocess
+        manufacturer = subprocess.check_output(["/system/bin/getprop", "ro.product.manufacturer"])
+
+        if manufacturer :
+            esn = 'NFANDROID1-PRV-'
+            input = subprocess.check_output(["/system/bin/getprop", "ro.nrdp.modelgroup"])
+            if not input:
+                esn = esn + 'T-L3-'
+            else:
+                esn = esn + input.strip(' \t\n\r') + '-'
+            esn = esn + '{:5}'.format(manufacturer.strip(' \t\n\r').upper())
+            input = subprocess.check_output(["/system/bin/getprop" ,"ro.product.model"])
+            esn = esn + input.strip(' \t\n\r').replace(' ', '=').upper()
+            self.log(msg='Android generated ESN:' + esn)
+            return esn
+
         # values are accessible via dict (sloppy parsing successfull)
         if type(netflix_page_data) == dict:
             return netflix_page_data.get('esn', '')
 
         # values are accessible via dict (sloppy parsing successfull)
         if type(netflix_page_data) == dict:
             return netflix_page_data.get('esn', '')
 
+        esn = ''
+
         # values are stored in lists (returned from JS parser)
         for item in netflix_page_data:
             if 'esnGeneratorModel' in dict(item).keys():
         # values are stored in lists (returned from JS parser)
         for item in netflix_page_data:
             if 'esnGeneratorModel' in dict(item).keys():