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

Set WebView proxy to 0.0.0.0 when possible #2539

Merged
merged 4 commits into from
Apr 20, 2023
Merged

Conversation

link2xt
Copy link
Contributor

@link2xt link2xt commented Apr 9, 2023

requires deltachat/deltachat-core-rust#4339 to be checked out at jni/deltachat-core-rust

@github-actions
Copy link

github-actions bot commented Apr 9, 2023

To test the changes in this pull request, install this apk:
📦 app-preview.apk

@link2xt
Copy link
Contributor Author

link2xt commented Apr 9, 2023

There is a good stackoverflow answer below the accepted one: https://stackoverflow.com/a/66099012/21313424
androidx.webkit documentation is at
https://developer.android.com/reference/androidx/webkit/package-summary

@link2xt link2xt marked this pull request as draft April 9, 2023 16:13
@link2xt
Copy link
Contributor Author

link2xt commented Apr 9, 2023

Converted to draft: this breaks loading remote images in HTML view. So we should restore the settings there.

But first need to confirm that this proxy setting is useful for anything.

@link2xt link2xt closed this Apr 12, 2023
@r10s r10s reopened this Apr 19, 2023
@github-actions
Copy link

To test the changes in this pull request, install this apk:
📦 app-preview.apk

@hpk42
Copy link
Contributor

hpk42 commented Apr 20, 2023

To test the changes in this pull request, install this apk: package app-preview.apk

this apk reliably works in my testing.

@r10s r10s marked this pull request as ready for review April 20, 2023 13:43
@link2xt
Copy link
Contributor Author

link2xt commented Apr 20, 2023

Release v1.112.8 of the core containing necessary API is ready.

@r10s
Copy link
Member

r10s commented Apr 20, 2023

Release v1.112.8 of the core containing necessary API is ready.

thanks! i pulled that on android-master and rebased this pr, so there should be a fresh app-preview.apk soon.

@github-actions
Copy link

To test the changes in this pull request, install this apk:
📦 app-preview.apk

Copy link
Member

@r10s r10s left a comment

Choose a reason for hiding this comment

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

i also checked setProxyOverride() docs, this lgtm :)

Copy link
Contributor Author

@link2xt link2xt left a comment

Choose a reason for hiding this comment

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

LGTM

res = new WebResourceResponse(mimeType, httpResponse.getEncoding(), new ByteArrayInputStream(httpResponse.getBlob()));
} catch (Exception e) {
e.printStackTrace();
res = new WebResourceResponse("text/plain", "UTF-8", new ByteArrayInputStream(("Error: " + e.getMessage()).getBytes()));
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 possible to return an actual error status code, but this is fine too.

@r10s r10s merged commit 0e657ee into master Apr 20, 2023
@r10s r10s deleted the link2xt/webview-proxy branch April 20, 2023 19:30
@link2xt link2xt mentioned this pull request Apr 22, 2023
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants