You've already forked revanced-integrations
mirror of
https://github.com/revanced/revanced-integrations
synced 2025-11-19 03:23:27 +01:00
Compare commits
61 Commits
v0.95.0-de
...
v0.99.0-de
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
fb1a69a7ba | ||
|
|
cfc571c12c | ||
|
|
ae862cbac6 | ||
|
|
178b90b490 | ||
|
|
4b052b19a3 | ||
|
|
dce882b128 | ||
|
|
ccb5d81d46 | ||
|
|
5ed7170018 | ||
|
|
621ef63d86 | ||
|
|
37c0cc04c4 | ||
|
|
5749a1dd65 | ||
|
|
2d73b8b29b | ||
|
|
85cae1e5d6 | ||
|
|
b5a29fdce1 | ||
|
|
1809d1bbf9 | ||
|
|
96eea3d4fc | ||
|
|
665598836a | ||
|
|
f1e6cbcdf1 | ||
|
|
24d7e47844 | ||
|
|
f6573521ba | ||
|
|
c320384066 | ||
|
|
45c3f6e774 | ||
|
|
e040b7de2f | ||
|
|
96fcc0b1c7 | ||
|
|
35c4266e8b | ||
|
|
fd975ecd2a | ||
|
|
a857b9db6f | ||
|
|
39e3d046f3 | ||
|
|
da1572c28d | ||
|
|
3f5e27d6b1 | ||
|
|
3e113b6ab0 | ||
|
|
0904f3c78a | ||
|
|
9df1e460c5 | ||
|
|
cdf43efcf2 | ||
|
|
370f331330 | ||
|
|
622aa1dcaa | ||
|
|
5071082fde | ||
|
|
71b558ba6a | ||
|
|
9cea77ac59 | ||
|
|
b47b7cbc22 | ||
|
|
25d51179cc | ||
|
|
2e0758b3c8 | ||
|
|
85bf637078 | ||
|
|
cfb7aab779 | ||
|
|
0def31b2dd | ||
|
|
7225bc3c48 | ||
|
|
7d136e550c | ||
|
|
70170e24ce | ||
|
|
1864372298 | ||
|
|
1dd84a3785 | ||
|
|
512d747ec8 | ||
|
|
e16d3a7284 | ||
|
|
4469d1f3c4 | ||
|
|
43e419e6a6 | ||
|
|
f67216ad9d | ||
|
|
2e9d3fc63f | ||
|
|
d16153408c | ||
|
|
73d5400486 | ||
|
|
e698e8c524 | ||
|
|
d5bcef2cdb | ||
|
|
5ca042a602 |
10
.github/workflows/release.yml
vendored
10
.github/workflows/release.yml
vendored
@@ -3,7 +3,7 @@ name: Release
|
||||
on:
|
||||
workflow_dispatch:
|
||||
push:
|
||||
branches:
|
||||
branches:
|
||||
- main
|
||||
- dev
|
||||
pull_request:
|
||||
@@ -16,7 +16,7 @@ jobs:
|
||||
name: Release
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Cancel previou runs
|
||||
- name: Cancel previous runs
|
||||
uses: styfle/cancel-workflow-action@0.11.0
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
@@ -33,11 +33,11 @@ jobs:
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: "latest"
|
||||
node-version: "18"
|
||||
cache: 'npm'
|
||||
- name: Setup semantic-release
|
||||
run: npm install semantic-release@19.0.5 @saithodev/semantic-release-backmerge @semantic-release/git @semantic-release/changelog gradle-semantic-release-plugin@1.7.4 -D
|
||||
run: npm install
|
||||
- name: Release
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.REPOSITORY_PUSH_ACCESS }}
|
||||
run: npx semantic-release
|
||||
run: npm exec semantic-release
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
[
|
||||
"@saithodev/semantic-release-backmerge",
|
||||
{
|
||||
branches: [{from: "main", to: "dev"}],
|
||||
backmergeBranches: [{"from": "main", "to": "dev"}],
|
||||
clearWorkspace: true
|
||||
}
|
||||
]
|
||||
|
||||
169
CHANGELOG.md
169
CHANGELOG.md
@@ -1,3 +1,172 @@
|
||||
# [0.99.0-dev.2](https://github.com/revanced/revanced-integrations/compare/v0.99.0-dev.1...v0.99.0-dev.2) (2023-02-23)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **youtube/general-ads:** hide quick actions in fullscreen ([ae862cb](https://github.com/revanced/revanced-integrations/commit/ae862cbac6f9a9b717617469d202b48923a1d3b4))
|
||||
* **youtube/general-ads:** hide related videos in quick action ([cfc571c](https://github.com/revanced/revanced-integrations/commit/cfc571c12cb012b86c8bfa8bf7df1c77b9711a21))
|
||||
|
||||
# [0.99.0-dev.1](https://github.com/revanced/revanced-integrations/compare/v0.98.0...v0.99.0-dev.1) (2023-02-22)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **youtube:** remove patch `open-links-directly` ([dce882b](https://github.com/revanced/revanced-integrations/commit/dce882b12809c074ae796b3551ddd82806bd084d))
|
||||
|
||||
# [0.98.0](https://github.com/revanced/revanced-integrations/compare/v0.97.0...v0.98.0) (2023-02-22)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* remove nullable annotation in Kotlin code ([b5a29fd](https://github.com/revanced/revanced-integrations/commit/b5a29fdce195ab47edd61d1d684def1ac919297c))
|
||||
* **twitter:** make `hide-ads` patch compatible with any version ([6655988](https://github.com/revanced/revanced-integrations/commit/665598836abfcead9c5e68ce7831a4137465df39))
|
||||
* **youtube/hide-watch-in-vr:** fix descriptions ([96fcc0b](https://github.com/revanced/revanced-integrations/commit/96fcc0b1c70c277c99a99db9ca2d50f649a41a70))
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **twitter:** `hide-recommended-users` patch ([96eea3d](https://github.com/revanced/revanced-integrations/commit/96eea3d4fc096f389840481b146dcf1542cb9c43))
|
||||
* **youtube/general-ads:** hide channel bar ([35c4266](https://github.com/revanced/revanced-integrations/commit/35c4266e8b8ad7cf9fb5d14cf6cbc8ae65cc78df))
|
||||
* **youtube/general-ads:** hide full-screen feed banner ([da1572c](https://github.com/revanced/revanced-integrations/commit/da1572c28d20e2549d0e2a68591f23bb68d8cc9c))
|
||||
* **youtube/general-ads:** hide horizontal video shelf ([fd975ec](https://github.com/revanced/revanced-integrations/commit/fd975ecd2a91ea7ac713d3b7badf373c7d53ad5c))
|
||||
* **youtube/open-links-directly:** skip every redirect url ([2d73b8b](https://github.com/revanced/revanced-integrations/commit/2d73b8b29b14ab9ce20fa33ea4ebfa66984c5903))
|
||||
|
||||
# [0.98.0-dev.5](https://github.com/revanced/revanced-integrations/compare/v0.98.0-dev.4...v0.98.0-dev.5) (2023-02-22)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **youtube/open-links-directly:** skip every redirect url ([2d73b8b](https://github.com/revanced/revanced-integrations/commit/2d73b8b29b14ab9ce20fa33ea4ebfa66984c5903))
|
||||
|
||||
# [0.98.0-dev.4](https://github.com/revanced/revanced-integrations/compare/v0.98.0-dev.3...v0.98.0-dev.4) (2023-02-22)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* remove nullable annotation in Kotlin code ([b5a29fd](https://github.com/revanced/revanced-integrations/commit/b5a29fdce195ab47edd61d1d684def1ac919297c))
|
||||
|
||||
# [0.98.0-dev.3](https://github.com/revanced/revanced-integrations/compare/v0.98.0-dev.2...v0.98.0-dev.3) (2023-02-22)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **twitter:** make `hide-ads` patch compatible with any version ([6655988](https://github.com/revanced/revanced-integrations/commit/665598836abfcead9c5e68ce7831a4137465df39))
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **twitter:** `hide-recommended-users` patch ([96eea3d](https://github.com/revanced/revanced-integrations/commit/96eea3d4fc096f389840481b146dcf1542cb9c43))
|
||||
|
||||
# [0.98.0-dev.2](https://github.com/revanced/revanced-integrations/compare/v0.98.0-dev.1...v0.98.0-dev.2) (2023-02-20)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **youtube/hide-watch-in-vr:** fix descriptions ([96fcc0b](https://github.com/revanced/revanced-integrations/commit/96fcc0b1c70c277c99a99db9ca2d50f649a41a70))
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **youtube/general-ads:** hide channel bar ([35c4266](https://github.com/revanced/revanced-integrations/commit/35c4266e8b8ad7cf9fb5d14cf6cbc8ae65cc78df))
|
||||
* **youtube/general-ads:** hide horizontal video shelf ([fd975ec](https://github.com/revanced/revanced-integrations/commit/fd975ecd2a91ea7ac713d3b7badf373c7d53ad5c))
|
||||
|
||||
# [0.98.0-dev.1](https://github.com/revanced/revanced-integrations/compare/v0.97.0...v0.98.0-dev.1) (2023-02-18)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **youtube/general-ads:** hide full-screen feed banner ([da1572c](https://github.com/revanced/revanced-integrations/commit/da1572c28d20e2549d0e2a68591f23bb68d8cc9c))
|
||||
|
||||
# [0.97.0](https://github.com/revanced/revanced-integrations/compare/v0.96.2...v0.97.0) (2023-02-14)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **youtube/general-ads:** block other kind of survey ([cdf43ef](https://github.com/revanced/revanced-integrations/commit/cdf43efcf29a04b354313749057119e3de030cb1))
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **youtube/general-ads:** hide web search results ([9df1e46](https://github.com/revanced/revanced-integrations/commit/9df1e460c56bf0d5cb3c9d04853d07b22cef35bb))
|
||||
|
||||
# [0.97.0-dev.1](https://github.com/revanced/revanced-integrations/compare/v0.96.2...v0.97.0-dev.1) (2023-02-14)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **youtube/general-ads:** block other kind of survey ([cdf43ef](https://github.com/revanced/revanced-integrations/commit/cdf43efcf29a04b354313749057119e3de030cb1))
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **youtube/general-ads:** hide web search results ([9df1e46](https://github.com/revanced/revanced-integrations/commit/9df1e460c56bf0d5cb3c9d04853d07b22cef35bb))
|
||||
|
||||
## [0.96.2](https://github.com/revanced/revanced-integrations/compare/v0.96.1...v0.96.2) (2023-02-13)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **youtube/general-ads:** do not hide chapters when hiding preview comments ([cfb7aab](https://github.com/revanced/revanced-integrations/commit/cfb7aab77991e8a123fb6956e699df8ad53bf59d))
|
||||
* **youtube/general-ads:** use correct setting for `BlockRule` ([#316](https://github.com/revanced/revanced-integrations/issues/316)) ([7225bc3](https://github.com/revanced/revanced-integrations/commit/7225bc3c48b2d8f94d21b5481e37d78a26f49544))
|
||||
|
||||
## [0.96.2-dev.2](https://github.com/revanced/revanced-integrations/compare/v0.96.2-dev.1...v0.96.2-dev.2) (2023-02-13)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **youtube/general-ads:** do not hide chapters when hiding preview comments ([cfb7aab](https://github.com/revanced/revanced-integrations/commit/cfb7aab77991e8a123fb6956e699df8ad53bf59d))
|
||||
|
||||
## [0.96.2-dev.1](https://github.com/revanced/revanced-integrations/compare/v0.96.1...v0.96.2-dev.1) (2023-02-11)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **youtube/general-ads:** use correct setting for `BlockRule` ([#316](https://github.com/revanced/revanced-integrations/issues/316)) ([7225bc3](https://github.com/revanced/revanced-integrations/commit/7225bc3c48b2d8f94d21b5481e37d78a26f49544))
|
||||
|
||||
## [0.96.1](https://github.com/revanced/revanced-integrations/compare/v0.96.0...v0.96.1) (2023-02-11)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **youtube/minimized-playback:** disable when playing shorts ([1dd84a3](https://github.com/revanced/revanced-integrations/commit/1dd84a37851359143140d1d1df664c3eab680fa7))
|
||||
|
||||
## [0.96.1-dev.1](https://github.com/revanced/revanced-integrations/compare/v0.96.0...v0.96.1-dev.1) (2023-02-11)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* **youtube/minimized-playback:** disable when playing shorts ([1dd84a3](https://github.com/revanced/revanced-integrations/commit/1dd84a37851359143140d1d1df664c3eab680fa7))
|
||||
|
||||
# [0.96.0](https://github.com/revanced/revanced-integrations/compare/v0.95.0...v0.96.0) (2023-02-10)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **youtube/general-ads:** hide pill to view products ([43e419e](https://github.com/revanced/revanced-integrations/commit/43e419e6a6b7e6da372b5ec970a70ae86702b706))
|
||||
|
||||
# [0.96.0-dev.1](https://github.com/revanced/revanced-integrations/compare/v0.95.0...v0.96.0-dev.1) (2023-02-10)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **youtube/general-ads:** hide pill to view products ([43e419e](https://github.com/revanced/revanced-integrations/commit/43e419e6a6b7e6da372b5ec970a70ae86702b706))
|
||||
|
||||
# [0.95.0](https://github.com/revanced/revanced-integrations/compare/v0.94.1...v0.95.0) (2023-02-03)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* `spoof-wifi-connection` patch ([#297](https://github.com/revanced/revanced-integrations/issues/297)) ([293eae4](https://github.com/revanced/revanced-integrations/commit/293eae4a46ee8acf3484ac271a1ccf194853d42e))
|
||||
* spoof-wifi-connection patch ([6679e6e](https://github.com/revanced/revanced-integrations/commit/6679e6ee45385c8a3cf559f685dae7e6cf1f0c1f))
|
||||
* **youtube:** `hide-player-buttons` patch ([d5bcef2](https://github.com/revanced/revanced-integrations/commit/d5bcef2cdbe5dfdb1ad2552e7fde339cee1a3f27))
|
||||
|
||||
# [0.95.0-dev.2](https://github.com/revanced/revanced-integrations/compare/v0.95.0-dev.1...v0.95.0-dev.2) (2023-02-03)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **youtube:** `hide-player-buttons` patch ([d5bcef2](https://github.com/revanced/revanced-integrations/commit/d5bcef2cdbe5dfdb1ad2552e7fde339cee1a3f27))
|
||||
|
||||
# [0.95.0-dev.1](https://github.com/revanced/revanced-integrations/compare/v0.94.1...v0.95.0-dev.1) (2023-02-01)
|
||||
|
||||
|
||||
|
||||
@@ -1,6 +1,3 @@
|
||||
import java.io.FileInputStream
|
||||
import java.util.Properties
|
||||
|
||||
plugins {
|
||||
id("com.android.application")
|
||||
id("org.jetbrains.kotlin.android")
|
||||
@@ -47,7 +44,7 @@ android {
|
||||
dependencies {
|
||||
compileOnly(project(mapOf("path" to ":dummy")))
|
||||
compileOnly("androidx.annotation:annotation:1.5.0")
|
||||
compileOnly("androidx.appcompat:appcompat:1.5.1")
|
||||
compileOnly("androidx.appcompat:appcompat:1.6.1")
|
||||
compileOnly("com.squareup.okhttp3:okhttp:5.0.0-alpha.11")
|
||||
compileOnly("com.squareup.retrofit2:retrofit:2.9.0")
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@ final class CommentsPatch extends Filter {
|
||||
var comments = new BlockRule(SettingsEnum.HIDE_COMMENTS_SECTION, "video_metadata_carousel", "_comments");
|
||||
var previewComment = new BlockRule(
|
||||
SettingsEnum.HIDE_PREVIEW_COMMENT,
|
||||
"carousel_item",
|
||||
"|carousel_item",
|
||||
"comments_entry_point_teaser",
|
||||
"comments_entry_point_simplebox"
|
||||
);
|
||||
|
||||
@@ -1,40 +0,0 @@
|
||||
package app.revanced.integrations.patches;
|
||||
|
||||
import app.revanced.integrations.settings.SettingsEnum;
|
||||
import app.revanced.integrations.utils.LogHelper;
|
||||
|
||||
public final class FixPlaybackPatch {
|
||||
private static Thread currentThread = null;
|
||||
private static String videoId;
|
||||
|
||||
public static void newVideoLoaded(final String videoId) {
|
||||
if (!SettingsEnum.FIX_PLAYBACK.getBoolean()) return;
|
||||
|
||||
if (videoId.equals(FixPlaybackPatch.videoId)) return;
|
||||
else FixPlaybackPatch.videoId = videoId;
|
||||
|
||||
if (currentThread != null) {
|
||||
currentThread.interrupt();
|
||||
}
|
||||
|
||||
currentThread = new Thread(() -> {
|
||||
try {
|
||||
while (true) {
|
||||
var currentVideoTime = VideoInformation.getVideoTime();
|
||||
|
||||
if (currentVideoTime > -1) {
|
||||
VideoInformation.seekTo(Integer.MAX_VALUE);
|
||||
VideoInformation.seekTo(currentVideoTime);
|
||||
return;
|
||||
}
|
||||
|
||||
Thread.sleep(10);
|
||||
}
|
||||
} catch (InterruptedException e) {
|
||||
LogHelper.printDebug(() -> "Thread was interrupted");
|
||||
}
|
||||
});
|
||||
|
||||
currentThread.start();
|
||||
}
|
||||
}
|
||||
@@ -1,13 +1,10 @@
|
||||
package app.revanced.integrations.patches;
|
||||
|
||||
import android.view.View;
|
||||
|
||||
import app.revanced.integrations.settings.SettingsEnum;
|
||||
|
||||
public class FullscreenPanelsRemoverPatch {
|
||||
|
||||
public static int getFullscreenPanelsVisibility() {
|
||||
return SettingsEnum.HIDE_FULLSCREEN_PANELS.getBoolean() ? View.GONE : View.VISIBLE;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -26,16 +26,21 @@ public final class GeneralAdsPatch extends Filter {
|
||||
var subscribersCommunityGuidelines = new BlockRule(SettingsEnum.ADREMOVER_SUBSCRIBERS_COMMUNITY_GUIDELINES_REMOVAL, "sponsorships_comments_upsell");
|
||||
var channelMemberShelf = new BlockRule(SettingsEnum.ADREMOVER_CHANNEL_MEMBER_SHELF_REMOVAL, "member_recognition_shelf");
|
||||
var compactBanner = new BlockRule(SettingsEnum.ADREMOVER_COMPACT_BANNER_REMOVAL, "compact_banner");
|
||||
var inFeedSurvey = new BlockRule(SettingsEnum.ADREMOVER_FEED_SURVEY_REMOVAL, "in_feed_survey");
|
||||
var inFeedSurvey = new BlockRule(SettingsEnum.ADREMOVER_FEED_SURVEY_REMOVAL, "in_feed_survey", "slimline_survey");
|
||||
var medicalPanel = new BlockRule(SettingsEnum.ADREMOVER_MEDICAL_PANEL_REMOVAL, "medical_panel");
|
||||
var paidContent = new BlockRule(SettingsEnum.ADREMOVER_PAID_CONTENT_REMOVAL, "paid_content_overlay");
|
||||
var merchandise = new BlockRule(SettingsEnum.ADREMOVER_MERCHANDISE_REMOVAL, "product_carousel");
|
||||
var infoPanel = new BlockRule(SettingsEnum.ADREMOVER_INFO_PANEL_REMOVAL, "publisher_transparency_panel", "single_item_information_panel");
|
||||
var latestPosts = new BlockRule(SettingsEnum.ADREMOVER_HIDE_LATEST_POSTS, "post_shelf");
|
||||
var channelGuidelines = new BlockRule(SettingsEnum.ADREMOVER_HIDE_CHANNEL_GUIDELINES, "channel_guidelines_entry_banner");
|
||||
var artistCard = new BlockRule(SettingsEnum.HIDE_ARTIST_CARD, "official_card");
|
||||
var artistCard = new BlockRule(SettingsEnum.HIDE_ARTIST_CARDS, "official_card");
|
||||
var selfSponsor = new BlockRule(SettingsEnum.ADREMOVER_SELF_SPONSOR_REMOVAL, "cta_shelf_card");
|
||||
var chapterTeaser = new BlockRule(SettingsEnum.ADREMOVER_CHAPTER_TEASER_REMOVAL, "expandable_metadata");
|
||||
var viewProducts = new BlockRule(SettingsEnum.ADREMOVER_VIEW_PRODUCTS, "product_item", "products_in_video");
|
||||
var webLinkPanel = new BlockRule(SettingsEnum.ADREMOVER_WEB_SEARCH_RESULTS, "web_link_panel");
|
||||
var horizontalVideoShelf = new BlockRule(SettingsEnum.ADREMOVER_HORIZONTAL_VIDEO_SHELF, "horizontal_video_shelf");
|
||||
var channelBar = new BlockRule(SettingsEnum.ADREMOVER_CHANNEL_BAR, "channel_bar");
|
||||
var relatedVideos = new BlockRule(SettingsEnum.ADREMOVER_CHANNEL_BAR, "fullscreen_related_videos");
|
||||
var graySeparator = new BlockRule(SettingsEnum.ADREMOVER_GRAY_SEPARATOR,
|
||||
"cell_divider" // layout residue (gray line above the buttoned ad),
|
||||
);
|
||||
@@ -51,7 +56,9 @@ public final class GeneralAdsPatch extends Filter {
|
||||
"banner_text_icon",
|
||||
"square_image_layout",
|
||||
"watch_metadata_app_promo",
|
||||
"video_display_full_layout"
|
||||
"video_display_full_layout",
|
||||
"hero_promo_image",
|
||||
"statement_banner"
|
||||
);
|
||||
var movieAds = new BlockRule(
|
||||
SettingsEnum.ADREMOVER_MOVIE_REMOVAL,
|
||||
@@ -65,24 +72,30 @@ public final class GeneralAdsPatch extends Filter {
|
||||
this.pathRegister.registerAll(
|
||||
generalAds,
|
||||
buttonedAd,
|
||||
channelBar,
|
||||
communityPosts,
|
||||
paidContent,
|
||||
latestPosts,
|
||||
movieAds,
|
||||
chapterTeaser,
|
||||
communityGuidelines,
|
||||
relatedVideos,
|
||||
compactBanner,
|
||||
inFeedSurvey,
|
||||
viewProducts,
|
||||
medicalPanel,
|
||||
merchandise,
|
||||
infoPanel,
|
||||
channelGuidelines,
|
||||
artistCard,
|
||||
selfSponsor,
|
||||
webLinkPanel,
|
||||
horizontalVideoShelf,
|
||||
subscribersCommunityGuidelines,
|
||||
channelMemberShelf
|
||||
);
|
||||
|
||||
var quickActions = new BlockRule(SettingsEnum.ADREMOVER_CHANNEL_BAR, "quick_actions");
|
||||
var carouselAd = new BlockRule(SettingsEnum.ADREMOVER_GENERAL_ADS_REMOVAL,
|
||||
"carousel_ad"
|
||||
);
|
||||
@@ -96,6 +109,7 @@ public final class GeneralAdsPatch extends Filter {
|
||||
this.identifierRegister.registerAll(
|
||||
shorts,
|
||||
graySeparator,
|
||||
quickActions,
|
||||
carouselAd
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,16 +1,15 @@
|
||||
package app.revanced.integrations.patches;
|
||||
|
||||
import android.view.View;
|
||||
|
||||
import app.revanced.integrations.settings.SettingsEnum;
|
||||
|
||||
public class HideInfocardsPatch {
|
||||
public static void hideInfocardsIncognito(View view) {
|
||||
public class HideInfoCardsPatch {
|
||||
public static void hideInfoCardsIncognito(View view) {
|
||||
if (!SettingsEnum.HIDE_INFO_CARDS.getBoolean()) return;
|
||||
view.setVisibility(View.GONE);
|
||||
}
|
||||
|
||||
public static boolean hideInfocardsMethodCall() {
|
||||
public static boolean hideInfoCardsMethodCall() {
|
||||
return SettingsEnum.HIDE_INFO_CARDS.getBoolean();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
package app.revanced.integrations.patches;
|
||||
|
||||
|
||||
import app.revanced.integrations.settings.SettingsEnum;
|
||||
|
||||
public final class HidePlayerButtonsPatch {
|
||||
|
||||
public static boolean hideButtons() {
|
||||
return SettingsEnum.HIDE_PLAYER_BUTTONS.getBoolean();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
package app.revanced.integrations.patches;
|
||||
|
||||
import app.revanced.integrations.settings.SettingsEnum;
|
||||
|
||||
public class HideSeekbarPatch {
|
||||
public static boolean hideSeekbar() {
|
||||
return SettingsEnum.HIDE_SEEKBAR.getBoolean();
|
||||
}
|
||||
}
|
||||
@@ -1,10 +0,0 @@
|
||||
package app.revanced.integrations.patches;
|
||||
|
||||
import app.revanced.integrations.settings.SettingsEnum;
|
||||
|
||||
public class HideTimeAndSeekbarPatch {
|
||||
//Used by app.revanced.patches.youtube.layout.hidetimeandseekbar.patch.HideTimeAndSeekbarPatch
|
||||
public static boolean hideTimeAndSeekbar() {
|
||||
return SettingsEnum.HIDE_TIME_AND_SEEKBAR.getBoolean();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
package app.revanced.integrations.patches;
|
||||
|
||||
import app.revanced.integrations.settings.SettingsEnum;
|
||||
|
||||
public class HideTimePatch {
|
||||
public static boolean hideTime() {
|
||||
return SettingsEnum.HIDE_TIME.getBoolean();
|
||||
}
|
||||
}
|
||||
@@ -2,9 +2,8 @@ package app.revanced.integrations.patches;
|
||||
|
||||
import app.revanced.integrations.settings.SettingsEnum;
|
||||
|
||||
public class HideWatchinVRPatch {
|
||||
//Used by app.revanced.patches.youtube.layout.watchinvr.patch.HideWatchinVRPatch
|
||||
public static boolean hideWatchinVR() {
|
||||
public class HideWatchInVRPatch {
|
||||
public static boolean hideWatchInVR() {
|
||||
return SettingsEnum.HIDE_WATCH_IN_VR.getBoolean();
|
||||
}
|
||||
}
|
||||
@@ -1,24 +1,23 @@
|
||||
package app.revanced.integrations.patches;
|
||||
|
||||
import static app.revanced.integrations.sponsorblock.StringRef.str;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.net.Uri;
|
||||
import android.widget.Toast;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
import app.revanced.integrations.utils.LogHelper;
|
||||
import app.revanced.integrations.utils.ReVancedUtils;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
import static app.revanced.integrations.sponsorblock.StringRef.str;
|
||||
|
||||
public class MicroGSupport {
|
||||
private static final String MICROG_VENDOR = "com.mgoogle";
|
||||
private static final String MICROG_PACKAGE_NAME = "com.mgoogle.android.gms";
|
||||
private static final String MICROG_PACKAGE_NAME = MICROG_VENDOR + ".android.gms";
|
||||
private static final String VANCED_MICROG_DOWNLOAD_LINK = "https://github.com/TeamVanced/VancedMicroG/releases/latest";
|
||||
private static final String DONT_KILL_MY_APP_LINK = "https://dontkillmyapp.com";
|
||||
private static final Uri VANCED_MICROG_PROVIDER = Uri.parse("content://com.mgoogle.android.gsf.gservices/prefix");
|
||||
private static final Uri VANCED_MICROG_PROVIDER = Uri.parse("content://" + MICROG_VENDOR + ".android.gsf.gservices/prefix");
|
||||
|
||||
private static void startIntent(Context context, String uriString, String message) {
|
||||
Toast.makeText(context, message, Toast.LENGTH_LONG).show();
|
||||
|
||||
@@ -1,9 +1,14 @@
|
||||
package app.revanced.integrations.patches;
|
||||
|
||||
import app.revanced.integrations.settings.SettingsEnum;
|
||||
import app.revanced.integrations.shared.PlayerType;
|
||||
|
||||
public class MinimizedPlaybackPatch {
|
||||
|
||||
public static boolean isNotPlayingShorts(boolean isPipEnabled) {
|
||||
return !PlayerType.getCurrent().isNoneOrHidden() && isPipEnabled;
|
||||
}
|
||||
|
||||
public static boolean isMinimizedPlaybackEnabled() {
|
||||
return SettingsEnum.ENABLE_MINIMIZED_PLAYBACK.getBoolean();
|
||||
}
|
||||
|
||||
@@ -1,18 +0,0 @@
|
||||
package app.revanced.integrations.patches;
|
||||
|
||||
import java.net.URLDecoder;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import app.revanced.integrations.settings.SettingsEnum;
|
||||
|
||||
public class OpenLinksDirectlyPatch {
|
||||
|
||||
public static String parseRedirectUri(String uri) {
|
||||
if (SettingsEnum.OPEN_LINKS_DIRECTLY.getBoolean()) {
|
||||
Matcher matcher = Pattern.compile("&q=(http.+?)&v=").matcher(uri);
|
||||
return matcher.find() ? URLDecoder.decode(matcher.group(1)) : uri;
|
||||
}
|
||||
return uri;
|
||||
}
|
||||
}
|
||||
@@ -52,6 +52,12 @@ public enum SettingsEnum {
|
||||
ADREMOVER_CHAPTER_TEASER_REMOVAL("revanced_adremover_chapter_teaser", true, ReturnType.BOOLEAN),
|
||||
ADREMOVER_BUTTONED_REMOVAL("revanced_adremover_buttoned", true, ReturnType.BOOLEAN),
|
||||
ADREMOVER_GRAY_SEPARATOR("revanced_adremover_separator", true, ReturnType.BOOLEAN),
|
||||
ADREMOVER_VIEW_PRODUCTS("revanced_adremover_view_products", true, ReturnType.BOOLEAN),
|
||||
ADREMOVER_WEB_SEARCH_RESULTS("revanced_adremover_web_search_result", true, ReturnType.BOOLEAN),
|
||||
ADREMOVER_HORIZONTAL_VIDEO_SHELF("revanced_horizontal_video_shelf", true, ReturnType.BOOLEAN),
|
||||
ADREMOVER_CHANNEL_BAR("revanced_hide_channel_bar", false, ReturnType.BOOLEAN),
|
||||
ADREMOVER_QUICK_ACTIONS("revanced_hide_quick_actions", false, ReturnType.BOOLEAN),
|
||||
ADREMOVER_RELATED_VIDEOS("revanced_hide_related_videos", false, ReturnType.BOOLEAN),
|
||||
|
||||
// Action buttons
|
||||
HIDE_LIKE_BUTTON("revanced_hide_like_button", false, ReturnType.BOOLEAN, false),
|
||||
@@ -68,7 +74,7 @@ public enum SettingsEnum {
|
||||
SPOOF_APP_VERSION("revanced_spoof_app_version", false, ReturnType.BOOLEAN, true),
|
||||
WIDE_SEARCHBAR("revanced_wide_searchbar", false, ReturnType.BOOLEAN, true),
|
||||
HIDE_ALBUM_CARDS("revanced_hide_album_cards", false, ReturnType.BOOLEAN, true),
|
||||
HIDE_ARTIST_CARD("revanced_hide_artist_card", false, ReturnType.BOOLEAN),
|
||||
HIDE_ARTIST_CARDS("revanced_hide_artist_cards", false, ReturnType.BOOLEAN),
|
||||
HIDE_AUTOPLAY_BUTTON("revanced_hide_autoplay_button", true, ReturnType.BOOLEAN, true),
|
||||
HIDE_VIDEO_WATERMARK("revanced_hide_video_watermark", true, ReturnType.BOOLEAN),
|
||||
HIDE_CAPTIONS_BUTTON("revanced_hide_captions_button", false, ReturnType.BOOLEAN),
|
||||
@@ -85,9 +91,11 @@ public enum SettingsEnum {
|
||||
HIDE_REEL_BUTTON("revanced_hide_reel_button", true, ReturnType.BOOLEAN, true),
|
||||
HIDE_SHORTS_BUTTON("revanced_hide_shorts_button", true, ReturnType.BOOLEAN, true),
|
||||
HIDE_SHORTS_COMMENTS_BUTTON("revanced_hide_shorts_comments_button", false, ReturnType.BOOLEAN),
|
||||
HIDE_TIME_AND_SEEKBAR("revanced_hide_time_and_seekbar", false, ReturnType.BOOLEAN),
|
||||
HIDE_TIME("revanced_hide_time", false, ReturnType.BOOLEAN),
|
||||
HIDE_SEEKBAR("revanced_hide_seekbar", false, ReturnType.BOOLEAN),
|
||||
HIDE_WATCH_IN_VR("revanced_hide_watch_in_vr", false, ReturnType.BOOLEAN, true),
|
||||
HIDE_BREAKING_NEWS("revanced_hide_breaking_news", true, ReturnType.BOOLEAN, true),
|
||||
HIDE_PLAYER_BUTTONS("revanced_hide_player_buttons", false, ReturnType.BOOLEAN, false),
|
||||
|
||||
// Misc. Settings
|
||||
FIX_PLAYBACK("revanced_fix_playback", false, ReturnType.BOOLEAN, false),
|
||||
|
||||
@@ -49,4 +49,11 @@ enum class PlayerType {
|
||||
*/
|
||||
val onChange = Event<PlayerType>()
|
||||
}
|
||||
|
||||
/**
|
||||
* Weather Shorts are being played.
|
||||
*/
|
||||
fun isNoneOrHidden(): Boolean {
|
||||
return this == NONE || this == HIDDEN
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
package app.revanced.twitter.patches.hook.json
|
||||
|
||||
import org.json.JSONObject
|
||||
|
||||
abstract class BaseJsonHook : JsonHook {
|
||||
abstract fun apply(json: JSONObject)
|
||||
|
||||
override fun transform(json: JSONObject) = json.apply { apply(json) }
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package app.revanced.twitter.patches.hook.json
|
||||
|
||||
import app.revanced.twitter.patches.hook.patch.Hook
|
||||
import org.json.JSONObject
|
||||
|
||||
interface JsonHook : Hook<JSONObject> {
|
||||
/**
|
||||
* Transform a JSONObject.
|
||||
*
|
||||
* @param json The JSONObject.
|
||||
*/
|
||||
fun transform(json: JSONObject): JSONObject
|
||||
|
||||
override fun hook(type: JSONObject) = transform(type)
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
package app.revanced.twitter.patches.hook.json
|
||||
|
||||
import app.revanced.twitter.utils.json.JsonUtils.parseJson
|
||||
import app.revanced.twitter.utils.stream.StreamUtils
|
||||
import org.json.JSONException
|
||||
import java.io.IOException
|
||||
import java.io.InputStream
|
||||
|
||||
object JsonHookPatch {
|
||||
private val hooks = buildList<JsonHook> {
|
||||
// Modified by corresponding patch.
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
fun parseJsonHook(jsonInputStream: InputStream): InputStream {
|
||||
var jsonObject = try {
|
||||
parseJson(jsonInputStream)
|
||||
} catch (ignored: IOException) {
|
||||
return jsonInputStream // Unreachable.
|
||||
} catch (ignored: JSONException) {
|
||||
return jsonInputStream
|
||||
}
|
||||
|
||||
for (hook in hooks) jsonObject = hook.hook(jsonObject)
|
||||
|
||||
return StreamUtils.fromString(jsonObject.toString())
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
package app.revanced.twitter.patches.hook.patch
|
||||
|
||||
interface Hook<T> {
|
||||
/**
|
||||
* Hook the given type.
|
||||
* @param type The type to hook
|
||||
*/
|
||||
fun hook(type: T): T
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package app.revanced.twitter.patches.hook.patch.ads
|
||||
|
||||
import app.revanced.twitter.patches.hook.json.BaseJsonHook
|
||||
import app.revanced.twitter.patches.hook.twifucker.TwiFucker
|
||||
import org.json.JSONObject
|
||||
|
||||
|
||||
object AdsHook : BaseJsonHook() {
|
||||
/**
|
||||
* Strips JSONObject from promoted ads.
|
||||
*
|
||||
* @param json The JSONObject.
|
||||
*/
|
||||
override fun apply(json: JSONObject) = TwiFucker.hidePromotedAds(json)
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package app.revanced.twitter.patches.hook.patch.recommendation
|
||||
|
||||
import app.revanced.twitter.patches.hook.json.BaseJsonHook
|
||||
import app.revanced.twitter.patches.hook.twifucker.TwiFucker
|
||||
import org.json.JSONObject
|
||||
|
||||
|
||||
object RecommendedUsersHook : BaseJsonHook() {
|
||||
/**
|
||||
* Strips JSONObject from recommended users.
|
||||
*
|
||||
* @param json The JSONObject.
|
||||
*/
|
||||
override fun apply(json: JSONObject) = TwiFucker.hideRecommendedUsers(json)
|
||||
}
|
||||
@@ -0,0 +1,177 @@
|
||||
package app.revanced.twitter.patches.hook.twifucker
|
||||
|
||||
import android.util.Log
|
||||
import app.revanced.twitter.patches.hook.twifucker.TwiFuckerUtils.forEach
|
||||
import app.revanced.twitter.patches.hook.twifucker.TwiFuckerUtils.forEachIndexed
|
||||
import org.json.JSONArray
|
||||
import org.json.JSONObject
|
||||
|
||||
// https://raw.githubusercontent.com/Dr-TSNG/TwiFucker/880cdf1c1622e54ab45561ffcb4f53d94ed97bae/app/src/main/java/icu/nullptr/twifucker/hook/JsonHook.kt
|
||||
internal object TwiFucker {
|
||||
// root
|
||||
private fun JSONObject.jsonGetInstructions(): JSONArray? =
|
||||
optJSONObject("timeline")?.optJSONArray("instructions")
|
||||
|
||||
private fun JSONObject.jsonGetData(): JSONObject? = optJSONObject("data")
|
||||
|
||||
private fun JSONObject.jsonHasRecommendedUsers(): Boolean = has("recommended_users")
|
||||
|
||||
private fun JSONObject.jsonRemoveRecommendedUsers() {
|
||||
remove("recommended_users")
|
||||
}
|
||||
|
||||
private fun JSONObject.jsonCheckAndRemoveRecommendedUsers() {
|
||||
if (jsonHasRecommendedUsers()) {
|
||||
Log.d("revanced", "Handle recommended users: $this")
|
||||
jsonRemoveRecommendedUsers()
|
||||
}
|
||||
}
|
||||
|
||||
private fun JSONObject.jsonHasThreads(): Boolean = has("threads")
|
||||
|
||||
private fun JSONObject.jsonRemoveThreads() {
|
||||
remove("threads")
|
||||
}
|
||||
|
||||
private fun JSONObject.jsonCheckAndRemoveThreads() {
|
||||
if (jsonHasThreads()) {
|
||||
Log.d("revabced", "Handle threads: $this")
|
||||
jsonRemoveThreads()
|
||||
}
|
||||
}
|
||||
|
||||
// data
|
||||
private fun JSONObject.dataGetInstructions(): JSONArray? {
|
||||
val timeline = optJSONObject("user_result")?.optJSONObject("result")
|
||||
?.optJSONObject("timeline_response")?.optJSONObject("timeline")
|
||||
?: optJSONObject("timeline_response")?.optJSONObject("timeline")
|
||||
?: optJSONObject("timeline_response")
|
||||
return timeline?.optJSONArray("instructions")
|
||||
}
|
||||
|
||||
private fun JSONObject.dataCheckAndRemove() {
|
||||
dataGetInstructions()?.forEach { instruction ->
|
||||
instruction.instructionCheckAndRemove()
|
||||
}
|
||||
}
|
||||
|
||||
private fun JSONObject.dataGetLegacy(): JSONObject? =
|
||||
optJSONObject("tweet_result")?.optJSONObject("result")?.let {
|
||||
if (it.has("tweet")) {
|
||||
it.optJSONObject("tweet")
|
||||
} else {
|
||||
it
|
||||
}
|
||||
}?.optJSONObject("legacy")
|
||||
|
||||
|
||||
// entry
|
||||
private fun JSONObject.entryHasPromotedMetadata(): Boolean =
|
||||
optJSONObject("content")?.optJSONObject("item")?.optJSONObject("content")
|
||||
?.optJSONObject("tweet")
|
||||
?.has("promotedMetadata") == true || optJSONObject("content")?.optJSONObject("content")
|
||||
?.has("tweetPromotedMetadata") == true || optJSONObject("item")?.optJSONObject("content")
|
||||
?.has("tweetPromotedMetadata") == true
|
||||
|
||||
private fun JSONObject.entryGetContentItems(): JSONArray? =
|
||||
optJSONObject("content")?.optJSONArray("items")
|
||||
?: optJSONObject("content")?.optJSONObject("timelineModule")?.optJSONArray("items")
|
||||
|
||||
private fun JSONObject.entryIsTweetDetailRelatedTweets(): Boolean =
|
||||
optString("entryId").startsWith("tweetdetailrelatedtweets-")
|
||||
|
||||
private fun JSONObject.entryGetTrends(): JSONArray? =
|
||||
optJSONObject("content")?.optJSONObject("timelineModule")?.optJSONArray("items")
|
||||
|
||||
// trend
|
||||
private fun JSONObject.trendHasPromotedMetadata(): Boolean =
|
||||
optJSONObject("item")?.optJSONObject("content")?.optJSONObject("trend")
|
||||
?.has("promotedMetadata") == true
|
||||
|
||||
private fun JSONArray.trendRemoveAds() {
|
||||
val trendRemoveIndex = mutableListOf<Int>()
|
||||
forEachIndexed { trendIndex, trend ->
|
||||
if (trend.trendHasPromotedMetadata()) {
|
||||
Log.d("revanced", "Handle trends ads $trendIndex $trend")
|
||||
trendRemoveIndex.add(trendIndex)
|
||||
}
|
||||
}
|
||||
for (i in trendRemoveIndex.asReversed()) {
|
||||
remove(i)
|
||||
}
|
||||
}
|
||||
|
||||
// instruction
|
||||
private fun JSONObject.instructionTimelineAddEntries(): JSONArray? = optJSONArray("entries")
|
||||
|
||||
private fun JSONObject.instructionGetAddEntries(): JSONArray? =
|
||||
optJSONObject("addEntries")?.optJSONArray("entries")
|
||||
|
||||
private fun JSONObject.instructionCheckAndRemove() {
|
||||
instructionTimelineAddEntries()?.entriesRemoveAnnoyance()
|
||||
instructionGetAddEntries()?.entriesRemoveAnnoyance()
|
||||
}
|
||||
|
||||
// entries
|
||||
private fun JSONArray.entriesRemoveTimelineAds() {
|
||||
val removeIndex = mutableListOf<Int>()
|
||||
forEachIndexed { entryIndex, entry ->
|
||||
entry.entryGetTrends()?.trendRemoveAds()
|
||||
|
||||
if (entry.entryHasPromotedMetadata()) {
|
||||
Log.d("revanced", "Handle timeline ads $entryIndex $entry")
|
||||
removeIndex.add(entryIndex)
|
||||
}
|
||||
|
||||
val innerRemoveIndex = mutableListOf<Int>()
|
||||
val contentItems = entry.entryGetContentItems()
|
||||
contentItems?.forEachIndexed inner@{ itemIndex, item ->
|
||||
if (item.entryHasPromotedMetadata()) {
|
||||
Log.d("revanced", "Handle timeline replies ads $entryIndex $entry")
|
||||
if (contentItems.length() == 1) {
|
||||
removeIndex.add(entryIndex)
|
||||
} else {
|
||||
innerRemoveIndex.add(itemIndex)
|
||||
}
|
||||
return@inner
|
||||
}
|
||||
}
|
||||
for (i in innerRemoveIndex.asReversed()) {
|
||||
contentItems?.remove(i)
|
||||
}
|
||||
}
|
||||
for (i in removeIndex.reversed()) {
|
||||
remove(i)
|
||||
}
|
||||
}
|
||||
|
||||
private fun JSONArray.entriesRemoveTweetDetailRelatedTweets() {
|
||||
val removeIndex = mutableListOf<Int>()
|
||||
forEachIndexed { entryIndex, entry ->
|
||||
|
||||
if (entry.entryIsTweetDetailRelatedTweets()) {
|
||||
Log.d("revanced", "Handle tweet detail related tweets $entryIndex $entry")
|
||||
removeIndex.add(entryIndex)
|
||||
}
|
||||
}
|
||||
for (i in removeIndex.reversed()) {
|
||||
remove(i)
|
||||
}
|
||||
}
|
||||
|
||||
private fun JSONArray.entriesRemoveAnnoyance() {
|
||||
entriesRemoveTimelineAds()
|
||||
entriesRemoveTweetDetailRelatedTweets()
|
||||
}
|
||||
|
||||
fun hideRecommendedUsers(json: JSONObject) {
|
||||
json.jsonCheckAndRemoveRecommendedUsers()
|
||||
}
|
||||
|
||||
fun hidePromotedAds(json: JSONObject) {
|
||||
json.jsonGetInstructions()?.forEach { instruction ->
|
||||
instruction.instructionCheckAndRemove()
|
||||
}
|
||||
json.jsonGetData()?.dataCheckAndRemove()
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
package app.revanced.twitter.patches.hook.twifucker
|
||||
|
||||
import org.json.JSONArray
|
||||
import org.json.JSONObject
|
||||
|
||||
internal object TwiFuckerUtils {
|
||||
inline fun JSONArray.forEach(action: (JSONObject) -> Unit) {
|
||||
(0 until this.length()).forEach { i ->
|
||||
if (this[i] is JSONObject) {
|
||||
action(this[i] as JSONObject)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
inline fun JSONArray.forEachIndexed(action: (index: Int, JSONObject) -> Unit) {
|
||||
(0 until this.length()).forEach { i ->
|
||||
if (this[i] is JSONObject) {
|
||||
action(i, this[i] as JSONObject)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
package app.revanced.twitter.utils.json
|
||||
|
||||
import app.revanced.twitter.utils.stream.StreamUtils
|
||||
import org.json.JSONException
|
||||
import org.json.JSONObject
|
||||
import java.io.IOException
|
||||
import java.io.InputStream
|
||||
|
||||
object JsonUtils {
|
||||
@JvmStatic
|
||||
@Throws(IOException::class, JSONException::class)
|
||||
fun parseJson(jsonInputStream: InputStream) = JSONObject(StreamUtils.toString(jsonInputStream))
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
package app.revanced.twitter.utils.stream
|
||||
|
||||
import java.io.ByteArrayInputStream
|
||||
import java.io.ByteArrayOutputStream
|
||||
import java.io.IOException
|
||||
import java.io.InputStream
|
||||
|
||||
object StreamUtils {
|
||||
@Throws(IOException::class)
|
||||
fun toString(inputStream: InputStream): String {
|
||||
ByteArrayOutputStream().use { result ->
|
||||
val buffer = ByteArray(1024)
|
||||
var length: Int
|
||||
while (inputStream.read(buffer).also { length = it } != -1) {
|
||||
result.write(buffer, 0, length)
|
||||
}
|
||||
return result.toString()
|
||||
}
|
||||
}
|
||||
|
||||
fun fromString(string: String): InputStream {
|
||||
return ByteArrayInputStream(string.toByteArray())
|
||||
}
|
||||
}
|
||||
@@ -1,3 +1,3 @@
|
||||
org.gradle.jvmargs = -Xmx2048m
|
||||
android.useAndroidX = true
|
||||
version = 0.95.0-dev.1
|
||||
version = 0.99.0-dev.2
|
||||
|
||||
1211
package-lock.json
generated
1211
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -1,8 +1,9 @@
|
||||
{
|
||||
"devDependencies": {
|
||||
"@saithodev/semantic-release-backmerge": "^3.1.0",
|
||||
"@semantic-release/changelog": "^6.0.2",
|
||||
"@semantic-release/git": "^10.0.1",
|
||||
"gradle-semantic-release-plugin": "^1.7.4",
|
||||
"semantic-release": "^19.0.5"
|
||||
"gradle-semantic-release-plugin": "^1.7.6",
|
||||
"semantic-release": "^20.1.0"
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user