diff --git a/app/src/main/java/com/limelight/Game.java b/app/src/main/java/com/limelight/Game.java index eafcdbce..f05d7dd1 100644 --- a/app/src/main/java/com/limelight/Game.java +++ b/app/src/main/java/com/limelight/Game.java @@ -168,6 +168,7 @@ public class Game extends Activity implements SurfaceHolder.Callback, public static final String EXTRA_HOST = "Host"; public static final String EXTRA_PORT = "Port"; + public static final String EXTRA_HTTPS_PORT = "HttpsPort"; public static final String EXTRA_APP_NAME = "AppName"; public static final String EXTRA_APP_ID = "AppId"; public static final String EXTRA_UNIQUEID = "UniqueId"; @@ -314,6 +315,7 @@ public class Game extends Activity implements SurfaceHolder.Callback, String host = Game.this.getIntent().getStringExtra(EXTRA_HOST); int port = Game.this.getIntent().getIntExtra(EXTRA_PORT, NvHTTP.DEFAULT_HTTP_PORT); + int httpsPort = Game.this.getIntent().getIntExtra(EXTRA_HTTPS_PORT, 0); // 0 is treated as unknown int appId = Game.this.getIntent().getIntExtra(EXTRA_APP_ID, StreamConfiguration.INVALID_APP_ID); String uniqueId = Game.this.getIntent().getStringExtra(EXTRA_UNIQUEID); String uuid = Game.this.getIntent().getStringExtra(EXTRA_PC_UUID); @@ -477,7 +479,7 @@ public class Game extends Activity implements SurfaceHolder.Callback, // Initialize the connection conn = new NvConnection(getApplicationContext(), new ComputerDetails.AddressTuple(host, port), - uniqueId, config, + httpsPort, uniqueId, config, PlatformBinding.getCryptoProvider(this), serverCert, needsInputBatching); controllerHandler = new ControllerHandler(this, conn, this, prefConfig); diff --git a/app/src/main/java/com/limelight/nvstream/ConnectionContext.java b/app/src/main/java/com/limelight/nvstream/ConnectionContext.java index 0bbf5918..af6d0b57 100644 --- a/app/src/main/java/com/limelight/nvstream/ConnectionContext.java +++ b/app/src/main/java/com/limelight/nvstream/ConnectionContext.java @@ -8,6 +8,7 @@ import javax.crypto.SecretKey; public class ConnectionContext { public ComputerDetails.AddressTuple serverAddress; + public int httpsPort; public X509Certificate serverCert; public StreamConfiguration streamConfig; public NvConnectionListener connListener; diff --git a/app/src/main/java/com/limelight/nvstream/NvConnection.java b/app/src/main/java/com/limelight/nvstream/NvConnection.java index ccc0a5e4..9e2e9f2f 100644 --- a/app/src/main/java/com/limelight/nvstream/NvConnection.java +++ b/app/src/main/java/com/limelight/nvstream/NvConnection.java @@ -43,7 +43,6 @@ import com.limelight.nvstream.jni.MoonBridge; public class NvConnection { // Context parameters - private ComputerDetails.AddressTuple host; private LimelightCryptoProvider cryptoProvider; private String uniqueId; private ConnectionContext context; @@ -58,21 +57,22 @@ public class NvConnection { private short relMouseX, relMouseY, relMouseWidth, relMouseHeight; private short absMouseX, absMouseY, absMouseWidth, absMouseHeight; - public NvConnection(Context appContext, ComputerDetails.AddressTuple host, String uniqueId, StreamConfiguration config, LimelightCryptoProvider cryptoProvider, X509Certificate serverCert, boolean batchMouseInput) + public NvConnection(Context appContext, ComputerDetails.AddressTuple host, int httpsPort, String uniqueId, StreamConfiguration config, LimelightCryptoProvider cryptoProvider, X509Certificate serverCert, boolean batchMouseInput) { this.appContext = appContext; - this.host = host; this.cryptoProvider = cryptoProvider; this.uniqueId = uniqueId; this.batchMouseInput = batchMouseInput; this.context = new ConnectionContext(); + this.context.serverAddress = host; + this.context.httpsPort = httpsPort; this.context.streamConfig = config; this.context.serverCert = serverCert; // This is unique per connection this.context.riKey = generateRiAesKey(); - context.riKeyId = generateRiKeyId(); + this.context.riKeyId = generateRiKeyId(); this.isMonkey = ActivityManager.isUserAMonkey(); } @@ -253,7 +253,7 @@ public class NvConnection { private boolean startApp() throws XmlPullParserException, IOException { - NvHTTP h = new NvHTTP(context.serverAddress, 0, uniqueId, context.serverCert, cryptoProvider); + NvHTTP h = new NvHTTP(context.serverAddress, context.httpsPort, uniqueId, context.serverCert, cryptoProvider); String serverInfo = h.getServerInfo(); @@ -415,7 +415,6 @@ public class NvConnection { String appName = context.streamConfig.getApp().getAppName(); - context.serverAddress = host; context.connListener.stageStarting(appName); try { diff --git a/app/src/main/java/com/limelight/utils/ServerHelper.java b/app/src/main/java/com/limelight/utils/ServerHelper.java index 86bf4528..9914e653 100644 --- a/app/src/main/java/com/limelight/utils/ServerHelper.java +++ b/app/src/main/java/com/limelight/utils/ServerHelper.java @@ -58,6 +58,7 @@ public class ServerHelper { Intent intent = new Intent(parent, Game.class); intent.putExtra(Game.EXTRA_HOST, computer.activeAddress.address); intent.putExtra(Game.EXTRA_PORT, computer.activeAddress.port); + intent.putExtra(Game.EXTRA_HTTPS_PORT, computer.httpsPort); intent.putExtra(Game.EXTRA_APP_NAME, app.getAppName()); intent.putExtra(Game.EXTRA_APP_ID, app.getAppId()); intent.putExtra(Game.EXTRA_APP_HDR, app.isHdrSupported());