Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(android): remove "WebViewClient.jar" from SDK #12708

Merged
merged 3 commits into from Jun 14, 2021

Conversation

jquick-axway
Copy link
Contributor

@jquick-axway jquick-axway commented Apr 8, 2021

JIRA:
https://jira.appcelerator.org/browse/TIMOB-28241

Summary:

  • This JAR was used to handle WebView client certificate requests on Android 4.x.
  • Now that Titanium's min OS version has been raised to Android 5.0, JAR is no longer needed.
  • Replaced AsyncTask with Thread since we were only using task's doInBackground() method.

Test:

  1. Build and run the below on Android.
  2. Tap on the "Download Certificate" button.
  3. Tap on the badssl.com-client.p12 link.
  4. If Android asks for a password then enter: badssl.com
  5. Go to Android's system Settings -> Security -> Advanced -> Encryption & Credentials screen.
  6. Tap on Install Certificate -> VPN & app user certificate screen.
  7. Select downloaded certificate from "Downloads" folder and install it.
  8. Note that you might need to enable a passcode/PIN on the device.
  9. Go back to the Titanium app.
  10. Tap on the "Show WebView" button.
  11. Verify an alert dialog is shown asking for a certificate.
  12. Select the installed certificate.
  13. Verify that a green webpage is shown. (A red webpage is shown if client certificate is NOT selected.)
const parentWindow = Ti.UI.createWindow();
const downloadButton = Ti.UI.createButton({
	title: "Download Certificate",
	top: "30%",
});
downloadButton.addEventListener("click", () => {
	Ti.Platform.openURL("https://badssl.com/download/");
});
parentWindow.add(downloadButton);
const webButton = Ti.UI.createButton({
	title: "Show WebView",
	bottom: "30%",
});
webButton.addEventListener("click", () => {
	const webWindow = Ti.UI.createWindow();
	webWindow.add(Ti.UI.createWebView({
		url: "https://client.badssl.com/",
		width: Ti.UI.FILL,
		height: Ti.UI.FILL,
	}));
	webWindow.open();
});
parentWindow.add(webButton);
parentWindow.open();

@jquick-axway jquick-axway added this to the 10.1.0 milestone Apr 8, 2021
@jquick-axway jquick-axway added the backport 10_2_X when applied, PRs with this label will get an auto-generated backport to 10_2_X branch on merge label Apr 8, 2021
@build build requested a review from a team April 8, 2021 21:24
@build
Copy link
Contributor

build commented Apr 8, 2021

Messages
📖 ✊ The commits in this PR match our conventions! Feel free to Rebase and Merge this PR when ready.
📖

✅ All tests are passing
Nice one! All 14414 tests are passing.
(There are 961 skipped tests not included in that total)

📖

💾 Here's the generated SDK zipfile.

📖 👍 Hey!, You deleted more code than you added. That's awesome!

Generated by 🚫 dangerJS against 909e807

Copy link
Contributor

@garymathews garymathews left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CR: PASS

@lokeshchdhry
Copy link
Contributor

FR Passed.

@sgtcoolguy sgtcoolguy merged commit 06c232e into tidev:master Jun 14, 2021
@build build removed the backport 10_2_X when applied, PRs with this label will get an auto-generated backport to 10_2_X branch on merge label Jun 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants