mirror of
https://github.com/CatimaLoyalty/Android.git
synced 2026-04-29 03:32:50 -04:00
Fix share/import URL crash on Android 6
This commit is contained in:
@@ -1,10 +1,11 @@
|
||||
# Changelog
|
||||
|
||||
## Unreleased
|
||||
## v2.0.1 (2021-07-21)
|
||||
|
||||
Changes:
|
||||
|
||||
- Several minor translation and UI fixes
|
||||
- Fix crash in import/sharing loyalty card on Android 6
|
||||
|
||||
## v2.0 (2021-07-14)
|
||||
|
||||
|
||||
@@ -18,8 +18,8 @@ android {
|
||||
applicationId "me.hackerchick.catima"
|
||||
minSdkVersion 19
|
||||
targetSdkVersion 30
|
||||
versionCode 70
|
||||
versionName "2.0"
|
||||
versionCode 71
|
||||
versionName "2.0.1"
|
||||
|
||||
vectorDrawables.useSupportLibrary true
|
||||
}
|
||||
|
||||
@@ -12,6 +12,7 @@ import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.io.OutputStreamWriter;
|
||||
import java.nio.charset.Charset;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
|
||||
import protect.card_locker.importexport.DataFormat;
|
||||
import protect.card_locker.importexport.ImportExportResult;
|
||||
@@ -76,7 +77,7 @@ class ImportExportTask extends AsyncTask<Void, Void, ImportExportResult>
|
||||
|
||||
try
|
||||
{
|
||||
OutputStreamWriter writer = new OutputStreamWriter(stream, Charset.forName("UTF-8"));
|
||||
OutputStreamWriter writer = new OutputStreamWriter(stream, StandardCharsets.UTF_8);
|
||||
result = MultiFormatExporter.exportData(context, db, stream, format);
|
||||
writer.close();
|
||||
}
|
||||
|
||||
@@ -83,7 +83,7 @@ public class ImportURIHelper {
|
||||
if (fragment != null) {
|
||||
for (String fragmentPart : fragment.split("&")) {
|
||||
String[] fragmentData = fragmentPart.split("=", 2);
|
||||
kv.put(fragmentData[0], URLDecoder.decode(fragmentData[1], StandardCharsets.UTF_8.toString()));
|
||||
kv.put(fragmentData[0], URLDecoder.decode(fragmentData[1], StandardCharsets.UTF_8.name()));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -134,7 +134,7 @@ public class ImportURIHelper {
|
||||
}
|
||||
|
||||
// Double-encode the value to make sure it can't accidentally contain symbols that'll break the parser
|
||||
fragment.append(key).append("=").append(URLEncoder.encode(value, StandardCharsets.UTF_8.toString()));
|
||||
fragment.append(key).append("=").append(URLEncoder.encode(value, StandardCharsets.UTF_8.name()));
|
||||
|
||||
return fragment;
|
||||
}
|
||||
|
||||
@@ -18,7 +18,7 @@ import java.nio.charset.StandardCharsets;
|
||||
public class ZipUtils {
|
||||
static public String read(ZipInputStream zipInputStream) throws IOException {
|
||||
StringBuilder stringBuilder = new StringBuilder();
|
||||
Reader reader = new BufferedReader(new InputStreamReader(zipInputStream, Charset.forName(StandardCharsets.UTF_8.name())));
|
||||
Reader reader = new BufferedReader(new InputStreamReader(zipInputStream, StandardCharsets.UTF_8));
|
||||
int c;
|
||||
while ((c = reader.read()) != -1) {
|
||||
stringBuilder.append((char) c);
|
||||
|
||||
Reference in New Issue
Block a user