Skip to content

Commit

Permalink
feat(Twitter): Added Delete from database patch
Browse files Browse the repository at this point in the history
  • Loading branch information
Swakshan committed Jun 2, 2024
1 parent 89c5bbc commit d785660
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 10 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
package crimera.patches.twitter.timeline.deleteFromDatabase

import app.revanced.patcher.data.BytecodeContext
import app.revanced.patcher.patch.BytecodePatch
import app.revanced.patcher.patch.annotation.CompatiblePackage
import app.revanced.patcher.patch.annotation.Patch
import crimera.patches.twitter.misc.settings.SettingsPatch
import crimera.patches.twitter.misc.settings.fingerprints.SettingsStatusLoadFingerprint

@Patch(
name = "Delete from database",
description = "Delete entries from database(cache)",
dependencies = [SettingsPatch::class],
compatiblePackages = [CompatiblePackage("com.twitter.android")],
use = false
)
object deleteFromDatabasePatch:BytecodePatch(
setOf(SettingsStatusLoadFingerprint)
){
override fun execute(context: BytecodeContext) {
SettingsStatusLoadFingerprint.enableSettings("deleteFromDb")
}
}
12 changes: 12 additions & 0 deletions src/main/resources/twitter/settings/values/arrays.xml
Original file line number Diff line number Diff line change
Expand Up @@ -65,4 +65,16 @@
<item>@string/button_action_share</item>
</string-array>

<string-array name="piko_array_ads_hooks">
<item>@string/piko_pref_hide_promoted_posts</item>
<item>@string/piko_pref_hide_g_ads</item>
<item>@string/piko_pref_wtf_section</item>
<item>@string/piko_pref_cts_section</item>
<item>@string/piko_pref_ctj_section</item>
<item>@string/piko_pref_ryb_section</item>
<item>@string/piko_pref_pinned_posts_section</item>
<item>@string/piko_pref_hide_detailed_posts</item>
<item>@string/piko_pref_hide_premium_prompt</item>
</string-array>

</resources>
25 changes: 15 additions & 10 deletions src/main/resources/twitter/settings/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,22 @@
<string name="piko_pref_download_media_link_handle_copy_media_link">Copy media link</string>
<string name="piko_pref_download_media_link_handle_share_media_link">Share media link</string>

<string name="piko_pref_hide">Hide %s</string>
<string name="piko_title_ads">Ads</string>
<string name="piko_pref_hide_promoted_posts">Hide promoted posts</string>
<string name="piko_pref_hide_g_ads">Hide google ads</string>
<string name="piko_pref_wtf_section">Hide "Who to follow" section</string>
<string name="piko_pref_cts_section">Hide "Creators to subscribe" section</string>
<string name="piko_pref_ctj_section">Hide "Community to join" section</string>
<string name="piko_pref_ryb_section">Hide "Revist your bookmark" section</string>
<string name="piko_pref_pinned_posts_section">Hide "Pinned posts by followers" section</string>
<string name="piko_pref_hide_detailed_posts">Hide detailed posts (in replies)</string>
<string name="piko_pref_hide_trends">Hide promoted trends</string>
<string name="piko_pref_hide_premium_prompt">Hide message prompts</string>
<string name="piko_pref_hide_promoted_posts">Promoted posts</string>
<string name="piko_pref_hide_g_ads">Google ads</string>
<string name="piko_pref_wtf_section">"Who to follow" section</string>
<string name="piko_pref_cts_section">"Creators to subscribe" section</string>
<string name="piko_pref_ctj_section">"Community to join" section</string>
<string name="piko_pref_ryb_section">"Revist your bookmark" section</string>
<string name="piko_pref_pinned_posts_section">"Pinned posts by followers" section</string>
<string name="piko_pref_hide_detailed_posts">Detailed posts (in replies)</string>
<string name="piko_pref_hide_trends">Promoted trends</string>
<string name="piko_pref_hide_premium_prompt">Message prompts</string>
<string name="piko_pref_del_from_db">Delete entries from database</string>
<string name="piko_pref_db_not_found">Database not found</string>
<string name="piko_pref_db_not_open">Database is not opened</string>
<string name="piko_pref_db_del_items">Deleted items</string>

<string name="piko_title_misc">Misc</string>
<string name="piko_pref_chirp_font">Enable chirp font</string>
Expand Down

0 comments on commit d785660

Please sign in to comment.