Skip to content

Commit

Permalink
feat(YouTube): Support version 19.34.42
Browse files Browse the repository at this point in the history
  • Loading branch information
inotia00 authored and anddea committed Dec 11, 2024
1 parent 8cbe976 commit 2018306
Show file tree
Hide file tree
Showing 30 changed files with 711 additions and 386 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,4 @@ public static void onCreate(@NonNull Activity mActivity) {
showRestartDialog(mActivity, "revanced_extended_restart_first_run", 3000);
Utils.runOnMainThreadDelayed(() -> BaseSettings.SETTINGS_INITIALIZED.save(true), 3000);
}

public static void setDeviceInformation(@NonNull Activity mActivity) {
ExtendedUtils.setApplicationLabel();
ExtendedUtils.setVersionName();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -248,8 +248,8 @@ private void exportActivity() {
@SuppressLint("SimpleDateFormat")
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");

var appName = ExtendedUtils.getApplicationLabel();
var versionName = ExtendedUtils.getVersionName();
var appName = ExtendedUtils.getAppLabel();
var versionName = ExtendedUtils.getAppVersionName();
var formatDate = dateFormat.format(new Date(System.currentTimeMillis()));
var fileName = String.format("%s_v%s_%s.txt", appName, versionName, formatDate);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,25 @@
import androidx.annotation.Nullable;

public class PackageUtils extends Utils {
private static String applicationLabel = "";
private static int smallestScreenWidthDp = 0;
private static String versionName = "";

public static String getApplicationLabel() {
return applicationLabel;
public static String getAppLabel() {
final PackageInfo packageInfo = getPackageInfo();
if (packageInfo != null) {
final ApplicationInfo applicationInfo = packageInfo.applicationInfo;
if (applicationInfo != null && applicationInfo.loadLabel(getPackageManager()) instanceof String applicationLabel) {
return applicationLabel;
}
}
return "";
}

public static String getVersionName() {
return versionName;
public static String getAppVersionName() {
final PackageInfo packageInfo = getPackageInfo();
if (packageInfo != null) {
return packageInfo.versionName;
} else {
return "";
}
}

public static boolean isPackageEnabled(@NonNull String packageName) {
Expand All @@ -30,32 +39,11 @@ public static boolean isPackageEnabled(@NonNull String packageName) {
}

public static boolean isTablet() {
return smallestScreenWidthDp >= 600;
}

public static void setApplicationLabel() {
final PackageInfo packageInfo = getPackageInfo();
if (packageInfo != null) {
final ApplicationInfo applicationInfo = packageInfo.applicationInfo;
if (applicationInfo != null) {
applicationLabel = (String) applicationInfo.loadLabel(getPackageManager());
}
}
}

public static void setSmallestScreenWidthDp() {
smallestScreenWidthDp = context.getResources().getConfiguration().smallestScreenWidthDp;
}

public static void setVersionName() {
final PackageInfo packageInfo = getPackageInfo();
if (packageInfo != null) {
versionName = packageInfo.versionName;
}
return getSmallestScreenWidthDp() >= 600;
}

public static int getSmallestScreenWidthDp() {
return smallestScreenWidthDp;
return context.getResources().getConfiguration().smallestScreenWidthDp;
}

// utils
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,8 @@ public static void hideCaptionsButtonContainer(View view) {
);
}

public static boolean hideFloatingButton() {
return Settings.HIDE_FLOATING_BUTTON.get();
public static String hideFloatingButton(String fab) {
return Settings.HIDE_FLOATING_BUTTON.get() ? null : fab;
}

public static void hideLatestVideosButton(View view) {
Expand Down
Loading

0 comments on commit 2018306

Please sign in to comment.