Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
IBMS
/
nativeview
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
c1e613a1
authored
Mar 01, 2022
by
huangzhicong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
现在base64不再进行编码转换了
parent
6b2485ff
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
3 deletions
+2
-3
app/src/main/java/com/maxrocky/nativeview/WebViewProxy.kt
+2
-3
No files found.
app/src/main/java/com/maxrocky/nativeview/WebViewProxy.kt
View file @
c1e613a1
...
...
@@ -14,7 +14,6 @@ import com.maxrocky.nativeview.model.Result
import
kotlinx.coroutines.Dispatchers
import
kotlinx.coroutines.launch
import
kotlinx.coroutines.withContext
import
java.net.URLEncoder
class
WebViewProxy
(
private
val
fragment
:
Fragment
,
...
...
@@ -76,7 +75,7 @@ class WebViewProxy(
val
bytes
=
ByteArray
(
this
.
available
())
this
.
read
(
bytes
)
val
base64
=
Base64
.
encodeToString
(
bytes
,
Base64
.
DEFAULT
)
val
encodeBase64
=
"$encoder;base64,$
{URLEncoder.encode(base64, "
UTF
-
8
")}
"
val
encodeBase64
=
"$encoder;base64,$
base64
"
val
data
=
MediaResult
(
uri
.
toString
(),
encodeBase64
)
withContext
(
Dispatchers
.
Main
)
{
success
(
method
,
result
,
data
)
}
}.
onFailure
{
...
...
@@ -105,7 +104,7 @@ class WebViewProxy(
val
bytes
=
ByteArray
(
this
.
available
())
this
.
read
(
bytes
)
val
base64
=
Base64
.
encodeToString
(
bytes
,
Base64
.
DEFAULT
)
val
encodeBase64
=
"$encoder;base64,$
{URLEncoder.encode(base64, "
UTF
-
8
")}
"
val
encodeBase64
=
"$encoder;base64,$
base64
"
return
@runCatching
MediaResult
(
it
.
toString
(),
encodeBase64
)
}.
getOrNull
()
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment