Set WebView proxy to 0.0.0.0 when possible (#2539)

* Set WebView proxy to 0.0.0.0 when possible

* add DcHttpResponse to wrapper

* use new DcHttpResponse to show images in email-html-view

* null-encoding is fine for WebResourceResponse()

---------

Co-authored-by: B. Petersen <r10s@b44t.com>
This commit is contained in:
link2xt 2023-04-20 19:30:19 +00:00 committed by GitHub
parent f130336c2f
commit 0e657eed56
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 146 additions and 0 deletions

View file

@ -0,0 +1,22 @@
package com.b44t.messenger;
public class DcHttpResponse {
public DcHttpResponse(long httpResponseCPtr) {
this.httpResponseCPtr = httpResponseCPtr;
}
@Override protected void finalize() throws Throwable {
super.finalize();
unrefHttpResponseCPtr();
httpResponseCPtr = 0;
}
public native String getMimetype ();
public native String getEncoding ();
public native byte[] getBlob ();
// working with raw c-data
private long httpResponseCPtr; // CAVE: the name is referenced in the JNI
private native void unrefHttpResponseCPtr();
}