Skip to content

Commit 3ade2bb

Browse files
committed
Merge remote-tracking branch 'origin/dev' into notifications
2 parents fd11559 + 4fc9443 commit 3ade2bb

148 files changed

Lines changed: 1999 additions & 502 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

README.es.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<h2 align="center"><b>NewPipe</b></h2>
33
<h4 align="center">Una interfaz de streaming ligera y libre para Android.</h4>
44

5-
<p align="center"><a href="https://f-droid.org/packages/org.schabi.newpipe/"><img src="https://fdroid.gitlab.io/artwork/badge/get-it-on-es.svg"></a></p>
5+
<p align="center"><a href="https://f-droid.org/packages/org.schabi.newpipe/"><img src="https://fdroid.gitlab.io/artwork/badge/get-it-on-es.svg" alt="Get it on F-Droid" height=80/></a></p>
66

77
<p align="center">
88
<a href="https://github.com/TeamNewPipe/NewPipe/releases" alt="Lanzamientos GitHub"><img src="https://img.shields.io/github/release/TeamNewPipe/NewPipe.svg" ></a>

README.ja.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<h2 align="center"><b>NewPipe</b></h2>
33
<h4 align="center">自由で軽量な Android 向けストリーミングフロントエンド</h4>
44

5-
<p align="center"><a href="https://f-droid.org/packages/org.schabi.newpipe/"><img src="https://fdroid.gitlab.io/artwork/badge/get-it-on-ja.svg"></a></p>
5+
<p align="center"><a href="https://f-droid.org/packages/org.schabi.newpipe/"><img src="https://fdroid.gitlab.io/artwork/badge/get-it-on-ja.svg" alt="Get it on F-Droid" height=80/></a></p>
66

77
<p align="center">
88
<a href="https://github.com/TeamNewPipe/NewPipe/releases" alt="GitHub リリース"><img src="https://img.shields.io/github/release/TeamNewPipe/NewPipe.svg"></a>

README.ko.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<h2 align="center"><b>NewPipe</b></h2>
33
<h4 align="center">A libre lightweight streaming frontend for Android.</h4>
44

5-
<p align="center"><a href="https://f-droid.org/packages/org.schabi.newpipe/"><img src="https://fdroid.gitlab.io/artwork/badge/get-it-on-ko.svg"></a></p>
5+
<p align="center"><a href="https://f-droid.org/packages/org.schabi.newpipe/"><img src="https://fdroid.gitlab.io/artwork/badge/get-it-on-ko.svg" alt="Get it on F-Droid" height=80/></a></p>
66

77
<p align="center">
88
<a href="https://github.com/TeamNewPipe/NewPipe/releases" alt="GitHub release"><img src="https://img.shields.io/github/release/TeamNewPipe/NewPipe.svg" ></a>

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<h2 align="center"><b>NewPipe</b></h2>
33
<h4 align="center">A libre lightweight streaming frontend for Android.</h4>
44

5-
<p align="center"><a href="https://f-droid.org/packages/org.schabi.newpipe/"><img src="https://f-droid.org/wiki/images/0/06/F-Droid-button_get-it-on.png"></a></p>
5+
<p align="center"><a href="https://f-droid.org/packages/org.schabi.newpipe/"><img src="https://fdroid.gitlab.io/artwork/badge/get-it-on-en.svg" alt="Get it on F-Droid" height=80/></a></p>
66

77
<p align="center">
88
<a href="https://github.com/TeamNewPipe/NewPipe/releases" alt="GitHub release"><img src="https://img.shields.io/github/release/TeamNewPipe/NewPipe.svg" ></a>

README.pt_BR.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<h2 align="center"><b>NewPipe</b></h2>
44
<h4 align="center">Uma interface de streaming leve e gratuita para Android.</h4>
55

6-
<p align="center"><a href="https://f-droid.org/packages/org.schabi.newpipe/"><img src="https://fdroid.gitlab.io/artwork/badge/get-it-on-pt-br.svg"></a></p>
6+
<p align="center"><a href="https://f-droid.org/packages/org.schabi.newpipe/"><img src="https://fdroid.gitlab.io/artwork/badge/get-it-on-pt-br.svg" alt="Get it on F-Droid" height=80/></a></p>
77

88
<p align="center">
99
<a href="https://github.com/TeamNewPipe/NewPipe/releases" alt="GitHub release"><img src="https://img.shields.io/github/release/TeamNewPipe/NewPipe.svg" ></a>

README.ro.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<h2 align="center"><b>NewPipe</b></h2>
33
<h4 align="center">Un front-end de streaming „uşor” liber, pentru Android.</h4>
44

5-
<p align="center"><a href="https://f-droid.org/packages/org.schabi.newpipe/"><img src="https://fdroid.gitlab.io/artwork/badge/get-it-on-ro.svg"></a></p>
5+
<p align="center"><a href="https://f-droid.org/packages/org.schabi.newpipe/"><img src="https://fdroid.gitlab.io/artwork/badge/get-it-on-ro.svg" alt="Get it on F-Droid" height=80/></a></p>
66

77
<p align="center">
88
<a href="https://github.com/TeamNewPipe/NewPipe/releases" alt="GitHub release"><img src="https://img.shields.io/github/release/TeamNewPipe/NewPipe.svg" ></a>

README.so.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<h2 align="center"><b>NewPipe</b></h2>
33
<h4 align="center">App bilaash ah oo fudud looguna talagalay in Android-ka wax loogu daawado.</h4>
44

