diff -r ../pyradio_src/debian/changelog ./debian/changelog
1,6d0
< pyradio (4.3) fremantle; urgency=low
< 
<   * Major work to Pandora backend.  Uses SSL authentication and proper decryption.  Auto-updates crypto-keys from pianobar.
< 
<  -- FatalSaint <maemo@linuxniche.com>  Thu, 10 Nov 2011 09:00:00 -0700
< 
21c15
---
diff -r ../pyradio_src/debian/control ./debian/control
10c10
< Depends: pyside-qt4-core, pyside-qt4-gui, pyside-qt4-webkit, python-pyside.qtnetwork, python-pyside.qtcore, python-pyside.qtwebkit
---
> Depends: python2.5-qt4-core, python2.5-qt4-gui, python2.5-qt4-webkit, python2.5-qt4-dbus, python2.5-qt4-network
Only in ../pyradio_src/debian: postinst
diff -r ../pyradio_src/debian/rules ./debian/rules
93d92
< 	chmod a+rw "$(CURDIR)/debian/pyradio/opt/pyRadio/libpiano"
diff -r ../pyradio_src/src/opt/pyRadio/images_rc.py ./src/opt/pyRadio/images_rc.py
10c10
---
diff -r ../pyradio_src/src/opt/pyRadio/libpiano/AbstractBackend.py ./src/opt/pyRadio/libpiano/AbstractBackend.py
2c2
---
diff -r ../pyradio_src/src/opt/pyRadio/libpiano/crypt.py ./src/opt/pyRadio/libpiano/crypt.py
0a1,3
> import sys
> import keys
> 
3c6
< def decryptString( strIn, key ):
---
> def decryptString( strIn, key=keys.key_in ):
7a11,16
> #	print "Decoded:"
> #	for s in dec:
> #		sys.stdout.write( "%02x" %ord(s) )
> #	sys.stdout.flush()
> #	print
> 
54c63
< def encryptString( inStr, key ):
---
> def encryptString( inStr, key=keys.key_out ):
111a121,127
> 
> 
> if __name__ == "__main__":
> 	print "In:",
> 	strIn = raw_input()
> 
> 	print encryptString( strIn )
diff -r ../pyradio_src/src/opt/pyRadio/libpiano/keys.py ./src/opt/pyRadio/libpiano/keys.py
1,2d0
< import urllib2
< import pickle
4,5d1
< import os
< import sys
7,10c3,4
< BASE_KEY_URL = "https://raw.github.com/PromyLOPh/pianobar/master/src/libpiano/"
< 
< class Key:
< 	def __init__( self, proto, key ):
---
> class KeyFile:
> 	def __init__( self, fname ):
12,13c6
< 		( n, p, s ) = key
< 		self._proto = proto
---
> 		( n, p, s ) = pianoparser.parse_file( fname )
21,129c14,15
< 	def _toDict( self ):
< 		return { 'proto' : self._proto,
< 				 'key' : (self._key['n'],self._key['p'],self._key['s']) }
< 
< class Keys:
< 	_keys = None
< 
< 	def __init__( self, dataDir, proto ):
< 		self._proto = proto
< 		self._dataDir = dataDir
< 		self._keys = {}
< 
< 	def __getitem__( self, key ):
< 		return self._keys[key]
< 
< 	def loadKeys( self, save=True ):
< 		fromFile = 0
< 		key_in = self._loadKeyFromFile( os.path.join( self._dataDir,\
< 													  "key_in" ) )
< 		if key_in and key_in._proto == self._proto:
< 			fromFile += 1
< 		else:
< 			key_in = self._loadKeyFromURL( BASE_KEY_URL + \
< 										  "crypt_key_input.h" )
< 			if key_in:
< 				key_in = Key( self._proto, key_in )
< 			else:
< 				print "PANDORA: No valid Input key"
< 				return False
< 
< 		key_out = self._loadKeyFromFile( os.path.join( self._dataDir,\
< 													   "key_out" ) )
< 		if key_out and key_out._proto == self._proto:
< 			fromFile += 1
< 		else:
< 			key_out = self._loadKeyFromURL( BASE_KEY_URL + \
< 										  "crypt_key_output.h" )
< 			if key_out:
< 				key_out = Key( self._proto, key_out )
< 			else:
< 				print "PANDORA: No valid Output key"
< 				return False
< 
< 		self._keys['in'] = key_in
< 		self._keys['out'] = key_out
< 		if save and fromFile < 2:
< 			self.saveKeys()
< 		return True
< 
< 	def saveKeys( self ):
< 		print "PANDORA: Saving keys"
< 		f = None
< 		print "PANDORA: dataDir = \"%s\"" %self._dataDir
< 		print "PANDORA: dataDir.isDir? %s" %os.path.isdir( self._dataDir )
< 		try:
< 			f = open( os.path.join( self._dataDir, "key_in" ), "wb" )
< 			pickle.dump( self._keys['in']._toDict(), f, -1 )
< 		finally:
< 			if f: f.close()
< 
< 		try:
< 			f = open( os.path.join( self._dataDir, "key_out" ), "wb" )
< 			pickle.dump( self._keys['out']._toDict(), f, -1 )
< 		finally:
< 			if f: f.close()
< 
< 	def forceReFetch( self ):
< 		print "PANDORA: Forcing key ReDownload"
< 		if os.path.exists( os.path.join( self._dataDir, "key_in" ) ):
< 			os.remove( os.path.join( self._dataDir, "key_in" ) )
< 		if os.path.exists( os.path.join( self._dataDir, "key_out" ) ):
< 			os.remove( os.path.join( self._dataDir, "key_out" ) )
< 		return self.loadKeys( True );
< 
< 	def _loadKeyFromFile( self, keyFile ):
< 		print "PANDORA: Loading key from file \"%s\"" %keyFile
< 		if not os.path.isfile( keyFile ):
< 			return False
< 
< 		try:
< 			try:
< 				f = open( keyFile, "rb" )
< 				tmp = pickle.load( f )
< 				key = Key( tmp['proto'], tmp['key'] )
< 			except IOError, e:
< 				print "PANDORA: IOError %d:%s" %( e.errno, e.stderror )
< 				return False
< 			except pickle.UnpicklingError, e:
< 				print "PANDORA: UnpicklingError: %s" %e
< 				return False
< 			except:
< 				print "PANDORA: Unexpected error:%s:%s" %sys.exc_info()[0:2]
< 				raise
< 		finally:
< 			f.close()
< 
< 		return key
< 
< 	def _loadKeyFromURL( self, keyUrl ):
< 		print "PANDORA: Downloading key from url \"%s\"" %keyUrl
< 		try:
< 			f = urllib2.urlopen( keyUrl )
< 		except urllib2.URLError, e:
< 			print "PANDORA: URLError: %s" %e.reason
< 			return False
< 		key = pianoparser.parse_file( f )
< 		f.close()
< 		return key
< 
---
> key_out = KeyFile( "crypt_key_output.h" )
> key_in = KeyFile( "crypt_key_input.h" )
\ No newline at end of file
diff -r ../pyradio_src/src/opt/pyRadio/libpiano/pandora.py ./src/opt/pyRadio/libpiano/pandora.py
9,10d8
< import keys
< import sys
15,20d12
< class PandoraError(Exception):
< 	def __init__( self, value ):
< 		self.value = value
< 	def __str__( self ):
< 		return repr( self.value )
< 
28c20
<         base_url = "https://www.pandora.com/radio/xmlrpc/v%d?" %protocol_version
---
>         base_url = "http://www.pandora.com/radio/xmlrpc/v%d?" %protocol_version
40,41c32
< 		self.dataDir = sys.path[0]+"/libpiano/"
<                 self.base_url = "https://www.pandora.com/radio/xmlrpc/v%d?" %(self.protocol_version)
---
>                 self.base_url = "http://www.pandora.com/radio/xmlrpc/v%d?" %(self.protocol_version)
44,46d34
< 		self.keys = keys.Keys( self.dataDir, self.protocol_version )
< 		if not self.keys.loadKeys():
< 			raise PandoraError("Unable to load Keys");
77c65
<                         enc = crypt.encryptString( req, self.keys['out'] )
---
>                         enc = crypt.encryptString( req )
85c73
<                                             self.base_url = "https://www.pandora.com/radio/xmlrpc/v%d?" %(new_version)
---
>                                             self.base_url = "http://www.pandora.com/radio/xmlrpc/v%d?" %(new_version)
112c100
<                 enc = crypt.encryptString( req, self.keys['out'] )
---
>                 enc = crypt.encryptString( req )
142c130
<                 enc = crypt.encryptString( req, self.keys['out'] )
---
>                 enc = crypt.encryptString( req )
170c158
<                 enc = crypt.encryptString( req, self.keys['out'] )
---
>                 enc = crypt.encryptString( req )
195c183
<                 enc = crypt.encryptString( req, self.keys['out'] )
---
>                 enc = crypt.encryptString( req )
220c208
<                 enc = crypt.encryptString( req, self.keys['out'] )
---
>                 enc = crypt.encryptString( req )
245c233
<                 enc = crypt.encryptString( req, self.keys['out'] )
---
>                 enc = crypt.encryptString( req )
270c258
<                 enc = crypt.encryptString( req, self.keys['out'] )
---
>                 enc = crypt.encryptString( req )
296c284
<                 enc = crypt.encryptString( req, self.keys['out'] )
---
>                 enc = crypt.encryptString( req )
312c300
<                         url = url[:-48] + crypt.decryptString( url[-48:], self.keys['in'] )[:-8]
---
>                         url = url[:-48] + crypt.decryptString( url[-48:] )[:-8]
diff -r ../pyradio_src/src/opt/pyRadio/libpiano/pianoparser.py ./src/opt/pyRadio/libpiano/pianoparser.py
1a2
> import os,sys
3c4
< def parse_file( f ):
---
> def parse_file( fname ):
4a6
> 	f = open( sys.path[0]+"/libpiano/"+fname, 'r' )
26c28
< 				b = re.split( r"},\s*{", a )
---
> 				b = a.split( "}, {" )
66d67
< 
diff -r ../pyradio_src/src/opt/pyRadio/pyRadio.py ./src/opt/pyRadio/pyRadio.py
6,8c6,8
---
108a109
> 		self.stimer.singleShot(50, self.player.start)
117d117
< 		self.player.start()
diff -r ../pyradio_src/src/opt/pyRadio/pyRadio_ui_portrait.py ./src/opt/pyRadio/pyRadio_ui_portrait.py
6c6
---
10c10
---
226c226
---
diff -r ../pyradio_src/src/opt/pyRadio/pyRadio_ui.py ./src/opt/pyRadio/pyRadio_ui.py
6c6
---
10c10
---
231c231
---
diff -r ../pyradio_src/src/opt/pyRadio/radioplayer.py ./src/opt/pyRadio/radioplayer.py
5c5
---
35d34
< 		self.pandora = 0
Only in .: tmp
