Skip to content

Commit 8fa9495

Browse files
authored
Merge pull request TeamNewPipe#8769 from Isira-Seneviratne/New_Utils_methods
Use new NPE UTF8 Utils methods
2 parents 7454b31 + 7988fe0 commit 8fa9495

3 files changed

Lines changed: 6 additions & 7 deletions

File tree

app/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ dependencies {
187187
// name and the commit hash with the commit hash of the (pushed) commit you want to test
188188
// This works thanks to JitPack: https://jitpack.io/
189189
implementation 'com.github.TeamNewPipe:nanojson:1d9e1aea9049fc9f85e68b43ba39fe7be1c1f751'
190-
implementation 'com.github.TeamNewPipe:NewPipeExtractor:eb07d70a2ce03bee3cc74fc33b2e4173e1c21436'
190+
implementation 'com.github.TeamNewPipe:NewPipeExtractor:2211a24b6934a8a8cdf5547ea1b52daa4cb5de6c'
191191
implementation 'com.github.TeamNewPipe:NoNonsense-FilePicker:5.0.0'
192192

193193
/** Checkstyle **/

app/src/main/java/org/schabi/newpipe/error/ReCaptchaActivity.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,14 @@
2020
import androidx.core.app.NavUtils;
2121
import androidx.preference.PreferenceManager;
2222

23-
import org.schabi.newpipe.databinding.ActivityRecaptchaBinding;
2423
import org.schabi.newpipe.DownloaderImpl;
2524
import org.schabi.newpipe.MainActivity;
2625
import org.schabi.newpipe.R;
26+
import org.schabi.newpipe.databinding.ActivityRecaptchaBinding;
27+
import org.schabi.newpipe.extractor.utils.Utils;
2728
import org.schabi.newpipe.util.ThemeHelper;
2829

2930
import java.io.UnsupportedEncodingException;
30-
import java.net.URLDecoder;
3131

3232
/*
3333
* Created by beneth <bmauduit@beneth.fr> on 06.12.16.
@@ -188,7 +188,7 @@ private void handleCookiesFromUrl(@Nullable final String url) {
188188

189189
try {
190190
String abuseCookie = url.substring(abuseStart + 13, abuseEnd);
191-
abuseCookie = URLDecoder.decode(abuseCookie, "UTF-8");
191+
abuseCookie = Utils.decodeUrlUtf8(abuseCookie);
192192
handleCookies(abuseCookie);
193193
} catch (UnsupportedEncodingException | StringIndexOutOfBoundsException e) {
194194
if (MainActivity.DEBUG) {

app/src/main/java/org/schabi/newpipe/settings/DownloadSettingsFragment.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package org.schabi.newpipe.settings;
22

3+
import static org.schabi.newpipe.extractor.utils.Utils.decodeUrlUtf8;
34
import static org.schabi.newpipe.util.Localization.assureCorrectAppLanguage;
45

56
import android.app.Activity;
@@ -31,8 +32,6 @@
3132
import java.io.IOException;
3233
import java.io.UnsupportedEncodingException;
3334
import java.net.URI;
34-
import java.net.URLDecoder;
35-
import java.nio.charset.StandardCharsets;
3635

3736
public class DownloadSettingsFragment extends BasePreferenceFragment {
3837
public static final boolean IGNORE_RELEASE_ON_OLD_PATH = true;
@@ -125,7 +124,7 @@ private void showPathInSummary(final String prefKey, @StringRes final int defaul
125124
}
126125

127126
try {
128-
rawUri = URLDecoder.decode(rawUri, StandardCharsets.UTF_8.name());
127+
rawUri = decodeUrlUtf8(rawUri);
129128
} catch (final UnsupportedEncodingException e) {
130129
// nothing to do
131130
}

0 commit comments

Comments
 (0)