File tree Expand file tree Collapse file tree 3 files changed +12
-10
lines changed
src/main/java/app/revanced/extension/spotify
stub/src/main/java/com/spotify/browsita/v1/resolved Expand file tree Collapse file tree 3 files changed +12
-10
lines changed Original file line number Diff line number Diff line change 1
1
package app .revanced .extension .spotify .layout .hide .createbutton ;
2
2
3
- import java .util .List ;
4
-
5
3
import app .revanced .extension .shared .Logger ;
6
- import app .revanced .extension .spotify .shared .ComponentFilters .*;
4
+ import app .revanced .extension .spotify .shared .ComponentFilters .ComponentFilter ;
5
+ import app .revanced .extension .spotify .shared .ComponentFilters .ResourceIdComponentFilter ;
6
+ import app .revanced .extension .spotify .shared .ComponentFilters .StringComponentFilter ;
7
+
8
+ import java .util .List ;
7
9
8
10
@ SuppressWarnings ("unused" )
9
11
public final class HideCreateButtonPatch {
@@ -53,7 +55,9 @@ public static Object returnNullIfIsCreateButton(Object navigationBarItem) {
53
55
return null ;
54
56
}
55
57
}
56
- } catch (Exception ex ) {
58
+ } catch (Throwable ex ) {
59
+ // Catch Throwable as calling toString can cause crashes with wrongfully generated code that throws
60
+ // NoSuchMethod errors.
57
61
Logger .printException (() -> "returnNullIfIsCreateButton failure" , ex );
58
62
}
59
63
Original file line number Diff line number Diff line change @@ -88,9 +88,7 @@ private static class OverrideAttribute {
88
88
* response which delivers browse sections.
89
89
*/
90
90
private static final List <Integer > REMOVED_BROWSE_SECTIONS = List .of (
91
- com .spotify .browsita .v1 .resolved .Section .BRAND_ADS_FIELD_NUMBER ,
92
- com .spotify .browsita .v1 .resolved .Section .PROMOTION_V1_FIELD_NUMBER ,
93
- com .spotify .browsita .v1 .resolved .Section .PROMOTION_V3_FIELD_NUMBER
91
+ com .spotify .browsita .v1 .resolved .Section .BRAND_ADS_FIELD_NUMBER
94
92
);
95
93
96
94
/**
@@ -249,7 +247,9 @@ public static boolean isFilteredContextMenuItem(Object contextMenuItem) {
249
247
return true ;
250
248
}
251
249
}
252
- } catch (Exception ex ) {
250
+ } catch (Throwable ex ) {
251
+ // Catch Throwable as calling toString can cause crashes with wrongfully generated code that throws
252
+ // NoSuchMethod errors.
253
253
Logger .printException (() -> "isFilteredContextMenuItem failure" , ex );
254
254
}
255
255
Original file line number Diff line number Diff line change 2
2
3
3
public final class Section {
4
4
public static final int BRAND_ADS_FIELD_NUMBER = 6 ;
5
- public static final int PROMOTION_V1_FIELD_NUMBER = 3 ;
6
- public static final int PROMOTION_V3_FIELD_NUMBER = 5 ;
7
5
public int sectionTypeCase_ ;
8
6
}
You can’t perform that action at this time.
0 commit comments