diff --git a/config.py b/config.py index e987d84..49977d9 100644 --- a/config.py +++ b/config.py @@ -5,3 +5,4 @@ githubAppListRepo = 'OpenMemories-AppList' appengineServer = 'sony-pmca.appspot.com' +officialServer = 'www.playmemoriescameraapps.com' diff --git a/pmca/commands/usb.py b/pmca/commands/usb.py index 55652c9..15cbe16 100644 --- a/pmca/commands/usb.py +++ b/pmca/commands/usb.py @@ -39,7 +39,7 @@ def createMarketServer(host=None, repo=defaultAppStoreRepo, certFile=defaultCert return RemoteMarketServer(host) else: print('Using local server') - return LocalMarketServer(repo, certFile) + return LocalMarketServer(repo, certFile, config.officialServer) def listApps(host=None): diff --git a/pmca/installer/__init__.py b/pmca/installer/__init__.py index 3d8b78a..f089b4e 100644 --- a/pmca/installer/__init__.py +++ b/pmca/installer/__init__.py @@ -80,8 +80,7 @@ def install(dev, host, port, xpdData, statusFunc=None): # The camera wants us to open an SSL socket connectionId = message.connectionId sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) - if message.host != host: - raise Exception('Connecting to wrong host: %s' % message.host) + # Ignoring message.host sock.connect((host, port)) elif isinstance(message, SslSendDataMessage) and sock and message.connectionId == connectionId: # The camera wants to send data over the socket diff --git a/pmca/marketserver/server.py b/pmca/marketserver/server.py index f8f8a91..0785df1 100644 --- a/pmca/marketserver/server.py +++ b/pmca/marketserver/server.py @@ -57,11 +57,12 @@ def do_GET(self): class LocalMarketServer(HTTPServer): """A local https server to communicate with the camera""" - def __init__(self, repo, certFile, host='127.0.0.1', port=4443): + def __init__(self, repo, certFile, fakeHost, host='127.0.0.1', port=4443): HTTPServer.__init__(self, (host, port), HttpHandler) self.host = host self.port = port self.url = 'https://' + host + '/' + self.fakeUrl = 'https://' + fakeHost + '/' self.appstore = appstore.AppStore(repo) self.apk = None self.result = None @@ -84,7 +85,7 @@ def setApp(self, package): def getXpd(self): """Return the xpd contents""" - return getXpdResponse('0', self.url) + return getXpdResponse('0', self.fakeUrl) def getResult(self): """Return the result sent from the camera"""