5-
<p align="center"><a href="https://f-droid.org/packages/org.schabi.newpipe/"><img src="https://fdroid.gitlab.io/artwork/badge/get-it-on-so.svg"></a></p>
5+
<p align="center"><a href="https://f-droid.org/packages/org.schabi.newpipe/"><img src="https://fdroid.gitlab.io/artwork/badge/get-it-on-so.svg" alt="Get it on F-Droid" height=80/></a></p>
66

77
<p align="center">
88
<a href="https://github.com/TeamNewPipe/NewPipe/releases" alt="Siidaynta GitHub "><img src="https://img.shields.io/github/release/TeamNewPipe/NewPipe.svg" ></a>

README.tr.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<h2 align="center"><b>NewPipe</b></h2>
33
<h4 align="center">Android için hafif ve özgür bir akış arayüzü.</h4>
44

5-
<p align="center"><a href="https://f-droid.org/packages/org.schabi.newpipe/"><img src="https://fdroid.gitlab.io/artwork/badge/get-it-on-tr.svg"></a></p>
5+
<p align="center"><a href="https://f-droid.org/packages/org.schabi.newpipe/"><img src="https://fdroid.gitlab.io/artwork/badge/get-it-on-tr.svg" alt="Get it on F-Droid" height=80/></a></p>
66

77
<p align="center">
88
<a href="https://github.com/TeamNewPipe/NewPipe/releases" alt="GitHub sürümleri"><img src="https://img.shields.io/github/release/TeamNewPipe/NewPipe.svg" ></a>

app/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ dependencies {
190190
// name and the commit hash with the commit hash of the (pushed) commit you want to test
191191
// This works thanks to JitPack: https://jitpack.io/
192192
implementation 'com.github.TeamNewPipe:nanojson:1d9e1aea9049fc9f85e68b43ba39fe7be1c1f751'
193-
implementation 'com.github.TeamNewPipe:NewPipeExtractor:7e7b78f1b3'
193+
implementation 'com.github.TeamNewPipe:NewPipeExtractor:f6f2724634'
194194

195195
/** Checkstyle **/
196196
checkstyle "com.puppycrawl.tools:checkstyle:${checkstyleVersion}"
Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
package org.schabi.newpipe.error;
2+
3+
import android.util.Log;
4+
5+
import androidx.annotation.NonNull;
6+
7+
import java.io.ByteArrayOutputStream;
8+
import java.io.IOException;
9+
import java.io.ObjectOutputStream;
10+
import java.util.ArrayList;
11+
import java.util.Collections;
12+
import java.util.List;
13+
14+
/**
15+
* Ensures that a Exception is serializable.
16+
* This is
17+
*/
18+
public final class EnsureExceptionSerializable {
19+
private static final String TAG = "EnsureExSerializable";
20+
21+
private EnsureExceptionSerializable() {
22+
// No instance
23+
}
24+
25+
/**
26+
* Ensures that an exception is serializable.
27+
* <br/>
28+
* If that is not the case a {@link WorkaroundNotSerializableException} is created.
29+
*
30+
* @param exception
31+
* @return if an exception is not serializable a new {@link WorkaroundNotSerializableException}
32+
* otherwise the exception from the parameter
33+
*/
34+
public static Exception ensureSerializable(@NonNull final Exception exception) {
35+
return checkIfSerializable(exception)
36+
? exception
37+
: WorkaroundNotSerializableException.create(exception);
38+
}
39+
40+
public static boolean checkIfSerializable(@NonNull final Exception exception) {
41+
try {
42+
// Check by creating a new ObjectOutputStream which does the serialization
43+
try (ByteArrayOutputStream bos = new ByteArrayOutputStream();
44+
ObjectOutputStream oos = new ObjectOutputStream(bos)
45+
) {
46+
oos.writeObject(exception);
47+
oos.flush();
48+
49+
bos.toByteArray();
50+
}
51+
52+
return true;
53+
} catch (final IOException ex) {
54+
Log.d(TAG, "Exception is not serializable", ex);
55+
return false;
56+
}
57+
}
58+
59+
public static class WorkaroundNotSerializableException extends Exception {
60+
protected WorkaroundNotSerializableException(
61+
final Throwable notSerializableException,
62+
final Throwable cause) {
63+
super(notSerializableException.toString(), cause);
64+
setStackTrace(notSerializableException.getStackTrace());
65+
}
66+
67+
protected WorkaroundNotSerializableException(final Throwable notSerializableException) {
68+
super(notSerializableException.toString());
69+
setStackTrace(notSerializableException.getStackTrace());
70+
}
71+
72+
public static WorkaroundNotSerializableException create(
73+
@NonNull final Exception notSerializableException
74+
) {
75+
// Build a list of the exception + all causes
76+
final List<Throwable> throwableList = new ArrayList<>();
77+
78+
int pos = 0;
79+
Throwable throwableToProcess = notSerializableException;
80+
81+
while (throwableToProcess != null) {
82+
throwableList.add(throwableToProcess);
83+
84+
pos++;
85+
throwableToProcess = throwableToProcess.getCause();
86+
}
87+
88+
// Reverse list so that it starts with the last one
89+
Collections.reverse(throwableList);
90+
91+
// Build exception stack
92+
WorkaroundNotSerializableException cause = null;
93+
for (final Throwable t : throwableList) {
94+
cause = cause == null
95+
? new WorkaroundNotSerializableException(t)
96+
: new WorkaroundNotSerializableException(t, cause);
97+
}
98+
99+
return cause;
100+
}
101+
102+
}
103+
}

0 commit comments

Comments
 (0)