Skip to content

Commit

Permalink
Merge pull request #73 from crimera/dev
Browse files Browse the repository at this point in the history
chore: Merge branch `dev` to `main`
  • Loading branch information
crimera authored Aug 6, 2024
2 parents 0b1a6f0 + 7b19465 commit ebcf93f
Show file tree
Hide file tree
Showing 8 changed files with 65 additions and 8 deletions.
19 changes: 19 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,22 @@
## [1.23.0-dev.1](https://github.com/crimera/revanced-integrations/compare/v1.22.1-dev.1...v1.23.0-dev.1) (2024-08-03)


### Features

* **Twitter:** Added `Remove main event` patch ([d4b77d0](https://github.com/crimera/revanced-integrations/commit/d4b77d085e2c29f6ca557b08f7bc471b48dbd154))


### Refactors

* **Twitter:** Seperated/Added `Remove superhero event` patch ([f87f55b](https://github.com/crimera/revanced-integrations/commit/f87f55b2bc2185e38667b632010364d05317f0c5))

## [1.22.1-dev.1](https://github.com/crimera/revanced-integrations/compare/v1.22.0...v1.22.1-dev.1) (2024-08-02)


### Bug Fixes

* **Twitter:** Fix `Remove premium upsell` patch ([4430494](https://github.com/crimera/revanced-integrations/commit/4430494b25cc967fef70980b8f7ecdd3f1e78c63))

## [1.22.0](https://github.com/crimera/revanced-integrations/compare/v1.21.1...v1.22.0) (2024-07-31)


Expand Down
11 changes: 8 additions & 3 deletions app/src/main/java/app/revanced/integrations/twitter/Pref.java
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,13 @@ public static boolean hideGoogleAds() {
return Utils.getBooleanPerf(Settings.ADS_HIDE_GOOGLE_ADS);
}

public static boolean hideMainEvent() {
return Utils.getBooleanPerf(Settings.ADS_HIDE_MAIN_EVENT);
}
public static boolean hideSuperheroEvent() {
return Utils.getBooleanPerf(Settings.ADS_HIDE_SUPERHERO_EVENT);
}

public static boolean hideWTF() {
return Utils.getBooleanPerf(Settings.ADS_HIDE_WHO_TO_FOLLOW);
}
Expand All @@ -212,10 +219,8 @@ public static boolean hideCTJ() {
public static boolean hideRBMK() {
return Utils.getBooleanPerf(Settings.ADS_HIDE_REVISIT_BMK);
}
public static String removePremiumUpsell(String def) {
if(Utils.getBooleanPerf(Settings.ADS_REMOVE_PREMIUM_UPSELL)) return "";
return def;

public static boolean removePremiumUpsell() {return !Utils.getBooleanPerf(Settings.ADS_REMOVE_PREMIUM_UPSELL);
}

public static boolean hideRPinnedPosts() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import app.revanced.integrations.twitter.settings.SettingsStatus;

public class TimelineEntry {
private static final boolean hideAds,hideGAds,hideWTF,hideCTS,hideCTJ,hideDetailedPosts,hideRBMK,hidePinnedPosts,hidePremiumPrompt;
private static final boolean hideAds,hideGAds,hideWTF,hideCTS,hideCTJ,hideDetailedPosts,hideRBMK,hidePinnedPosts,hidePremiumPrompt,hideMainEvent,hideSuperheroEvent;
static {
hideAds = (Pref.hideAds() && SettingsStatus.hideAds);
hideGAds = (Pref.hideGoogleAds() && SettingsStatus.hideGAds);
Expand All @@ -17,20 +17,24 @@ public class TimelineEntry {
hideRBMK = (Pref.hideRBMK() && SettingsStatus.hideRBMK);
hidePinnedPosts = (Pref.hideRPinnedPosts() && SettingsStatus.hideRPinnedPosts);
hidePremiumPrompt = (Pref.hidePremiumPrompt() && SettingsStatus.hidePremiumPrompt);
hideMainEvent = (Pref.hideMainEvent() && SettingsStatus.hideMainEvent);
hideSuperheroEvent = (Pref.hideSuperheroEvent() && SettingsStatus.hideSuperheroEvent);
}


private static boolean isEntryIdRemove(String entryId) {
String[] split = entryId.split("-");
String entryId2 = split[0];
if (!entryId2.equals("cursor") && !entryId2.equals("Guide") && !entryId2.startsWith("semantic_core")) {
if ((entryId2.equals("promoted") || ((entryId2.equals("conversationthread") && split.length == 3) || entryId2.equals("superhero"))) && hideAds) {
if (entryId2.equals("promoted") || ((entryId2.equals("conversationthread") && split.length == 3)) && hideAds) {
return true;
}
if (entryId2.equals("superhero") && hideSuperheroEvent) {
return true;
}
if (entryId2.equals("rtb") && hideGAds) {
return true;
}

if (entryId2.equals("tweetdetailrelatedtweets") && hideDetailedPosts) {
return true;
}
Expand All @@ -52,6 +56,9 @@ private static boolean isEntryIdRemove(String entryId) {
if (entryId.startsWith("messageprompt-") && hidePremiumPrompt) {
return true;
}
if (entryId.startsWith("main-event-") && hideMainEvent) {
return true;
}
}
return false;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ public class Settings extends BaseSettings {
public static final BooleanSetting ADS_HIDE_PROMOTED_TRENDS = new BooleanSetting("ads_hide_promoted_trends", true);
public static final BooleanSetting ADS_HIDE_PROMOTED_POSTS = new BooleanSetting("ads_hide_promoted_posts", true);
public static final BooleanSetting ADS_HIDE_GOOGLE_ADS = new BooleanSetting("ads_hide_google_ads", true);
public static final BooleanSetting ADS_HIDE_MAIN_EVENT = new BooleanSetting("ads_hide_main_event", false);
public static final BooleanSetting ADS_HIDE_SUPERHERO_EVENT = new BooleanSetting("ads_hide_superhero_event", true);
public static final BooleanSetting ADS_HIDE_WHO_TO_FOLLOW = new BooleanSetting("ads_hide_who_to_follow", true);
public static final BooleanSetting ADS_HIDE_CREATORS_TO_SUB = new BooleanSetting("ads_hide_creators_to_sub", true);
public static final BooleanSetting ADS_HIDE_COMM_TO_JOIN = new BooleanSetting("ads_hide_comm_to_join", true);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,8 @@ public void onCreate(@org.jetbrains.annotations.Nullable Bundle savedInstanceSta
flags.put(strEnableRes("piko_pref_enable_vid_auto_advance"),SettingsStatus.enableVidAutoAdvance);
flags.put(strEnableRes("piko_pref_enable_force_pip"),SettingsStatus.enableForcePip);
flags.put(strRemoveRes("piko_pref_hide_premium_upsell"),SettingsStatus.removePremiumUpsell);
flags.put(strRemoveRes("piko_pref_hide_main_event"),SettingsStatus.hideMainEvent);
flags.put(strRemoveRes("piko_pref_hide_superhero_event"),SettingsStatus.hideSuperheroEvent);

LegacyTwitterPreferenceCategory patPref = preferenceCategory(strRes("piko_pref_patches"), screen);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,24 @@ public void onCreate(@Nullable Bundle savedInstanceState) {
)
);
}
if (SettingsStatus.hideMainEvent) {
adsPrefs.addPreference(
switchPreference(
strRemoveRes("piko_pref_hide_main_event"),
"",
Settings.ADS_HIDE_MAIN_EVENT
)
);
}
if (SettingsStatus.hideSuperheroEvent) {
adsPrefs.addPreference(
switchPreference(
strRemoveRes("piko_pref_hide_superhero_event"),
"",
Settings.ADS_HIDE_SUPERHERO_EVENT
)
);
}
if (SettingsStatus.hideWTF) {
adsPrefs.addPreference(
switchPreference(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ public class SettingsStatus {

public static boolean hideAds = false;
public static boolean hideGAds = false;
public static boolean hideMainEvent = false;
public static boolean hideSuperheroEvent = false;
public static boolean hideWTF = false;
public static boolean hideCTS = false;
public static boolean hideCTJ = false;
Expand Down Expand Up @@ -94,6 +96,8 @@ public class SettingsStatus {

public static void hideAds() { hideAds = true; }
public static void hideGAds() { hideGAds = true; }
public static void hideMainEvent() { hideMainEvent = true; }
public static void hideSuperheroEvent() { hideSuperheroEvent = true; }
public static void hideWhoToFollow() { hideWTF = true; }
public static void hideCreatorsToSub() { hideCTS = true; }
public static void hideCommToJoin() { hideCTJ = true; }
Expand All @@ -116,7 +120,7 @@ public class SettingsStatus {

public static boolean enableTimelineSection(){ return (inlineBarCustomisation || navBarCustomisation || disableAutoTimelineScroll || forceTranslate || hidePromoteButton || hideCommunityNote|| hideLiveThreads || hideBanner || hideInlineBmk || showPollResultsEnabled || hideImmersivePlayer || enableVidAutoAdvance); }
public static boolean enableMiscSection() { return (roundOffNumbers || enableFontMod || hideRecommendedUsers || hideFAB || hideViewCount || customSharingDomainEnabled || hideFABBtns); }
public static boolean enableAdsSection() {return (hideAds|| hideGAds || hideWTF || hideCTS || hideCTJ || hideDetailedPosts || hideRBMK ||hidePromotedTrend || removePremiumUpsell); }
public static boolean enableAdsSection() {return (hideAds|| hideGAds || hideWTF || hideCTS || hideCTJ || hideDetailedPosts || hideRBMK ||hidePromotedTrend || removePremiumUpsell || hideMainEvent || hideSuperheroEvent); }
public static boolean enableDownloadSection() {return (nativeDownloader || changeDownloadEnabled || mediaLinkHandle); }

public static boolean enablePremiumSection() {return (enableReaderMode || enableUndoPosts || customAppIcon || enableForcePip); }
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
org.gradle.parallel = true
org.gradle.caching = true
android.useAndroidX = true
version = 1.22.0
version = 1.23.0-dev.1

0 comments on commit ebcf93f

Please sign in to comment.