• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps Webview HTTPS Bypass Theory ( Needs a little help )

Ryanteck

Member
Hi

i have a webview application that i am developing a solution to an https error i have.
I know that WebView dont support HTTPS but the normal android browser dose work so i started to work on the idea of it opening the https page in the browser then after people could go back to the application.

so far i found the following code that detects the website link and only allows this url to work.

Code:
lass MyWebViewClient extends WebViewClient {
	
	public boolean shouldOverrideUrlLoading(WebView view, String url) {
		// Check if page is trying to connect to an https page
				if (Uri.parse(url).getHost().equals("http://example.com")){
				
					return false;
					
				}
				Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(url));
				startActivity(intent);
				return true;
			}

	private void startActivity(Intent intent) {
		// TODO Auto-generated method stub
		
		
	}
	
}


So why not reverse the detection to
Code:
lass MyWebViewClient extends WebViewClient {
	
	public boolean shouldOverrideUrlLoading(WebView view, String url) {
		// Check if page is trying to connect to an https page
				if (Uri.parse(url).getHost().contains("https://")){
				// run code if detected
// This is where i need help with a popup code
					return false;
					
				}
//run code if not detected
				
				return true;
			}

	private void startActivity(Intent intent) {
		// TODO Auto-generated method stub
		
		
	}
	
}

so if someone knows how to make that url to then open up in a new website window then it would work perfect so then it detects anything conntaining https and opens it up in a new window.

Thanks ryan
 
When I'm using WebView, am getting blank page. I've set uses-permission to INTERNET in manifest.xml but even then am getting a blank page. Any help is highly appreciated.
 
WebView wv = new WebView(this);
setContentView(wv);
wv.getSettings().setJavaScriptEnabled(true);​
wv.loadUrl(url);

is the code I've written.
 
Back
Top Bottom