1
mirror of https://github.com/revanced/revanced-integrations synced 2025-11-19 03:23:27 +01:00

Compare commits

...

55 Commits

Author SHA1 Message Date
semantic-release-bot
c7ae3355a1 chore(release): 1.4.1-dev.2 [skip ci]
## [1.4.1-dev.2](https://github.com/ReVanced/revanced-integrations/compare/v1.4.1-dev.1...v1.4.1-dev.2) (2024-03-04)

### Bug Fixes

* **YouTube - Client spoof:**  Allow playback for links with timestamp ([#582](https://github.com/ReVanced/revanced-integrations/issues/582)) ([eee3f35](eee3f352c5))
2024-03-04 06:55:30 +00:00
Hoàng Gia Bảo
eee3f352c5 fix(YouTube - Client spoof): Allow playback for links with timestamp (#582) 2024-03-04 07:52:18 +01:00
oSumAtrIX
36aa6c9aa8 chore: Lint code 2024-03-03 00:26:34 +01:00
semantic-release-bot
e5aa30ebe5 chore(release): 1.4.1-dev.1 [skip ci]
## [1.4.1-dev.1](https://github.com/ReVanced/revanced-integrations/compare/v1.4.0...v1.4.1-dev.1) (2024-03-02)

### Bug Fixes

* **YouTube - Announcements:** Only compare ID to not show same announcement after a fix-up ([#579](https://github.com/ReVanced/revanced-integrations/issues/579)) ([5d14f53](5d14f53acd))
2024-03-02 23:07:44 +00:00
oSumAtrIX
5d14f53acd fix(YouTube - Announcements): Only compare ID to not show same announcement after a fix-up (#579)
Previously, the announcement content was hashed and compared with the locally saved hash. Sometimes announcements are fixed up, altering the hash, so instead, compare the ID.
2024-03-03 00:04:38 +01:00
oSumAtrIX
67673d089f build: Bump dependencies 2024-03-02 20:51:10 +01:00
semantic-release-bot
07482094a3 chore(release): 1.4.0 [skip ci]
# [1.4.0](https://github.com/ReVanced/revanced-integrations/compare/v1.3.2...v1.4.0) (2024-03-02)

### Bug Fixes

* **Twitter - Hide ads:** Hide ads in search ([b40687c](b40687c5c7))
* **YouTube - Disable suggested end screen:** Reliably hide end screen ([b4ab5f6](b4ab5f65d5))
* **YouTube - Hide ads:** Do not show error toast and hide full screen ads ([#569](https://github.com/ReVanced/revanced-integrations/issues/569)) ([0b0d46f](0b0d46f518))
* **YouTube - Hide Shorts:** Hide Shorts in feed when using tablet layout ([#572](https://github.com/ReVanced/revanced-integrations/issues/572)) ([7f5e7df](7f5e7dfd68))
* **YouTube - Spoof app version:** Remove broken versions ([#573](https://github.com/ReVanced/revanced-integrations/issues/573)) ([fb4aab7](fb4aab792a))

### Features

* **Sync for Reddit:** Add `Fix /s/ links` patch ([a8c82ad](a8c82ad27b))
* **X:** Add `Open links as query` patch ([#570](https://github.com/ReVanced/revanced-integrations/issues/570)) ([95ca632](95ca632d40))
* **YouTube - Change start page:** Add more start pages ([27421fb](27421fb578))
* **YouTube - Spoof app version:** Add target versions ([#574](https://github.com/ReVanced/revanced-integrations/issues/574)) ([da57fb9](da57fb9523))
* **YouTube:** Reorganize settings menu ([#571](https://github.com/ReVanced/revanced-integrations/issues/571)) ([eea4a48](eea4a48cd5))
2024-03-02 19:00:17 +00:00
oSumAtrIX
7fcb244cfb chore: Merge branch dev to main (#567) 2024-03-02 19:57:05 +01:00
semantic-release-bot
4ec76435d5 chore(release): 1.4.0-dev.9 [skip ci]
# [1.4.0-dev.9](https://github.com/ReVanced/revanced-integrations/compare/v1.4.0-dev.8...v1.4.0-dev.9) (2024-03-02)

### Features

* **YouTube:** Reorganize settings menu ([#571](https://github.com/ReVanced/revanced-integrations/issues/571)) ([eea4a48](eea4a48cd5))
2024-03-02 07:30:41 +00:00
LisoUseInAIKyrios
eea4a48cd5 feat(YouTube): Reorganize settings menu (#571)
Co-authored-by: oSumAtrIX <johan.melkonyan1@web.de>
2024-03-02 08:27:16 +01:00
semantic-release-bot
db7e24994b chore(release): 1.4.0-dev.8 [skip ci]
# [1.4.0-dev.8](https://github.com/ReVanced/revanced-integrations/compare/v1.4.0-dev.7...v1.4.0-dev.8) (2024-03-02)

### Features

* **YouTube - Spoof app version:** Add target versions ([#574](https://github.com/ReVanced/revanced-integrations/issues/574)) ([da57fb9](da57fb9523))
2024-03-02 07:13:02 +00:00
kitadai31
da57fb9523 feat(YouTube - Spoof app version): Add target versions (#574) 2024-03-02 08:09:49 +01:00
semantic-release-bot
486911ff2e chore(release): 1.4.0-dev.7 [skip ci]
# [1.4.0-dev.7](https://github.com/ReVanced/revanced-integrations/compare/v1.4.0-dev.6...v1.4.0-dev.7) (2024-02-29)

### Bug Fixes

* **YouTube - Spoof app version:** Remove broken versions ([#573](https://github.com/ReVanced/revanced-integrations/issues/573)) ([fb4aab7](fb4aab792a))
2024-02-29 02:38:26 +00:00
LisoUseInAIKyrios
fb4aab792a fix(YouTube - Spoof app version): Remove broken versions (#573) 2024-02-29 06:35:16 +04:00
semantic-release-bot
c5383d6ea2 chore(release): 1.4.0-dev.6 [skip ci]
# [1.4.0-dev.6](https://github.com/ReVanced/revanced-integrations/compare/v1.4.0-dev.5...v1.4.0-dev.6) (2024-02-28)

### Bug Fixes

* **YouTube - Hide Shorts:** Hide Shorts in feed when using tablet layout ([#572](https://github.com/ReVanced/revanced-integrations/issues/572)) ([7f5e7df](7f5e7dfd68))
2024-02-28 11:14:50 +00:00
LisoUseInAIKyrios
7f5e7dfd68 fix(YouTube - Hide Shorts): Hide Shorts in feed when using tablet layout (#572) 2024-02-28 15:11:47 +04:00
semantic-release-bot
b1437d43f5 chore(release): 1.4.0-dev.5 [skip ci]
# [1.4.0-dev.5](https://github.com/ReVanced/revanced-integrations/compare/v1.4.0-dev.4...v1.4.0-dev.5) (2024-02-25)

### Bug Fixes

* **Twitter - Hide ads:** Hide ads in search ([b40687c](b40687c5c7))
* **YouTube - Disable suggested end screen:** Reliably hide end screen ([b4ab5f6](b4ab5f65d5))
2024-02-25 18:30:43 +00:00
oSumAtrIX
b4ab5f65d5 fix(YouTube - Disable suggested end screen): Reliably hide end screen 2024-02-25 19:27:02 +01:00
oSumAtrIX
b40687c5c7 fix(Twitter - Hide ads): Hide ads in search 2024-02-25 07:11:20 +01:00
oSumAtrIX
381fbc6b7b chore: Rename issue templates 2024-02-25 03:37:51 +01:00
oSumAtrIX
80973c77c0 ci: Fix indentation in workflow 2024-02-24 01:14:43 +01:00
oSumAtrIX
216b0060e1 ci: Fix PR builds by adding missing GitHub token 2024-02-23 02:23:49 +01:00
oSumAtrIX
0dc61d9da4 build: Sign release artifacts 2024-02-22 06:13:17 +01:00
oSumAtrIX
4d0db8c4fb ci: Split release into a separate PR build workflow
Because the release workflow already runs on dev and main, it is not necessary to also trigger it for PRs.
2024-02-22 04:23:53 +01:00
semantic-release-bot
9b23f77abe chore(release): 1.4.0-dev.4 [skip ci]
# [1.4.0-dev.4](https://github.com/ReVanced/revanced-integrations/compare/v1.4.0-dev.3...v1.4.0-dev.4) (2024-02-21)

### Features

* **X:** Add `Open links as query` patch ([#570](https://github.com/ReVanced/revanced-integrations/issues/570)) ([95ca632](95ca632d40))
2024-02-21 03:25:53 +00:00
dic1911
95ca632d40 feat(X): Add Open links as query patch (#570)
Co-authored-by: oSumAtrIX <johan.melkonyan1@web.de>
2024-02-21 04:22:32 +01:00
oSumAtrIX
608c520a00 chore: Update comment 2024-02-20 04:35:38 +01:00
oSumAtrIX
2cee15ad88 chore: Refactor build files
This commit improves the build files by using Gradle version catalogs and modernizes the Android build files. Additionally dependencies have been updated and some source files refactored.
2024-02-20 04:19:11 +01:00
oSumAtrIX
6ee90ef788 build: Bump Gradle 2024-02-14 02:41:03 +01:00
semantic-release-bot
2f5973d4a0 chore(release): 1.4.0-dev.3 [skip ci]
# [1.4.0-dev.3](https://github.com/ReVanced/revanced-integrations/compare/v1.4.0-dev.2...v1.4.0-dev.3) (2024-02-13)

### Bug Fixes

* **YouTube - Hide ads:** Do not show error toast and hide full screen ads ([#569](https://github.com/ReVanced/revanced-integrations/issues/569)) ([0b0d46f](0b0d46f518))
2024-02-13 16:12:08 +00:00
LisoUseInAIKyrios
0b0d46f518 fix(YouTube - Hide ads): Do not show error toast and hide full screen ads (#569) 2024-02-13 20:08:57 +04:00
semantic-release-bot
b866036715 chore(release): 1.4.0-dev.2 [skip ci]
# [1.4.0-dev.2](https://github.com/ReVanced/revanced-integrations/compare/v1.4.0-dev.1...v1.4.0-dev.2) (2024-02-09)

### Features

* **Sync for Reddit:** Add `Fix /s/ links` patch ([a8c82ad](a8c82ad27b))
2024-02-09 02:45:31 +00:00
oSumAtrIX
a8c82ad27b feat(Sync for Reddit): Add Fix /s/ links patch 2024-02-09 03:36:04 +01:00
semantic-release-bot
85504f6f65 chore(release): 1.4.0-dev.1 [skip ci]
# [1.4.0-dev.1](https://github.com/ReVanced/revanced-integrations/compare/v1.3.2...v1.4.0-dev.1) (2024-02-09)

### Features

* **YouTube - Change start page:** Add more start pages ([27421fb](27421fb578))
2024-02-09 00:18:03 +00:00
oSumAtrIX
27421fb578 feat(YouTube - Change start page): Add more start pages 2024-02-08 21:10:27 +01:00
semantic-release-bot
f43b71be45 chore(release): 1.3.2 [skip ci]
## [1.3.2](https://github.com/ReVanced/revanced-integrations/compare/v1.3.1...v1.3.2) (2024-02-08)

### Bug Fixes

* **YouTube - Litho Filter:** Ignore null buffers ([#565](https://github.com/ReVanced/revanced-integrations/issues/565)) ([f72faa7](f72faa761c))
2024-02-08 19:18:27 +00:00
oSumAtrIX
bd37368c13 chore: Merge branch dev to main (#566) 2024-02-08 20:15:35 +01:00
semantic-release-bot
cdd8db766e chore(release): 1.3.2-dev.1 [skip ci]
## [1.3.2-dev.1](https://github.com/ReVanced/revanced-integrations/compare/v1.3.1...v1.3.2-dev.1) (2024-02-07)

### Bug Fixes

* **YouTube - Litho Filter:** Ignore null buffers ([#565](https://github.com/ReVanced/revanced-integrations/issues/565)) ([f72faa7](f72faa761c))
2024-02-07 15:28:43 +00:00
LisoUseInAIKyrios
f72faa761c fix(YouTube - Litho Filter): Ignore null buffers (#565) 2024-02-07 19:25:46 +04:00
semantic-release-bot
48b968f3be chore(release): 1.3.1 [skip ci]
## [1.3.1](https://github.com/ReVanced/revanced-integrations/compare/v1.3.0...v1.3.1) (2024-02-07)

### Bug Fixes

* **YouTube - Litho Filter:** Do not show toast if protobuffer is empty or null ([#563](https://github.com/ReVanced/revanced-integrations/issues/563)) ([ea5748c](ea5748ca8e))
2024-02-07 11:50:45 +00:00
oSumAtrIX
9996b2dc02 chore: Merge branch dev to main (#564) 2024-02-07 12:47:47 +01:00
semantic-release-bot
1a4c61d301 chore(release): 1.3.1-dev.1 [skip ci]
## [1.3.1-dev.1](https://github.com/ReVanced/revanced-integrations/compare/v1.3.0...v1.3.1-dev.1) (2024-02-07)

### Bug Fixes

* **YouTube - Litho Filter:** Do not show toast if protobuffer is empty or null ([#563](https://github.com/ReVanced/revanced-integrations/issues/563)) ([ea5748c](ea5748ca8e))
2024-02-07 11:26:35 +00:00
LisoUseInAIKyrios
ea5748ca8e fix(YouTube - Litho Filter): Do not show toast if protobuffer is empty or null (#563) 2024-02-07 15:23:40 +04:00
semantic-release-bot
04c10d8a00 chore(release): 1.3.0 [skip ci]
# [1.3.0](https://github.com/ReVanced/revanced-integrations/compare/v1.2.1...v1.3.0) (2024-02-05)

### Bug Fixes

* **TikTok:** Add missing settings strings ([#561](https://github.com/ReVanced/revanced-integrations/issues/561)) ([04621f8](04621f8a36))
* **YouTube - ReturnYouTubeDislike:** Do not show more than 1 connection toasts if the API is broken ([#560](https://github.com/ReVanced/revanced-integrations/issues/560)) ([2c73209](2c7320937a))
* **YouTube:** Correctly show channel page on tablet devices ([#558](https://github.com/ReVanced/revanced-integrations/issues/558)) ([d0edafb](d0edafb1af))

### Features

* **YouTube - Custom filter:** Custom filtering of the protocol buffer ([#562](https://github.com/ReVanced/revanced-integrations/issues/562)) ([0eb7f3f](0eb7f3f3af))
2024-02-05 19:27:33 +00:00
oSumAtrIX
26345522a7 chore: Merge branch dev to main (#559) 2024-02-05 20:24:42 +01:00
semantic-release-bot
ba3e602569 chore(release): 1.3.0-dev.1 [skip ci]
# [1.3.0-dev.1](https://github.com/ReVanced/revanced-integrations/compare/v1.2.2-dev.3...v1.3.0-dev.1) (2024-02-02)

### Features

* **YouTube - Custom filter:** Custom filtering of the protocol buffer ([#562](https://github.com/ReVanced/revanced-integrations/issues/562)) ([0eb7f3f](0eb7f3f3af))
2024-02-02 08:18:03 +00:00
LisoUseInAIKyrios
0eb7f3f3af feat(YouTube - Custom filter): Custom filtering of the protocol buffer (#562) 2024-02-02 12:15:24 +04:00
semantic-release-bot
fd3ae89918 chore(release): 1.2.2-dev.3 [skip ci]
## [1.2.2-dev.3](https://github.com/ReVanced/revanced-integrations/compare/v1.2.2-dev.2...v1.2.2-dev.3) (2024-01-31)

### Bug Fixes

* **TikTok:** Add missing settings strings ([#561](https://github.com/ReVanced/revanced-integrations/issues/561)) ([04621f8](04621f8a36))
2024-01-31 08:18:21 +00:00
LisoUseInAIKyrios
04621f8a36 fix(TikTok): Add missing settings strings (#561) 2024-01-31 12:15:26 +04:00
semantic-release-bot
38dd645e11 chore(release): 1.2.2-dev.2 [skip ci]
## [1.2.2-dev.2](https://github.com/ReVanced/revanced-integrations/compare/v1.2.2-dev.1...v1.2.2-dev.2) (2024-01-29)

### Bug Fixes

* **YouTube - ReturnYouTubeDislike:** Do not show more than 1 connection toasts if the API is broken ([#560](https://github.com/ReVanced/revanced-integrations/issues/560)) ([2c73209](2c7320937a))
2024-01-29 15:36:39 +00:00
LisoUseInAIKyrios
2c7320937a fix(YouTube - ReturnYouTubeDislike): Do not show more than 1 connection toasts if the API is broken (#560) 2024-01-29 19:33:51 +04:00
semantic-release-bot
f1e0365487 chore(release): 1.2.2-dev.1 [skip ci]
## [1.2.2-dev.1](https://github.com/ReVanced/revanced-integrations/compare/v1.2.1...v1.2.2-dev.1) (2024-01-28)

### Bug Fixes

* **YouTube:** Correctly show channel page on tablet devices ([#558](https://github.com/ReVanced/revanced-integrations/issues/558)) ([d0edafb](d0edafb1af))
2024-01-28 11:59:30 +00:00
LisoUseInAIKyrios
d0edafb1af fix(YouTube): Correctly show channel page on tablet devices (#558) 2024-01-28 12:56:38 +01:00
semantic-release-bot
192faf04ad chore(release): 1.2.1 [skip ci]
## [1.2.1](https://github.com/ReVanced/revanced-integrations/compare/v1.2.0...v1.2.1) (2024-01-28)

### Bug Fixes

* **Twitch:** Correct patch resources to fix build ([fe03467](fe03467839))
2024-01-28 10:53:19 +00:00
oSumAtrIX
c17eae2342 chore: Merge branch dev to main (#557) 2024-01-28 11:50:34 +01:00
104 changed files with 1235 additions and 684 deletions

3
.editorconfig Normal file
View File

@@ -0,0 +1,3 @@
[*.{kt,kts}]
ktlint_code_style = intellij_idea
ktlint_standard_no-wildcard-imports = disabled

View File

@@ -0,0 +1,28 @@
name: Build pull request
on:
workflow_dispatch:
pull_request:
branches:
- dev
jobs:
release:
name: Build
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Cache Gradle
uses: burrunan/gradle-cache-action@v1
- name: Setup Java
run: echo "JAVA_HOME=$JAVA_HOME_17_X64" >> $GITHUB_ENV
- name: Build
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: ./gradlew build --no-daemon

View File

@@ -6,10 +6,6 @@ on:
branches:
- main
- dev
pull_request:
branches:
- main
- dev
jobs:
release:
@@ -44,6 +40,13 @@ jobs:
- name: Install dependencies
run: npm install
- name: Import GPG key
uses: crazy-max/ghaction-import-gpg@v6
with:
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
passphrase: ${{ secrets.GPG_PASSPHRASE }}
fingerprint: ${{ env.GPG_FINGERPRINT }}
- name: Release
env:
GITHUB_TOKEN: ${{ secrets.REPOSITORY_PUSH_ACCESS }}

15
.gitignore vendored
View File

@@ -1,17 +1,12 @@
*.iml
.gradle
/local.properties
/.idea/caches
/.idea/libraries
/.idea/modules.xml
/.idea/workspace.xml
/.idea/navEditor.xml
/.idea/assetWizardSettings.xml
/.idea
/.vscode
.DS_Store
/build
/captures
.externalNativeBuild
.cxx
/.idea
/.vscode
/*.log
node_modules
local.properties
node_modules

View File

@@ -25,7 +25,7 @@
{
"assets": [
{
"path": "app/build/outputs/apk/release/*.apk"
"path": "app/build/outputs/apk/release/revanced-integrations*"
}
],
successComment: false

View File

@@ -1,3 +1,178 @@
## [1.4.1-dev.2](https://github.com/ReVanced/revanced-integrations/compare/v1.4.1-dev.1...v1.4.1-dev.2) (2024-03-04)
### Bug Fixes
* **YouTube - Client spoof:** Allow playback for links with timestamp ([#582](https://github.com/ReVanced/revanced-integrations/issues/582)) ([eee3f35](https://github.com/ReVanced/revanced-integrations/commit/eee3f352c59141f47f6bda6c6cd350f1a16f1450))
## [1.4.1-dev.1](https://github.com/ReVanced/revanced-integrations/compare/v1.4.0...v1.4.1-dev.1) (2024-03-02)
### Bug Fixes
* **YouTube - Announcements:** Only compare ID to not show same announcement after a fix-up ([#579](https://github.com/ReVanced/revanced-integrations/issues/579)) ([5d14f53](https://github.com/ReVanced/revanced-integrations/commit/5d14f53acd0b1eabd6951543edd7d7c662b6c502))
# [1.4.0](https://github.com/ReVanced/revanced-integrations/compare/v1.3.2...v1.4.0) (2024-03-02)
### Bug Fixes
* **Twitter - Hide ads:** Hide ads in search ([b40687c](https://github.com/ReVanced/revanced-integrations/commit/b40687c5c7fa301c78035219b27c0bd85c968bb2))
* **YouTube - Disable suggested end screen:** Reliably hide end screen ([b4ab5f6](https://github.com/ReVanced/revanced-integrations/commit/b4ab5f65d5607678a000783aae14257b845706b5))
* **YouTube - Hide ads:** Do not show error toast and hide full screen ads ([#569](https://github.com/ReVanced/revanced-integrations/issues/569)) ([0b0d46f](https://github.com/ReVanced/revanced-integrations/commit/0b0d46f5183c88f73d58c8f7b9320d38976ddd4e))
* **YouTube - Hide Shorts:** Hide Shorts in feed when using tablet layout ([#572](https://github.com/ReVanced/revanced-integrations/issues/572)) ([7f5e7df](https://github.com/ReVanced/revanced-integrations/commit/7f5e7dfd68ad0200e9ea36d45f18a85ddfe534f8))
* **YouTube - Spoof app version:** Remove broken versions ([#573](https://github.com/ReVanced/revanced-integrations/issues/573)) ([fb4aab7](https://github.com/ReVanced/revanced-integrations/commit/fb4aab792ae93fc7e7decbc19bd71ae700d5d235))
### Features
* **Sync for Reddit:** Add `Fix /s/ links` patch ([a8c82ad](https://github.com/ReVanced/revanced-integrations/commit/a8c82ad27b74e929311536227dee0909ebc27ee1))
* **X:** Add `Open links as query` patch ([#570](https://github.com/ReVanced/revanced-integrations/issues/570)) ([95ca632](https://github.com/ReVanced/revanced-integrations/commit/95ca632d40b90ea8160dbbf33fd5d7f2281cf711))
* **YouTube - Change start page:** Add more start pages ([27421fb](https://github.com/ReVanced/revanced-integrations/commit/27421fb5783e677075ab0c220030d6af64cfaa18))
* **YouTube - Spoof app version:** Add target versions ([#574](https://github.com/ReVanced/revanced-integrations/issues/574)) ([da57fb9](https://github.com/ReVanced/revanced-integrations/commit/da57fb95233ed251518fbd5c56a92bc39c4e0015))
* **YouTube:** Reorganize settings menu ([#571](https://github.com/ReVanced/revanced-integrations/issues/571)) ([eea4a48](https://github.com/ReVanced/revanced-integrations/commit/eea4a48cd565712c09d0ddd35ae256871ebe1964))
# [1.4.0-dev.9](https://github.com/ReVanced/revanced-integrations/compare/v1.4.0-dev.8...v1.4.0-dev.9) (2024-03-02)
### Features
* **YouTube:** Reorganize settings menu ([#571](https://github.com/ReVanced/revanced-integrations/issues/571)) ([eea4a48](https://github.com/ReVanced/revanced-integrations/commit/eea4a48cd565712c09d0ddd35ae256871ebe1964))
# [1.4.0-dev.8](https://github.com/ReVanced/revanced-integrations/compare/v1.4.0-dev.7...v1.4.0-dev.8) (2024-03-02)
### Features
* **YouTube - Spoof app version:** Add target versions ([#574](https://github.com/ReVanced/revanced-integrations/issues/574)) ([da57fb9](https://github.com/ReVanced/revanced-integrations/commit/da57fb95233ed251518fbd5c56a92bc39c4e0015))
# [1.4.0-dev.7](https://github.com/ReVanced/revanced-integrations/compare/v1.4.0-dev.6...v1.4.0-dev.7) (2024-02-29)
### Bug Fixes
* **YouTube - Spoof app version:** Remove broken versions ([#573](https://github.com/ReVanced/revanced-integrations/issues/573)) ([fb4aab7](https://github.com/ReVanced/revanced-integrations/commit/fb4aab792ae93fc7e7decbc19bd71ae700d5d235))
# [1.4.0-dev.6](https://github.com/ReVanced/revanced-integrations/compare/v1.4.0-dev.5...v1.4.0-dev.6) (2024-02-28)
### Bug Fixes
* **YouTube - Hide Shorts:** Hide Shorts in feed when using tablet layout ([#572](https://github.com/ReVanced/revanced-integrations/issues/572)) ([7f5e7df](https://github.com/ReVanced/revanced-integrations/commit/7f5e7dfd68ad0200e9ea36d45f18a85ddfe534f8))
# [1.4.0-dev.5](https://github.com/ReVanced/revanced-integrations/compare/v1.4.0-dev.4...v1.4.0-dev.5) (2024-02-25)
### Bug Fixes
* **Twitter - Hide ads:** Hide ads in search ([b40687c](https://github.com/ReVanced/revanced-integrations/commit/b40687c5c7fa301c78035219b27c0bd85c968bb2))
* **YouTube - Disable suggested end screen:** Reliably hide end screen ([b4ab5f6](https://github.com/ReVanced/revanced-integrations/commit/b4ab5f65d5607678a000783aae14257b845706b5))
# [1.4.0-dev.4](https://github.com/ReVanced/revanced-integrations/compare/v1.4.0-dev.3...v1.4.0-dev.4) (2024-02-21)
### Features
* **X:** Add `Open links as query` patch ([#570](https://github.com/ReVanced/revanced-integrations/issues/570)) ([95ca632](https://github.com/ReVanced/revanced-integrations/commit/95ca632d40b90ea8160dbbf33fd5d7f2281cf711))
# [1.4.0-dev.3](https://github.com/ReVanced/revanced-integrations/compare/v1.4.0-dev.2...v1.4.0-dev.3) (2024-02-13)
### Bug Fixes
* **YouTube - Hide ads:** Do not show error toast and hide full screen ads ([#569](https://github.com/ReVanced/revanced-integrations/issues/569)) ([0b0d46f](https://github.com/ReVanced/revanced-integrations/commit/0b0d46f5183c88f73d58c8f7b9320d38976ddd4e))
# [1.4.0-dev.2](https://github.com/ReVanced/revanced-integrations/compare/v1.4.0-dev.1...v1.4.0-dev.2) (2024-02-09)
### Features
* **Sync for Reddit:** Add `Fix /s/ links` patch ([a8c82ad](https://github.com/ReVanced/revanced-integrations/commit/a8c82ad27b74e929311536227dee0909ebc27ee1))
# [1.4.0-dev.1](https://github.com/ReVanced/revanced-integrations/compare/v1.3.2...v1.4.0-dev.1) (2024-02-09)
### Features
* **YouTube - Change start page:** Add more start pages ([27421fb](https://github.com/ReVanced/revanced-integrations/commit/27421fb5783e677075ab0c220030d6af64cfaa18))
## [1.3.2](https://github.com/ReVanced/revanced-integrations/compare/v1.3.1...v1.3.2) (2024-02-08)
### Bug Fixes
* **YouTube - Litho Filter:** Ignore null buffers ([#565](https://github.com/ReVanced/revanced-integrations/issues/565)) ([f72faa7](https://github.com/ReVanced/revanced-integrations/commit/f72faa761cca306952f270208bee4a8f59c59dda))
## [1.3.2-dev.1](https://github.com/ReVanced/revanced-integrations/compare/v1.3.1...v1.3.2-dev.1) (2024-02-07)
### Bug Fixes
* **YouTube - Litho Filter:** Ignore null buffers ([#565](https://github.com/ReVanced/revanced-integrations/issues/565)) ([f72faa7](https://github.com/ReVanced/revanced-integrations/commit/f72faa761cca306952f270208bee4a8f59c59dda))
## [1.3.1](https://github.com/ReVanced/revanced-integrations/compare/v1.3.0...v1.3.1) (2024-02-07)
### Bug Fixes
* **YouTube - Litho Filter:** Do not show toast if protobuffer is empty or null ([#563](https://github.com/ReVanced/revanced-integrations/issues/563)) ([ea5748c](https://github.com/ReVanced/revanced-integrations/commit/ea5748ca8e0c7130face5ca4c86cfe5e00a3ed65))
## [1.3.1-dev.1](https://github.com/ReVanced/revanced-integrations/compare/v1.3.0...v1.3.1-dev.1) (2024-02-07)
### Bug Fixes
* **YouTube - Litho Filter:** Do not show toast if protobuffer is empty or null ([#563](https://github.com/ReVanced/revanced-integrations/issues/563)) ([ea5748c](https://github.com/ReVanced/revanced-integrations/commit/ea5748ca8e0c7130face5ca4c86cfe5e00a3ed65))
# [1.3.0](https://github.com/ReVanced/revanced-integrations/compare/v1.2.1...v1.3.0) (2024-02-05)
### Bug Fixes
* **TikTok:** Add missing settings strings ([#561](https://github.com/ReVanced/revanced-integrations/issues/561)) ([04621f8](https://github.com/ReVanced/revanced-integrations/commit/04621f8a36490df0b35a3940ecc1fbebd6ee287f))
* **YouTube - ReturnYouTubeDislike:** Do not show more than 1 connection toasts if the API is broken ([#560](https://github.com/ReVanced/revanced-integrations/issues/560)) ([2c73209](https://github.com/ReVanced/revanced-integrations/commit/2c7320937adc01221017c740b86c4d6851c96797))
* **YouTube:** Correctly show channel page on tablet devices ([#558](https://github.com/ReVanced/revanced-integrations/issues/558)) ([d0edafb](https://github.com/ReVanced/revanced-integrations/commit/d0edafb1afc7b87a8eeb085a9e48dc2d20af2f3a))
### Features
* **YouTube - Custom filter:** Custom filtering of the protocol buffer ([#562](https://github.com/ReVanced/revanced-integrations/issues/562)) ([0eb7f3f](https://github.com/ReVanced/revanced-integrations/commit/0eb7f3f3af99bf6566526f9c48db2248d93e166c))
# [1.3.0-dev.1](https://github.com/ReVanced/revanced-integrations/compare/v1.2.2-dev.3...v1.3.0-dev.1) (2024-02-02)
### Features
* **YouTube - Custom filter:** Custom filtering of the protocol buffer ([#562](https://github.com/ReVanced/revanced-integrations/issues/562)) ([0eb7f3f](https://github.com/ReVanced/revanced-integrations/commit/0eb7f3f3af99bf6566526f9c48db2248d93e166c))
## [1.2.2-dev.3](https://github.com/ReVanced/revanced-integrations/compare/v1.2.2-dev.2...v1.2.2-dev.3) (2024-01-31)
### Bug Fixes
* **TikTok:** Add missing settings strings ([#561](https://github.com/ReVanced/revanced-integrations/issues/561)) ([04621f8](https://github.com/ReVanced/revanced-integrations/commit/04621f8a36490df0b35a3940ecc1fbebd6ee287f))
## [1.2.2-dev.2](https://github.com/ReVanced/revanced-integrations/compare/v1.2.2-dev.1...v1.2.2-dev.2) (2024-01-29)
### Bug Fixes
* **YouTube - ReturnYouTubeDislike:** Do not show more than 1 connection toasts if the API is broken ([#560](https://github.com/ReVanced/revanced-integrations/issues/560)) ([2c73209](https://github.com/ReVanced/revanced-integrations/commit/2c7320937adc01221017c740b86c4d6851c96797))
## [1.2.2-dev.1](https://github.com/ReVanced/revanced-integrations/compare/v1.2.1...v1.2.2-dev.1) (2024-01-28)
### Bug Fixes
* **YouTube:** Correctly show channel page on tablet devices ([#558](https://github.com/ReVanced/revanced-integrations/issues/558)) ([d0edafb](https://github.com/ReVanced/revanced-integrations/commit/d0edafb1afc7b87a8eeb085a9e48dc2d20af2f3a))
## [1.2.1](https://github.com/ReVanced/revanced-integrations/compare/v1.2.0...v1.2.1) (2024-01-28)
### Bug Fixes
* **Twitch:** Correct patch resources to fix build ([fe03467](https://github.com/ReVanced/revanced-integrations/commit/fe034678392b3600f03362489f5fd96644b35995))
## [1.2.1-dev.1](https://github.com/ReVanced/revanced-integrations/compare/v1.2.0...v1.2.1-dev.1) (2024-01-27)

2
app/.gitignore vendored
View File

@@ -1 +1 @@
/build
/build

View File

@@ -1,18 +1,27 @@
plugins {
id("com.android.application")
id("org.jetbrains.kotlin.android")
alias(libs.plugins.android.application)
alias(libs.plugins.kotlin)
publishing
}
android {
compileSdk = 33
namespace = "app.revanced.integrations"
compileSdk = 33
applicationVariants.all {
outputs.all {
this as com.android.build.gradle.internal.api.ApkVariantOutputImpl
outputFileName = "${rootProject.name}-$versionName.apk"
}
}
defaultConfig {
applicationId = "app.revanced.integrations"
minSdk = 23
targetSdk = 33
multiDexEnabled = false
versionName = project.version as String
versionName = version as String
}
buildTypes {
@@ -20,32 +29,52 @@ android {
isMinifyEnabled = true
proguardFiles(
getDefaultProguardFile("proguard-android-optimize.txt"),
"proguard-rules.pro"
"proguard-rules.pro",
)
}
applicationVariants.all {
outputs.all {
this as com.android.build.gradle.internal.api.ApkVariantOutputImpl
}
outputFileName = "${rootProject.name}-$versionName.apk"
}
}
}
compileOptions {
sourceCompatibility(JavaVersion.VERSION_11)
targetCompatibility(JavaVersion.VERSION_11)
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
}
kotlinOptions {
jvmTarget = JavaVersion.VERSION_11.toString()
}
}
dependencies {
compileOnly(project(mapOf("path" to ":dummy")))
compileOnly("androidx.annotation:annotation:1.7.0")
compileOnly("androidx.appcompat:appcompat:1.7.0-alpha03")
compileOnly("com.squareup.okhttp3:okhttp:5.0.0-alpha.11")
compileOnly("com.squareup.retrofit2:retrofit:2.9.0")
compileOnly(libs.appcompat)
compileOnly(libs.annotation)
compileOnly(libs.okhttp)
compileOnly(libs.retrofit)
compileOnly(project(":stub"))
}
tasks.register("publish") { dependsOn("build") }
tasks {
// Because the signing plugin doesn't support signing APKs, do it manually.
register("sign") {
group = "signing"
dependsOn(build)
doLast {
val outputDirectory = layout.buildDirectory.dir("outputs/apk/release").get().asFile
val integrationsApk = outputDirectory.resolve("${rootProject.name}-$version.apk")
org.gradle.security.internal.gnupg.GnupgSignatoryFactory().createSignatory(project).sign(
integrationsApk.inputStream(),
outputDirectory.resolve("${integrationsApk.name}.asc").outputStream(),
)
}
}
// Needed by gradle-semantic-release-plugin.
// Tracking: https://github.com/KengoTODA/gradle-semantic-release-plugin/issues/435
publish {
dependsOn(build)
dependsOn("sign")
}
}

View File

@@ -1,27 +1,6 @@
# Add project specific ProGuard rules here.
# You can control the set of applied configuration files using the
# proguardFiles setting in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html
# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}
# Uncomment this to preserve the line number information for
# debugging stack traces.
#-keepattributes SourceFile,LineNumberTable
# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile
-dontobfuscate
-dontoptimize
-keepattributes * # https://www.guardsquare.com/manual/configuration/attributes
-keepattributes *
-keep class app.revanced.** {
*;
}

View File

@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.SCHEDULE_EXACT_ALARM" />
</manifest>

View File

@@ -12,6 +12,7 @@ import android.os.Handler;
import android.os.Looper;
import android.preference.Preference;
import android.preference.PreferenceGroup;
import android.preference.PreferenceScreen;
import android.view.View;
import android.view.ViewGroup;
import android.view.animation.Animation;
@@ -26,10 +27,7 @@ import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import java.text.Bidi;
import java.util.Locale;
import java.util.Objects;
import java.util.SortedMap;
import java.util.TreeMap;
import java.util.*;
import java.util.concurrent.Callable;
import java.util.concurrent.Future;
import java.util.concurrent.SynchronousQueue;
@@ -102,7 +100,6 @@ public class Utils {
view.setVisibility(View.GONE);
}
/**
* General purpose pool for network calls and other background tasks.
* All tasks run at max thread priority.
@@ -205,7 +202,9 @@ public class Utils {
public static <T extends View> T getChildView(@NonNull ViewGroup viewGroup, @NonNull MatchFilter filter) {
for (int i = 0, childCount = viewGroup.getChildCount(); i < childCount; i++) {
View childAt = viewGroup.getChildAt(i);
//noinspection unchecked
if (filter.matches(childAt)) {
//noinspection unchecked
return (T) childAt;
}
}
@@ -345,6 +344,12 @@ public class Utils {
}
}
public enum NetworkType {
NONE,
MOBILE,
OTHER,
}
public static boolean isNetworkConnected() {
NetworkType networkType = getNetworkType();
return networkType == NetworkType.MOBILE
@@ -393,48 +398,104 @@ public class Utils {
}
}
/**
* {@link PreferenceScreen} and {@link PreferenceGroup} sorting styles.
*/
private enum Sort {
/**
* Sort by the localized preference title.
*/
BY_TITLE("_sort_by_title"),
/**
* Sort by the preference keys.
*/
BY_KEY("_sort_by_key"),
/**
* Unspecified sorting.
*/
UNSORTED("_sort_by_unsorted");
final String keySuffix;
Sort(String keySuffix) {
this.keySuffix = keySuffix;
}
/**
* Defaults to {@link #UNSORTED} if key is null or has no sort suffix.
*/
@NonNull
static Sort fromKey(@Nullable String key) {
if (key != null) {
for (Sort sort : values()) {
if (key.endsWith(sort.keySuffix)) {
return sort;
}
}
}
return UNSORTED;
}
}
private static final Regex punctuationRegex = new Regex("\\p{P}+");
/**
* Sort the preferences by title and ignore the casing.
*
* Android Preferences are automatically sorted by title,
* but if using a localized string key it sorts on the key and not the actual title text that's used at runtime.
*
* @param menuDepthToSort Maximum menu depth to sort. Menus deeper than this value
* will show preferences in the order created in patches.
* Strips all punctuation and converts to lower case. A null parameter returns an empty string.
*/
public static void sortPreferenceGroupByTitle(PreferenceGroup group, int menuDepthToSort) {
if (menuDepthToSort == 0) return;
SortedMap<String, Preference> preferences = new TreeMap<>();
for (int i = 0, prefCount = group.getPreferenceCount(); i < prefCount; i++) {
Preference preference = group.getPreference(i);
if (preference instanceof PreferenceGroup) {
sortPreferenceGroupByTitle((PreferenceGroup) preference, menuDepthToSort - 1);
}
preferences.put(removePunctuationConvertToLowercase(preference.getTitle()), preference);
}
int prefIndex = 0;
for (Preference pref : preferences.values()) {
int indexToSet = prefIndex++;
if (pref instanceof PreferenceGroup || pref.getIntent() != null) {
// Place preference groups last.
// Use an offset to push the group to the end.
indexToSet += 1000;
}
pref.setOrder(indexToSet);
}
}
public static String removePunctuationConvertToLowercase(CharSequence original) {
public static String removePunctuationConvertToLowercase(@Nullable CharSequence original) {
if (original == null) return "";
return punctuationRegex.replace(original, "").toLowerCase();
}
public enum NetworkType {
NONE,
MOBILE,
OTHER,
/**
* Sort a PreferenceGroup and all it's sub groups by title or key.
*
* Sort order is determined by the preferences key {@link Sort} suffix.
*
* If a preference has no key or no {@link Sort} suffix,
* then the preferences are left unsorted.
*/
public static void sortPreferenceGroups(@NonNull PreferenceGroup group) {
Sort sort = Sort.fromKey(group.getKey());
SortedMap<String, Preference> preferences = new TreeMap<>();
for (int i = 0, prefCount = group.getPreferenceCount(); i < prefCount; i++) {
Preference preference = group.getPreference(i);
if (preference instanceof PreferenceGroup) {
sortPreferenceGroups((PreferenceGroup) preference);
}
final String sortValue;
switch (sort) {
case BY_TITLE:
sortValue = removePunctuationConvertToLowercase(preference.getTitle());
break;
case BY_KEY:
sortValue = preference.getKey();
break;
case UNSORTED:
continue; // Keep original sorting.
default:
throw new IllegalStateException();
}
preferences.put(sortValue, preference);
}
int index = 0;
for (Preference pref : preferences.values()) {
int order = index++;
// If the preference is a PreferenceScreen or is an intent preference, move to the top.
if (pref instanceof PreferenceScreen || pref.getIntent() != null) {
// Arbitrary high number.
order -= 1000;
}
pref.setOrder(order);
}
}
}

View File

@@ -97,7 +97,7 @@ public abstract class Setting<T> {
@NonNull
private static List<Setting<?>> allLoadedSettingsSorted() {
Collections.sort(SETTINGS, (Setting<?> o1, Setting<?> o2) -> o1.key.compareTo(o2.key));
return Collections.unmodifiableList(SETTINGS);
return allLoadedSettings();
}
/**
@@ -131,6 +131,7 @@ public abstract class Setting<T> {
/**
* Confirmation message to display, if the user tries to change the setting from the default value.
* Currently this works only for Boolean setting types.
*/
@Nullable
public final StringRef userDialogMessage;
@@ -206,10 +207,9 @@ public abstract class Setting<T> {
/**
* Migrate a setting value if the path is renamed but otherwise the old and new settings are identical.
*/
public static void migrateOldSettingToNew(@NonNull Setting<?> oldSetting, @NonNull Setting newSetting) {
public static <T> void migrateOldSettingToNew(@NonNull Setting<T> oldSetting, @NonNull Setting<T> newSetting) {
if (!oldSetting.isSetToDefault()) {
Logger.printInfo(() -> "Migrating old setting value: " + oldSetting + " into replacement setting: " + newSetting);
//noinspection unchecked
newSetting.save(oldSetting.value);
oldSetting.resetToDefault();
}

View File

@@ -7,6 +7,8 @@ import android.content.SharedPreferences;
import android.os.Bundle;
import android.preference.*;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import app.revanced.integrations.shared.Logger;
import app.revanced.integrations.shared.Utils;
import app.revanced.integrations.shared.settings.BooleanSetting;
@@ -25,6 +27,13 @@ public abstract class AbstractPreferenceFragment extends PreferenceFragment {
*/
public static boolean settingImportInProgress;
/**
* Confirm and restart dialog button text and title.
* Set by subclasses if Strings cannot be added as a resource.
*/
@Nullable
protected static String restartDialogButtonText, restartDialogTitle, confirmDialogTitle;
/**
* Used to prevent showing reboot dialog, if user cancels a setting user dialog.
*/
@@ -76,15 +85,19 @@ public abstract class AbstractPreferenceFragment extends PreferenceFragment {
if (identifier == 0) return;
addPreferencesFromResource(identifier);
Utils.sortPreferenceGroupByTitle(getPreferenceScreen(), 2);
Utils.sortPreferenceGroups(getPreferenceScreen());
}
private void showSettingUserDialogConfirmation(SwitchPreference switchPref, BooleanSetting setting) {
final var context = getContext();
Utils.verifyOnMainThread();
final var context = getContext();
if (confirmDialogTitle == null) {
confirmDialogTitle = str("revanced_settings_confirm_user_dialog_title");
}
showingUserDialogMessage = true;
new AlertDialog.Builder(context)
.setTitle(str("revanced_settings_confirm_user_dialog_title"))
.setTitle(confirmDialogTitle)
.setMessage(setting.userDialogMessage.toString())
.setPositiveButton(android.R.string.ok, (dialog, id) -> {
if (setting.rebootApp) {
@@ -201,12 +214,17 @@ public abstract class AbstractPreferenceFragment extends PreferenceFragment {
}
public static void showRestartDialog(@NonNull final Context context) {
String positiveButton = str("revanced_settings_restart");
new AlertDialog.Builder(context).setMessage(str("revanced_settings_restart_title"))
.setPositiveButton(positiveButton, (dialog, id) -> {
Utils.restartApp(context);
})
Utils.verifyOnMainThread();
if (restartDialogTitle == null) {
restartDialogTitle = str("revanced_settings_restart_title");
}
if (restartDialogButtonText == null) {
restartDialogButtonText = str("revanced_settings_restart");
}
new AlertDialog.Builder(context)
.setMessage(restartDialogTitle)
.setPositiveButton(restartDialogButtonText, (dialog, id)
-> Utils.restartApp(context))
.setNegativeButton(android.R.string.cancel, null)
.setCancelable(false)
.show();

View File

@@ -0,0 +1,42 @@
package app.revanced.integrations.syncforreddit;
import android.os.StrictMode;
import app.revanced.integrations.shared.Logger;
import java.net.HttpURLConnection;
import java.net.URL;
public final class FixSLinksPatch {
public static String resolveSLink(String link) {
if (link.matches(".*reddit\\.com/r/[^/]+/s/[^/]+")) {
Logger.printInfo(() -> "Resolving " + link);
try {
URL url = new URL(link);
HttpURLConnection connection = (HttpURLConnection) url.openConnection();
connection.setInstanceFollowRedirects(false);
connection.setRequestMethod("HEAD");
// Disable strict mode in order to allow network access on the main thread.
// This is not ideal, but it's the easiest solution for now.
final var currentPolicy = StrictMode.getThreadPolicy();
StrictMode.ThreadPolicy policy = new StrictMode.ThreadPolicy.Builder().permitAll().build();
StrictMode.setThreadPolicy(policy);
connection.connect();
String location = connection.getHeaderField("location");
connection.disconnect();
// Restore the original strict mode policy.
StrictMode.setThreadPolicy(currentPolicy);
Logger.printInfo(() -> "Resolved " + link + " -> " + location);
return location;
} catch (Exception e) {
Logger.printException(() -> "Failed to resolve " + link, e);
}
}
return link;
}
}

View File

@@ -17,6 +17,12 @@ public class ReVancedPreferenceFragment extends AbstractPreferenceFragment {
protected void initialize() {
final var context = getContext();
// Currently no resources can be compiled for TikTok (fails with aapt error).
// So all TikTok Strings are hard coded in integrations.
restartDialogTitle = "Refresh and restart";
restartDialogButtonText = "Restart";
confirmDialogTitle = "Do you wish to proceed?";
PreferenceScreen preferenceScreen = getPreferenceManager().createPreferenceScreen(context);
setPreferenceScreen(preferenceScreen);

View File

@@ -28,7 +28,7 @@ public class AppCompatActivityHook {
public static void startSettingsActivity() {
Logger.printDebug(() -> "Launching ReVanced settings");
final var context = app.revanced.integrations.shared.Utils.getContext();
final var context = Utils.getContext();
if (context != null) {
Intent intent = new Intent(context, SettingsActivity.class);

View File

@@ -6,4 +6,4 @@ abstract class BaseJsonHook : JsonHook {
abstract fun apply(json: JSONObject)
override fun transform(json: JSONObject) = json.apply { apply(json) }
}
}

View File

@@ -12,4 +12,4 @@ interface JsonHook : Hook<JSONObject> {
fun transform(json: JSONObject): JSONObject
override fun hook(type: JSONObject) = transform(type)
}
}

View File

@@ -27,4 +27,4 @@ object JsonHookPatch {
return StreamUtils.fromString(jsonObject.toString())
}
}
}

View File

@@ -6,4 +6,4 @@ interface Hook<T> {
* @param type The type to hook
*/
fun hook(type: T): T
}
}

View File

@@ -4,7 +4,6 @@ import app.revanced.integrations.twitter.patches.hook.json.BaseJsonHook
import app.revanced.integrations.twitter.patches.hook.twifucker.TwiFucker
import org.json.JSONObject
object AdsHook : BaseJsonHook() {
/**
* Strips JSONObject from promoted ads.
@@ -12,4 +11,4 @@ object AdsHook : BaseJsonHook() {
* @param json The JSONObject.
*/
override fun apply(json: JSONObject) = TwiFucker.hidePromotedAds(json)
}
}

View File

@@ -11,4 +11,4 @@ object DummyHook : BaseJsonHook() {
override fun apply(json: JSONObject) {
// Do nothing.
}
}
}

View File

@@ -4,7 +4,6 @@ import app.revanced.integrations.twitter.patches.hook.json.BaseJsonHook
import app.revanced.integrations.twitter.patches.hook.twifucker.TwiFucker
import org.json.JSONObject
object RecommendedUsersHook : BaseJsonHook() {
/**
* Strips JSONObject from recommended users.
@@ -12,4 +11,4 @@ object RecommendedUsersHook : BaseJsonHook() {
* @param json The JSONObject.
*/
override fun apply(json: JSONObject) = TwiFucker.hideRecommendedUsers(json)
}
}

View File

@@ -9,8 +9,7 @@ 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.jsonGetInstructions(): JSONArray? = optJSONObject("timeline")?.optJSONArray("instructions")
private fun JSONObject.jsonGetData(): JSONObject? = optJSONObject("data")
@@ -42,10 +41,12 @@ internal object TwiFucker {
// 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")
val timeline =
optJSONObject("user_result")?.optJSONObject("result")
?.optJSONObject("timeline_response")?.optJSONObject("timeline")
?: optJSONObject("timeline_response")?.optJSONObject("timeline")
?: optJSONObject("search")?.optJSONObject("timeline_response")?.optJSONObject("timeline")
?: optJSONObject("timeline_response")
return timeline?.optJSONArray("instructions")
}
@@ -64,7 +65,6 @@ internal object TwiFucker {
}
}?.optJSONObject("legacy")
// entry
private fun JSONObject.entryHasPromotedMetadata(): Boolean =
optJSONObject("content")?.optJSONObject("item")?.optJSONObject("content")
@@ -77,11 +77,9 @@ internal object TwiFucker {
optJSONObject("content")?.optJSONArray("items")
?: optJSONObject("content")?.optJSONObject("timelineModule")?.optJSONArray("items")
private fun JSONObject.entryIsTweetDetailRelatedTweets(): Boolean =
optString("entryId").startsWith("tweetdetailrelatedtweets-")
private fun JSONObject.entryIsTweetDetailRelatedTweets(): Boolean = optString("entryId").startsWith("tweetdetailrelatedtweets-")
private fun JSONObject.entryGetTrends(): JSONArray? =
optJSONObject("content")?.optJSONObject("timelineModule")?.optJSONArray("items")
private fun JSONObject.entryGetTrends(): JSONArray? = optJSONObject("content")?.optJSONObject("timelineModule")?.optJSONArray("items")
// trend
private fun JSONObject.trendHasPromotedMetadata(): Boolean =
@@ -104,8 +102,7 @@ internal object TwiFucker {
// instruction
private fun JSONObject.instructionTimelineAddEntries(): JSONArray? = optJSONArray("entries")
private fun JSONObject.instructionGetAddEntries(): JSONArray? =
optJSONObject("addEntries")?.optJSONArray("entries")
private fun JSONObject.instructionGetAddEntries(): JSONArray? = optJSONObject("addEntries")?.optJSONArray("entries")
private fun JSONObject.instructionCheckAndRemove(action: (JSONArray) -> Unit) {
instructionTimelineAddEntries()?.let(action)
@@ -164,9 +161,10 @@ internal object TwiFucker {
entriesRemoveTweetDetailRelatedTweets()
}
private fun JSONObject.entryIsWhoToFollow(): Boolean = optString("entryId").let {
it.startsWith("whoToFollow-") || it.startsWith("who-to-follow-") || it.startsWith("connect-module-")
}
private fun JSONObject.entryIsWhoToFollow(): Boolean =
optString("entryId").let {
it.startsWith("whoToFollow-") || it.startsWith("who-to-follow-") || it.startsWith("connect-module-")
}
private fun JSONObject.itemContainsPromotedUser(): Boolean =
optJSONObject("item")?.optJSONObject("content")
@@ -217,4 +215,4 @@ internal object TwiFucker {
instruction.instructionCheckAndRemove(action)
}
}
}
}

View File

@@ -0,0 +1,12 @@
package app.revanced.integrations.twitter.patches.links;
import android.content.Context;
import android.content.Intent;
public final class OpenLinksWithAppChooserPatch {
public static void openWithChooser(final Context context, final Intent intent) {
intent.setAction("android.intent.action.VIEW");
context.startActivity(Intent.createChooser(intent, null));
}
}

View File

@@ -10,4 +10,4 @@ object JsonUtils {
@JvmStatic
@Throws(IOException::class, JSONException::class)
fun parseJson(jsonInputStream: InputStream) = JSONObject(StreamUtils.toString(jsonInputStream))
}
}

View File

@@ -21,4 +21,4 @@ object StreamUtils {
fun fromString(string: String): InputStream {
return ByteArrayInputStream(string.toByteArray())
}
}
}

View File

@@ -27,4 +27,3 @@ class Event<T> {
observer.invoke(value)
}
}

View File

@@ -231,47 +231,57 @@ public abstract class TrieSearch<T> {
}
/**
* This method is static and uses a loop to avoid all recursion.
* This is done for performance since the JVM does not do tail recursion optimization.
*
* @param startNode Node to start the search from.
* @param searchText Text to search for patterns in.
* @param searchTextLength Length of the search text.
* @param searchTextIndex Current recursive search text index. Also, the end index of the current pattern match.
* @param currentMatchLength current search depth, and also the length of the current pattern match.
* @return If any pattern matches, and it's associated callback halted the search.
*/
private boolean matches(T searchText, int searchTextLength, int searchTextIndex, int currentMatchLength,
Object callbackParameter) {
if (leaf != null && leaf.matches(this,
searchText, searchTextLength, searchTextIndex, callbackParameter)) {
return true; // Leaf exists and it matched the search text.
}
if (endOfPatternCallback != null) {
final int matchStartIndex = searchTextIndex - currentMatchLength;
for (@Nullable TriePatternMatchedCallback<T> callback : endOfPatternCallback) {
if (callback == null) {
return true; // No callback and all matches are valid.
}
if (callback.patternMatched(searchText, matchStartIndex, currentMatchLength, callbackParameter)) {
return true; // Callback confirmed the match.
private static <T> boolean matches(final TrieNode<T> startNode, final T searchText, final int searchTextLength,
int searchTextIndex, final Object callbackParameter) {
TrieNode<T> node = startNode;
int currentMatchLength = 0;
while (true) {
TrieCompressedPath<T> leaf = node.leaf;
if (leaf != null && leaf.matches(node, searchText, searchTextLength, searchTextIndex, callbackParameter)) {
return true; // Leaf exists and it matched the search text.
}
List<TriePatternMatchedCallback<T>> endOfPatternCallback = node.endOfPatternCallback;
if (endOfPatternCallback != null) {
final int matchStartIndex = searchTextIndex - currentMatchLength;
for (@Nullable TriePatternMatchedCallback<T> callback : endOfPatternCallback) {
if (callback == null) {
return true; // No callback and all matches are valid.
}
if (callback.patternMatched(searchText, matchStartIndex, currentMatchLength, callbackParameter)) {
return true; // Callback confirmed the match.
}
}
}
}
if (children == null) {
return false; // Reached a graph end point and there's no further patterns to search.
}
if (searchTextIndex == searchTextLength) {
return false; // Reached end of the search text and found no matches.
}
TrieNode<T>[] children = node.children;
if (children == null) {
return false; // Reached a graph end point and there's no further patterns to search.
}
if (searchTextIndex == searchTextLength) {
return false; // Reached end of the search text and found no matches.
}
final char character = getCharValue(searchText, searchTextIndex);
if (isInvalidRange(character)) {
return false; // Not an ASCII letter/number/symbol.
// Use the start node to reduce VM method lookup, since all nodes are the same class type.
final char character = startNode.getCharValue(searchText, searchTextIndex);
final int arrayIndex = hashIndexForTableSize(children.length, character);
TrieNode<T> child = children[arrayIndex];
if (child == null || child.nodeValue != character) {
return false;
}
node = child;
searchTextIndex++;
currentMatchLength++;
}
final int arrayIndex = hashIndexForTableSize(children.length, character);
TrieNode<T> child = children[arrayIndex];
if (child == null || child.nodeValue != character) {
return false;
}
return child.matches(searchText, searchTextLength, searchTextIndex + 1,
currentMatchLength + 1, callbackParameter);
}
/**
@@ -388,7 +398,7 @@ public abstract class TrieSearch<T> {
return false; // No patterns were added.
}
for (int i = startIndex; i < endIndex; i++) {
if (root.matches(textToSearch, endIndex, i, 0, callbackParameter)) return true;
if (TrieNode.matches(root, textToSearch, endIndex, i, callbackParameter)) return true;
}
return false;
}

Some files were not shown because too many files have changed in this diff Show More