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

v2.8.6: Android API 30 compatibility #25

Merged
merged 1 commit into from
Jun 22, 2021

Conversation

bmeike
Copy link
Contributor

@bmeike bmeike commented Jun 22, 2021

The Android cert verification process calls, by reflection, a completely non-standard method.

I've added that method and refactored the standard method, so that both use the same code to either defer to the default, or to use the CBL checks.

Also, AsyncTasks have been deprecated in v30. The Executor that powered them is no longer useful for CBL. I've replaced it with a small, internal execution service.

Any other changes are just things to get the test code to run

@bmeike bmeike requested review from pasin and borrrden June 22, 2021 19:37
Copy link
Contributor

@pasin pasin left a comment

Choose a reason for hiding this comment

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

Look good to me. Have one question about the manifest file just for understanding.

android:label="@string/app_name"
android:usesCleartextTraffic="true"
/>
</manifest>
Copy link
Contributor

Choose a reason for hiding this comment

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

There is also the same file in android/androidTest folder. What is the purpose of this one and the other one in androidTest folder?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah... that's mysterious. Android builds the debug flavor of the library, for testing. It then builds an entirely different application that contains the tests. Both of those applications need to allow clear text traffic, in order for the tests (which use cleartext most fo the time) to pass.

@@ -63,7 +62,7 @@ private CancellableTask(@NonNull Handler handler, @NonNull Runnable task) {
// Constructor
//---------------------------------------------
public AndroidExecutionService() {
super((ThreadPoolExecutor) AsyncTask.THREAD_POOL_EXECUTOR);
super(new CBLExecutor());
Copy link
Contributor

Choose a reason for hiding this comment

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

Oh, it's good to know that the AsyncTask is not deprecated!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It is deprecated! It is not backed by a SynchronousQueue (a queue with max size 1!). That makes it pretty unusable (as was the intention) for people like us.

@bmeike bmeike merged commit cc8c7d8 into android/release/hydrogen Jun 22, 2021
@bmeike bmeike deleted the android/candidate/2.8.6 branch June 22, 2021 23:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants