refactor(Spotify): Add extensions debug logging (#5110)
This commit is contained in:
parent
e2e07b5cb2
commit
bde3fda972
8 changed files with 32 additions and 12 deletions
|
|
@ -2,6 +2,7 @@ package app.revanced.extension.spotify.layout.hide.createbutton;
|
|||
|
||||
import java.util.List;
|
||||
|
||||
import app.revanced.extension.shared.Logger;
|
||||
import app.revanced.extension.shared.Utils;
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
|
|
@ -31,10 +32,21 @@ public final class HideCreateButtonPatch {
|
|||
}
|
||||
|
||||
String stringifiedNavigationBarItem = navigationBarItem.toString();
|
||||
boolean isCreateButton = CREATE_BUTTON_TITLE_RES_ID_LIST.stream()
|
||||
.anyMatch(stringifiedNavigationBarItem::contains);
|
||||
|
||||
boolean isCreateButton = false;
|
||||
String matchedTitleResId = null;
|
||||
|
||||
for (String titleResId : CREATE_BUTTON_TITLE_RES_ID_LIST) {
|
||||
if (stringifiedNavigationBarItem.contains(titleResId)) {
|
||||
isCreateButton = true;
|
||||
matchedTitleResId = titleResId;
|
||||
}
|
||||
}
|
||||
|
||||
if (isCreateButton) {
|
||||
String finalMatchedTitleResId = matchedTitleResId;
|
||||
Logger.printInfo(() -> "Hiding Create button because the navigation bar item " + navigationBarItem +
|
||||
" matched the title resource id " + finalMatchedTitleResId);
|
||||
return null;
|
||||
}
|
||||
|
||||
|
|
@ -46,6 +58,14 @@ public final class HideCreateButtonPatch {
|
|||
* Create button.
|
||||
*/
|
||||
public static boolean isOldCreateButton(int oldNavigationBarItemTitleResId) {
|
||||
return oldNavigationBarItemTitleResId == OLD_CREATE_BUTTON_TITLE_RES_ID;
|
||||
boolean isCreateButton = oldNavigationBarItemTitleResId == OLD_CREATE_BUTTON_TITLE_RES_ID;
|
||||
|
||||
if (isCreateButton) {
|
||||
Logger.printInfo(() -> "Hiding old Create button because the navigation bar item title resource id" +
|
||||
" matched " + OLD_CREATE_BUTTON_TITLE_RES_ID);
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -33,10 +33,11 @@ public final class SanitizeSharingLinksPatch {
|
|||
}
|
||||
}
|
||||
|
||||
return builder.build().toString();
|
||||
String sanitizedUrl = builder.build().toString();
|
||||
Logger.printInfo(() -> "Sanitized url " + url + " to " + sanitizedUrl);
|
||||
return sanitizedUrl;
|
||||
} catch (Exception ex) {
|
||||
Logger.printException(() -> "sanitizeUrl failure", ex);
|
||||
|
||||
Logger.printException(() -> "sanitizeUrl failure with " + url, ex);
|
||||
return url;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue