Compare commits

...

72 Commits

Author SHA1 Message Date
semantic-release-bot
50c2b3921c chore(release): 1.3.0-dev.1 [skip ci]
# [1.3.0-dev.1](https://github.com/ReVanced/revanced-library/compare/v1.2.1-dev.1...v1.3.0-dev.1) (2023-11-26)

### Bug Fixes

* Delete mount script ([4fe0fb0](4fe0fb0a61))

### Features

* Increase certainty of the possibility to mount ([10f8cd1](10f8cd1470))
* Select first Adb device, if none supplied automatically ([1a5f868](1a5f868ecd))
2023-11-26 04:19:57 +00:00
oSumAtrIX
10f8cd1470 feat: Increase certainty of the possibility to mount 2023-11-26 05:16:38 +01:00
oSumAtrIX
1a5f868ecd feat: Select first Adb device, if none supplied automatically 2023-11-26 05:11:58 +01:00
oSumAtrIX
969ca16b77 refactor: Simplify checking for installed app 2023-11-25 03:30:08 +01:00
oSumAtrIX
4fe0fb0a61 fix: Delete mount script 2023-11-25 03:16:55 +01:00
oSumAtrIX
462a35ddcd chore: Add heading to issue templates 2023-11-23 00:56:52 +01:00
oSumAtrIX
00e1895c0f build: Bump Gradle wrapper 2023-11-22 00:59:43 +01:00
oSumAtrIX
75d4c658b9 build: Use dedicated Gradle cache action 2023-11-22 00:45:42 +01:00
oSumAtrIX
2e54af8f82 build: Use Gradle build cache 2023-11-22 00:26:39 +01:00
oSumAtrIX
143c13b175 ci: Simplify cache paths 2023-11-22 00:11:17 +01:00
oSumAtrIX
ed8ab35d60 chore: Reword comment for first PR merge 2023-11-22 00:07:42 +01:00
oSumAtrIX
97bf79be27 chore: Add a newline between steps 2023-11-22 00:04:37 +01:00
oSumAtrIX
1cbf407ce2 chore: Notice about contribution guidelines in issue templates 2023-11-22 00:01:23 +01:00
oSumAtrIX
5b3a597ad7 chore: Remove irrelevant example from issue template 2023-11-21 23:57:39 +01:00
oSumAtrIX
b0fe1c8bfc chore: Do not use a line break in issue template sentence 2023-11-21 23:48:28 +01:00
oSumAtrIX
3331a3cc3a build: Bump dependencies 2023-11-21 23:43:48 +01:00
oSumAtrIX
a00146c6f1 chore: Update packages 2023-11-21 23:41:54 +01:00
semantic-release-bot
e23d21c982 chore(release): 1.2.1-dev.1 [skip ci]
## [1.2.1-dev.1](https://github.com/ReVanced/revanced-library/compare/v1.2.0...v1.2.1-dev.1) (2023-11-13)

### Bug Fixes

* Add missing log when calling `UserAdbManager#install` ([90b612b](90b612bee8))
2023-11-13 00:20:46 +00:00
oSumAtrIX
90b612bee8 fix: Add missing log when calling UserAdbManager#install 2023-11-13 01:19:20 +01:00
semantic-release-bot
49e6081286 chore(release): 1.2.0 [skip ci]
# [1.2.0](https://github.com/ReVanced/revanced-library/compare/v1.1.5...v1.2.0) (2023-11-03)

### Bug Fixes

* Catch exceptions when serializing invalid patch options ([cd73bd3](cd73bd39ce))

### Features

* Log warnings when compiling resources ([1dc8e2e](1dc8e2e2eb))
* Use better log messages when handling exceptions ([5896968](5896968358))
2023-11-03 17:20:21 +00:00
oSumAtrIX
de4276630b chore: Merge branch dev to main (#15) 2023-11-03 18:18:22 +01:00
semantic-release-bot
9d39995f48 chore(release): 1.2.0-dev.2 [skip ci]
# [1.2.0-dev.2](https://github.com/ReVanced/revanced-library/compare/v1.2.0-dev.1...v1.2.0-dev.2) (2023-11-03)

### Features

* Log warnings when compiling resources ([1dc8e2e](1dc8e2e2eb))
2023-11-03 00:24:24 +00:00
oSumAtrIX
1dc8e2e2eb feat: Log warnings when compiling resources
The logger in class `brut.util.OS` is responsible for logging the standard error output stream from invoking AAPT. Previously,only loggers with the name starting with `app.revanced` were shown.
2023-11-03 01:22:52 +01:00
oSumAtrIX
6555fcdffe chore: Fix builds from bumping dependencies 2023-11-03 01:21:23 +01:00
semantic-release-bot
8b89993505 chore(release): 1.2.0-dev.1 [skip ci]
# [1.2.0-dev.1](https://github.com/ReVanced/revanced-library/compare/v1.1.5...v1.2.0-dev.1) (2023-10-31)

### Bug Fixes

* Catch exceptions when serializing invalid patch options ([cd73bd3](cd73bd39ce))

### Features

* Use better log messages when handling exceptions ([5896968](5896968358))
2023-10-31 13:30:54 +00:00
oSumAtrIX
5896968358 feat: Use better log messages when handling exceptions 2023-10-31 14:28:21 +01:00
oSumAtrIX
cd73bd39ce fix: Catch exceptions when serializing invalid patch options 2023-10-31 14:23:54 +01:00
oSumAtrIX
77416b6bf4 build: Bump dependencies 2023-10-31 14:18:41 +01:00
semantic-release-bot
4227a57fc7 chore(release): 1.1.5 [skip ci]
## [1.1.5](https://github.com/ReVanced/revanced-library/compare/v1.1.4...v1.1.5) (2023-10-23)
2023-10-23 00:06:24 +00:00
oSumAtrIX
cc3de84d25 chore: Merge branch dev to main (#14) 2023-10-23 02:04:28 +02:00
semantic-release-bot
0545341f9a chore(release): 1.1.5-dev.1 [skip ci]
## [1.1.5-dev.1](https://github.com/ReVanced/revanced-library/compare/v1.1.4...v1.1.5-dev.1) (2023-10-23)
2023-10-23 00:03:37 +00:00
oSumAtrIX
035870e08d build: Simplify declaration of repositories 2023-10-22 23:37:19 +02:00
oSumAtrIX
b58ea35f6a build(Needs bump): Bump dependencies 2023-10-22 23:36:31 +02:00
oSumAtrIX
3f61394f0a build: Bump Kotlin Gradle plugin version 2023-10-22 16:14:45 +02:00
semantic-release-bot
9536413fa3 chore(release): 1.1.4 [skip ci]
## [1.1.4](https://github.com/ReVanced/revanced-library/compare/v1.1.3...v1.1.4) (2023-10-12)

### Bug Fixes

* Ask for root permissions before trying to use them ([aea1d69](aea1d69157))
* Execute ADB commands sequentially to fix mounting issues ([#12](https://github.com/ReVanced/revanced-library/issues/12)) ([fda3eca](fda3eca74f))
2023-10-12 19:49:25 +00:00
oSumAtrIX
7b1ca25a6c chore: Merge branch dev to main (#13) 2023-10-12 21:47:46 +02:00
semantic-release-bot
79640bcb8c chore(release): 1.1.4-dev.2 [skip ci]
## [1.1.4-dev.2](https://github.com/ReVanced/revanced-library/compare/v1.1.4-dev.1...v1.1.4-dev.2) (2023-10-10)

### Bug Fixes

* Ask for root permissions before trying to use them ([aea1d69](aea1d69157))
2023-10-10 08:25:22 +00:00
oSumAtrIX
aea1d69157 fix: Ask for root permissions before trying to use them 2023-10-10 10:23:39 +02:00
oSumAtrIX
7a6977aff2 refactor: Remove unnecessary function 2023-10-10 10:23:00 +02:00
semantic-release-bot
c221ab1482 chore(release): 1.1.4-dev.1 [skip ci]
## [1.1.4-dev.1](https://github.com/ReVanced/revanced-library/compare/v1.1.3...v1.1.4-dev.1) (2023-10-09)

### Bug Fixes

* Execute ADB commands sequentially to fix mounting issues ([#12](https://github.com/ReVanced/revanced-library/issues/12)) ([fda3eca](fda3eca74f))
2023-10-09 23:24:41 +00:00
Riccardo Nava
fda3eca74f fix: Execute ADB commands sequentially to fix mounting issues (#12) 2023-10-10 01:22:45 +02:00
semantic-release-bot
d2e367e901 chore(release): 1.1.3 [skip ci]
## [1.1.3](https://github.com/ReVanced/revanced-library/compare/v1.1.2...v1.1.3) (2023-10-09)
2023-10-09 16:57:58 +00:00
oSumAtrIX
3e460805bc chore: Merge branch dev to main (#11) 2023-10-09 18:56:03 +02:00
semantic-release-bot
6019320d9e chore(release): 1.1.3-dev.2 [skip ci]
## [1.1.3-dev.2](https://github.com/ReVanced/revanced-library/compare/v1.1.3-dev.1...v1.1.3-dev.2) (2023-10-09)
2023-10-09 16:53:41 +00:00
oSumAtrIX
0dc83c3e0a build(Needs bump): Use correct dependency 2023-10-09 18:51:32 +02:00
semantic-release-bot
dc0c9f6cc9 chore(release): 1.1.3-dev.1 [skip ci]
## [1.1.3-dev.1](https://github.com/ReVanced/revanced-library/compare/v1.1.2...v1.1.3-dev.1) (2023-10-09)
2023-10-09 16:44:17 +00:00
oSumAtrIX
33f48f1f3f build(Needs bump): Publish artifacts on Jitpack 2023-10-09 18:42:16 +02:00
semantic-release-bot
9de5348351 chore(release): 1.1.2 [skip ci]
## [1.1.2](https://github.com/ReVanced/revanced-library/compare/v1.1.1...v1.1.2) (2023-10-05)
2023-10-05 15:56:13 +00:00
oSumAtrIX
adfb41c737 chore: Merge branch dev to main (#10) 2023-10-05 17:54:11 +02:00
semantic-release-bot
5024ea3313 chore(release): 1.1.2-dev.1 [skip ci]
## [1.1.2-dev.1](https://github.com/ReVanced/revanced-library/compare/v1.1.1...v1.1.2-dev.1) (2023-10-05)
2023-10-05 15:35:24 +00:00
oSumAtrIX
c61d90462f build(Needs bump): Bump dependencies 2023-10-05 17:29:37 +02:00
semantic-release-bot
8263175a8e chore(release): 1.1.1 [skip ci]
## [1.1.1](https://github.com/ReVanced/revanced-library/compare/v1.1.0...v1.1.1) (2023-10-04)

### Performance Improvements

* Use maps to set options ([13823b7](13823b74db))
2023-10-04 02:24:57 +00:00
oSumAtrIX
17694e2d8a chore: Merge branch dev to main (#9) 2023-10-04 04:23:15 +02:00
semantic-release-bot
e232577e33 chore(release): 1.1.1-dev.1 [skip ci]
## [1.1.1-dev.1](https://github.com/ReVanced/revanced-library/compare/v1.1.0...v1.1.1-dev.1) (2023-10-04)

### Performance Improvements

* Use maps to set options ([13823b7](13823b74db))
2023-10-04 02:22:01 +00:00
oSumAtrIX
771c9d7165 build(Needs bump): Bump dependencies 2023-10-04 04:20:11 +02:00
oSumAtrIX
13823b74db perf: Use maps to set options 2023-10-04 04:08:07 +02:00
oSumAtrIX
fbe5c39227 build: Bump dependencies 2023-10-02 15:38:38 +02:00
semantic-release-bot
c6e85466ed chore(release): 1.1.0 [skip ci]
# [1.1.0](https://github.com/ReVanced/revanced-library/compare/v1.0.1...v1.1.0) (2023-10-01)

### Bug Fixes

* Only load the keystore once per instantiation ([5993f7e](5993f7e568))
* Use correct function name casing ([ef38d8b](ef38d8b4bf))

### Features

* Increase the key size to 4096 ([892e083](892e0835c6))
2023-10-01 17:06:40 +00:00
oSumAtrIX
2ec24dbb70 chore: Merge branch dev to main (#8) 2023-10-01 19:04:59 +02:00
oSumAtrIX
9fd895cb56 ci: Bump checkout action 2023-09-27 18:02:49 +02:00
semantic-release-bot
c3f297b65d chore(release): 1.1.0-dev.2 [skip ci]
# [1.1.0-dev.2](https://github.com/ReVanced/revanced-library/compare/v1.1.0-dev.1...v1.1.0-dev.2) (2023-09-25)

### Bug Fixes

* Use correct function name casing ([ef38d8b](ef38d8b4bf))
2023-09-25 18:10:37 +00:00
oSumAtrIX
ef38d8b4bf fix: Use correct function name casing 2023-09-25 20:09:07 +02:00
semantic-release-bot
59ab008030 chore(release): 1.1.0-dev.1 [skip ci]
# [1.1.0-dev.1](https://github.com/ReVanced/revanced-library/compare/v1.0.2-dev.1...v1.1.0-dev.1) (2023-09-25)

### Features

* Increase the key size to 4096 ([892e083](892e0835c6))
2023-09-25 17:10:21 +00:00
oSumAtrIX
892e0835c6 feat: Increase the key size to 4096 2023-09-25 19:08:42 +02:00
semantic-release-bot
fc61954e5d chore(release): 1.0.2-dev.1 [skip ci]
## [1.0.2-dev.1](https://github.com/ReVanced/revanced-library/compare/v1.0.1...v1.0.2-dev.1) (2023-09-25)

### Bug Fixes

* Only load the keystore once per instantiation ([5993f7e](5993f7e568))
2023-09-25 17:03:40 +00:00
oSumAtrIX
5993f7e568 fix: Only load the keystore once per instantiation 2023-09-25 19:02:07 +02:00
semantic-release-bot
fda383ade5 chore(release): 1.0.1 [skip ci]
## [1.0.1](https://github.com/ReVanced/revanced-library/compare/v1.0.0...v1.0.1) (2023-09-24)

### Bug Fixes

* Check if file exists before trying to open it ([8ddc6e9](8ddc6e9d6f))
2023-09-24 22:01:32 +00:00
oSumAtrIX
5aab127d9b chore: Merge branch dev to main (#5) 2023-09-24 23:59:58 +02:00
semantic-release-bot
f0b3eb7800 chore(release): 1.0.1-dev.1 [skip ci]
## [1.0.1-dev.1](https://github.com/ReVanced/revanced-library/compare/v1.0.0...v1.0.1-dev.1) (2023-09-24)

### Bug Fixes

* Check if file exists before trying to open it ([8ddc6e9](8ddc6e9d6f))
2023-09-24 20:40:37 +00:00
oSumAtrIX
8ddc6e9d6f fix: Check if file exists before trying to open it 2023-09-24 22:36:37 +02:00
semantic-release-bot
9db89f0aac chore(release): 1.0.0 [skip ci]
# 1.0.0 (2023-09-23)

### Features

* Add initial project structure ([833291d](833291dc68))
2023-09-23 16:09:07 +00:00
oSumAtrIX
dfea9492ed chore: Merge branch dev to main (#1) 2023-09-23 18:07:25 +02:00
26 changed files with 7097 additions and 2077 deletions

View File

@@ -6,12 +6,72 @@ body:
- type: markdown
attributes:
value: |
<p align="center">
<picture>
<source
width="256px"
media="(prefers-color-scheme: dark)"
srcset="https://raw.githubusercontent.com/revanced/revanced-library/main/assets/revanced-headline/revanced-headline-vertical-dark.svg"
>
<img
width="256px"
src="https://raw.githubusercontent.com/revanced/revanced-library/main/assets/revanced-headline/revanced-headline-vertical-light.svg"
>
</picture>
<br>
<a href="https://revanced.app/">
<picture>
<source height="24px" media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/revanced/revanced-library/main/assets/revanced-logo/revanced-logo.svg" />
<img height="24px" src="https://raw.githubusercontent.com/revanced/revanced-library/main/assets/revanced-logo/revanced-logo.svg" />
</picture>
</a>&nbsp;&nbsp;&nbsp;
<a href="https://github.com/ReVanced">
<picture>
<source height="24px" media="(prefers-color-scheme: dark)" srcset="https://i.ibb.co/dMMmCrW/Git-Hub-Mark.png" />
<img height="24px" src="https://i.ibb.co/9wV3HGF/Git-Hub-Mark-Light.png" />
</picture>
</a>&nbsp;&nbsp;&nbsp;
<a href="http://revanced.app/discord">
<picture>
<source height="24px" media="(prefers-color-scheme: dark)" srcset="https://user-images.githubusercontent.com/13122796/178032563-d4e084b7-244e-4358-af50-26bde6dd4996.png" />
<img height="24px" src="https://user-images.githubusercontent.com/13122796/178032563-d4e084b7-244e-4358-af50-26bde6dd4996.png" />
</picture>
</a>&nbsp;&nbsp;&nbsp;
<a href="https://reddit.com/r/revancedapp">
<picture>
<source height="24px" media="(prefers-color-scheme: dark)" srcset="https://user-images.githubusercontent.com/13122796/178032351-9d9d5619-8ef7-470a-9eec-2744ece54553.png" />
<img height="24px" src="https://user-images.githubusercontent.com/13122796/178032351-9d9d5619-8ef7-470a-9eec-2744ece54553.png" />
</picture>
</a>&nbsp;&nbsp;&nbsp;
<a href="https://t.me/app_revanced">
<picture>
<source height="24px" media="(prefers-color-scheme: dark)" srcset="https://user-images.githubusercontent.com/13122796/178032213-faf25ab8-0bc3-4a94-a730-b524c96df124.png" />
<img height="24px" src="https://user-images.githubusercontent.com/13122796/178032213-faf25ab8-0bc3-4a94-a730-b524c96df124.png" />
</picture>
</a>&nbsp;&nbsp;&nbsp;
<a href="https://x.com/revancedapp">
<picture>
<source media="(prefers-color-scheme: dark)" srcset="https://user-images.githubusercontent.com/93124920/270180600-7c1b38bf-889b-4d68-bd5e-b9d86f91421a.png">
<img height="24px" src="https://user-images.githubusercontent.com/93124920/270108715-d80743fa-b330-4809-b1e6-79fbdc60d09c.png" />
</picture>
</a>&nbsp;&nbsp;&nbsp;
<a href="https://www.youtube.com/@ReVanced">
<picture>
<source height="24px" media="(prefers-color-scheme: dark)" srcset="https://user-images.githubusercontent.com/13122796/178032714-c51c7492-0666-44ac-99c2-f003a695ab50.png" />
<img height="24px" src="https://user-images.githubusercontent.com/13122796/178032714-c51c7492-0666-44ac-99c2-f003a695ab50.png" />
</picture>
</a>
<br>
<br>
Continuing the legacy of Vanced
</p>
# ReVanced Library bug report
Please check for existing bug reports
[here](https://github.com/ReVanced/revanced-library/labels/Bug%20report)
before creating a new one.
Before creating a new bug report, please keep the following in mind:
- **Do not submit a duplicate bug report**: You can review existing bug reports [here](https://github.com/ReVanced/revanced-library/labels/Bug%20report).
- **Do not use the issue page for support**: If you need help or have questions, check out other platforms on [revanced.app](https://revanced.app).
- type: textarea
attributes:
label: Bug description
@@ -19,7 +79,6 @@ body:
- Describe your bug in detail
- Add steps to reproduce the bug if possible (Step 1. ... Step 2. ...)
- Add images and videos if possible
- List used patches if applicable
validations:
required: true
- type: textarea
@@ -39,11 +98,12 @@ body:
id: acknowledgements
attributes:
label: Acknowledgements
description: Your issue will be closed if you don't follow the checklist below.
description: Your bug report will be closed if you don't follow the checklist below.
options:
- label: This request is not a duplicate of an existing issue.
- label: This issue is not a duplicate of an existing bug report.
required: true
- label: I have chosen an appropriate title.
required: true
- label: All requested information has been provided properly.
required: true

View File

@@ -6,12 +6,73 @@ body:
- type: markdown
attributes:
value: |
<p align="center">
<picture>
<source
width="256px"
media="(prefers-color-scheme: dark)"
srcset="https://raw.githubusercontent.com/revanced/revanced-library/main/assets/revanced-headline/revanced-headline-vertical-dark.svg"
>
<img
width="256px"
src="https://raw.githubusercontent.com/revanced/revanced-library/main/assets/revanced-headline/revanced-headline-vertical-light.svg"
>
</picture>
<br>
<a href="https://revanced.app/">
<picture>
<source height="24px" media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/revanced/revanced-library/main/assets/revanced-logo/revanced-logo.svg" />
<img height="24px" src="https://raw.githubusercontent.com/revanced/revanced-library/main/assets/revanced-logo/revanced-logo.svg" />
</picture>
</a>&nbsp;&nbsp;&nbsp;
<a href="https://github.com/ReVanced">
<picture>
<source height="24px" media="(prefers-color-scheme: dark)" srcset="https://i.ibb.co/dMMmCrW/Git-Hub-Mark.png" />
<img height="24px" src="https://i.ibb.co/9wV3HGF/Git-Hub-Mark-Light.png" />
</picture>
</a>&nbsp;&nbsp;&nbsp;
<a href="http://revanced.app/discord">
<picture>
<source height="24px" media="(prefers-color-scheme: dark)" srcset="https://user-images.githubusercontent.com/13122796/178032563-d4e084b7-244e-4358-af50-26bde6dd4996.png" />
<img height="24px" src="https://user-images.githubusercontent.com/13122796/178032563-d4e084b7-244e-4358-af50-26bde6dd4996.png" />
</picture>
</a>&nbsp;&nbsp;&nbsp;
<a href="https://reddit.com/r/revancedapp">
<picture>
<source height="24px" media="(prefers-color-scheme: dark)" srcset="https://user-images.githubusercontent.com/13122796/178032351-9d9d5619-8ef7-470a-9eec-2744ece54553.png" />
<img height="24px" src="https://user-images.githubusercontent.com/13122796/178032351-9d9d5619-8ef7-470a-9eec-2744ece54553.png" />
</picture>
</a>&nbsp;&nbsp;&nbsp;
<a href="https://t.me/app_revanced">
<picture>
<source height="24px" media="(prefers-color-scheme: dark)" srcset="https://user-images.githubusercontent.com/13122796/178032213-faf25ab8-0bc3-4a94-a730-b524c96df124.png" />
<img height="24px" src="https://user-images.githubusercontent.com/13122796/178032213-faf25ab8-0bc3-4a94-a730-b524c96df124.png" />
</picture>
</a>&nbsp;&nbsp;&nbsp;
<a href="https://x.com/revancedapp">
<picture>
<source media="(prefers-color-scheme: dark)" srcset="https://user-images.githubusercontent.com/93124920/270180600-7c1b38bf-889b-4d68-bd5e-b9d86f91421a.png">
<img height="24px" src="https://user-images.githubusercontent.com/93124920/270108715-d80743fa-b330-4809-b1e6-79fbdc60d09c.png" />
</picture>
</a>&nbsp;&nbsp;&nbsp;
<a href="https://www.youtube.com/@ReVanced">
<picture>
<source height="24px" media="(prefers-color-scheme: dark)" srcset="https://user-images.githubusercontent.com/13122796/178032714-c51c7492-0666-44ac-99c2-f003a695ab50.png" />
<img height="24px" src="https://user-images.githubusercontent.com/13122796/178032714-c51c7492-0666-44ac-99c2-f003a695ab50.png" />
</picture>
</a>
<br>
<br>
Continuing the legacy of Vanced
</p>
# ReVanced Library feature request
Please check for existing feature requests
[here](https://github.com/ReVanced/revanced-library/labels/Feature%20request)
before creating a new one.
Before creating a new feature request, please keep the following in mind:
- **Do not submit a duplicate feature request**: You can review existing feature requests [here](https://github.com/ReVanced/revanced-library/labels/Feature%20request).
- **Review the contribution guidelines**: Make sure your bug report adheres to it. You can find the guidelines [here](https://github.com/ReVanced/revanced-library/blob/main/CONTRIBUTING.md).
- **Do not use the issue page for support**: If you need help or have questions, check out other platforms on [revanced.app](https://revanced.app).
- type: textarea
attributes:
label: Feature description
@@ -35,9 +96,9 @@ body:
id: acknowledgements
attributes:
label: Acknowledgements
description: Your issue will be closed if you don't follow the checklist below.
description: Your feature request will be closed if you don't follow the checklist below.
options:
- label: This request is not a duplicate of an existing issue.
- label: This issue is not a duplicate of an existing feature request.
required: true
- label: I have chosen an appropriate title.
required: true

2
.github/config.yml vendored
View File

@@ -1,2 +1,2 @@
firstPRMergeComment: >
Thank you for contributing to ReVanced. Join us on [Discord](https://revanced.app/discord) if you want to receive a contributor role.
Thank you for contributing to ReVanced. Join us on [Discord](https://revanced.app/discord) to receive a role for your contribution.

View File

@@ -17,29 +17,32 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
# Make sure the release step uses its own credentials:
# https://github.com/cycjimmy/semantic-release-action#private-packages
persist-credentials: false
fetch-depth: 0
- name: Cache
- name: Cache Node modules
uses: actions/cache@v3
with:
path: |
${{ runner.home }}/.gradle/caches
${{ runner.home }}/.gradle/wrapper
.gradle
build
node_modules
key: ${{ runner.os }}-gradle-npm-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties', 'package-lock.json') }}
key: npm-${{ hashFiles('package-lock.json') }}
- name: Cache Gradle
uses: burrunan/gradle-cache-action@v1
- name: Build
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# Cleaning is necessary to avoid uploading two identical artifacts with different versions
run: ./gradlew clean --no-daemon
- name: Setup semantic-release
run: npm install
- name: Release
env:
GITHUB_TOKEN: ${{ secrets.REPOSITORY_PUSH_ACCESS }}

View File

@@ -15,7 +15,8 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Open pull request
uses: repo-sync/pull-request@v2
with:

View File

@@ -1,3 +1,160 @@
# [1.3.0-dev.1](https://github.com/ReVanced/revanced-library/compare/v1.2.1-dev.1...v1.3.0-dev.1) (2023-11-26)
### Bug Fixes
* Delete mount script ([4fe0fb0](https://github.com/ReVanced/revanced-library/commit/4fe0fb0a617082b24199331671193e4fa7f485e2))
### Features
* Increase certainty of the possibility to mount ([10f8cd1](https://github.com/ReVanced/revanced-library/commit/10f8cd1470fd29cfefe53bf00a4a014f71a3f706))
* Select first Adb device, if none supplied automatically ([1a5f868](https://github.com/ReVanced/revanced-library/commit/1a5f868ecd0d278d574c12664ee95139c2423c17))
## [1.2.1-dev.1](https://github.com/ReVanced/revanced-library/compare/v1.2.0...v1.2.1-dev.1) (2023-11-13)
### Bug Fixes
* Add missing log when calling `UserAdbManager#install` ([90b612b](https://github.com/ReVanced/revanced-library/commit/90b612bee8591c01b8befabde4147c7de7a2a09f))
# [1.2.0](https://github.com/ReVanced/revanced-library/compare/v1.1.5...v1.2.0) (2023-11-03)
### Bug Fixes
* Catch exceptions when serializing invalid patch options ([cd73bd3](https://github.com/ReVanced/revanced-library/commit/cd73bd39ce7be5963a3c84ec43409b87c327579b))
### Features
* Log warnings when compiling resources ([1dc8e2e](https://github.com/ReVanced/revanced-library/commit/1dc8e2e2eb76bcade9167be0c4b4a628ff114f63))
* Use better log messages when handling exceptions ([5896968](https://github.com/ReVanced/revanced-library/commit/58969683582e70f36d6ed169b41c37928a2cf602))
# [1.2.0-dev.2](https://github.com/ReVanced/revanced-library/compare/v1.2.0-dev.1...v1.2.0-dev.2) (2023-11-03)
### Features
* Log warnings when compiling resources ([1dc8e2e](https://github.com/ReVanced/revanced-library/commit/1dc8e2e2eb76bcade9167be0c4b4a628ff114f63))
# [1.2.0-dev.1](https://github.com/ReVanced/revanced-library/compare/v1.1.5...v1.2.0-dev.1) (2023-10-31)
### Bug Fixes
* Catch exceptions when serializing invalid patch options ([cd73bd3](https://github.com/ReVanced/revanced-library/commit/cd73bd39ce7be5963a3c84ec43409b87c327579b))
### Features
* Use better log messages when handling exceptions ([5896968](https://github.com/ReVanced/revanced-library/commit/58969683582e70f36d6ed169b41c37928a2cf602))
## [1.1.5](https://github.com/ReVanced/revanced-library/compare/v1.1.4...v1.1.5) (2023-10-23)
## [1.1.5-dev.1](https://github.com/ReVanced/revanced-library/compare/v1.1.4...v1.1.5-dev.1) (2023-10-23)
## [1.1.4](https://github.com/ReVanced/revanced-library/compare/v1.1.3...v1.1.4) (2023-10-12)
### Bug Fixes
* Ask for root permissions before trying to use them ([aea1d69](https://github.com/ReVanced/revanced-library/commit/aea1d6915766d9757075ee459955aa335d906bab))
* Execute ADB commands sequentially to fix mounting issues ([#12](https://github.com/ReVanced/revanced-library/issues/12)) ([fda3eca](https://github.com/ReVanced/revanced-library/commit/fda3eca74f30b968d8ee816d63a3dcf493e026de))
## [1.1.4-dev.2](https://github.com/ReVanced/revanced-library/compare/v1.1.4-dev.1...v1.1.4-dev.2) (2023-10-10)
### Bug Fixes
* Ask for root permissions before trying to use them ([aea1d69](https://github.com/ReVanced/revanced-library/commit/aea1d6915766d9757075ee459955aa335d906bab))
## [1.1.4-dev.1](https://github.com/ReVanced/revanced-library/compare/v1.1.3...v1.1.4-dev.1) (2023-10-09)
### Bug Fixes
* Execute ADB commands sequentially to fix mounting issues ([#12](https://github.com/ReVanced/revanced-library/issues/12)) ([fda3eca](https://github.com/ReVanced/revanced-library/commit/fda3eca74f30b968d8ee816d63a3dcf493e026de))
## [1.1.3](https://github.com/ReVanced/revanced-library/compare/v1.1.2...v1.1.3) (2023-10-09)
## [1.1.3-dev.2](https://github.com/ReVanced/revanced-library/compare/v1.1.3-dev.1...v1.1.3-dev.2) (2023-10-09)
## [1.1.3-dev.1](https://github.com/ReVanced/revanced-library/compare/v1.1.2...v1.1.3-dev.1) (2023-10-09)
## [1.1.2](https://github.com/ReVanced/revanced-library/compare/v1.1.1...v1.1.2) (2023-10-05)
## [1.1.2-dev.1](https://github.com/ReVanced/revanced-library/compare/v1.1.1...v1.1.2-dev.1) (2023-10-05)
## [1.1.1](https://github.com/ReVanced/revanced-library/compare/v1.1.0...v1.1.1) (2023-10-04)
### Performance Improvements
* Use maps to set options ([13823b7](https://github.com/ReVanced/revanced-library/commit/13823b74db1de3a104b5022b6bf0db0ef945f47b))
## [1.1.1-dev.1](https://github.com/ReVanced/revanced-library/compare/v1.1.0...v1.1.1-dev.1) (2023-10-04)
### Performance Improvements
* Use maps to set options ([13823b7](https://github.com/ReVanced/revanced-library/commit/13823b74db1de3a104b5022b6bf0db0ef945f47b))
# [1.1.0](https://github.com/ReVanced/revanced-library/compare/v1.0.1...v1.1.0) (2023-10-01)
### Bug Fixes
* Only load the keystore once per instantiation ([5993f7e](https://github.com/ReVanced/revanced-library/commit/5993f7e568543c777bee51a140c34fa8953a178a))
* Use correct function name casing ([ef38d8b](https://github.com/ReVanced/revanced-library/commit/ef38d8b4bfe3a79c25fb40588c6217c09574770f))
### Features
* Increase the key size to 4096 ([892e083](https://github.com/ReVanced/revanced-library/commit/892e0835c6b2da0836bd6ba1d8603db1848cc2d9))
# [1.1.0-dev.2](https://github.com/ReVanced/revanced-library/compare/v1.1.0-dev.1...v1.1.0-dev.2) (2023-09-25)
### Bug Fixes
* Use correct function name casing ([ef38d8b](https://github.com/ReVanced/revanced-library/commit/ef38d8b4bfe3a79c25fb40588c6217c09574770f))
# [1.1.0-dev.1](https://github.com/ReVanced/revanced-library/compare/v1.0.2-dev.1...v1.1.0-dev.1) (2023-09-25)
### Features
* Increase the key size to 4096 ([892e083](https://github.com/ReVanced/revanced-library/commit/892e0835c6b2da0836bd6ba1d8603db1848cc2d9))
## [1.0.2-dev.1](https://github.com/ReVanced/revanced-library/compare/v1.0.1...v1.0.2-dev.1) (2023-09-25)
### Bug Fixes
* Only load the keystore once per instantiation ([5993f7e](https://github.com/ReVanced/revanced-library/commit/5993f7e568543c777bee51a140c34fa8953a178a))
## [1.0.1](https://github.com/ReVanced/revanced-library/compare/v1.0.0...v1.0.1) (2023-09-24)
### Bug Fixes
* Check if file exists before trying to open it ([8ddc6e9](https://github.com/ReVanced/revanced-library/commit/8ddc6e9d6f3c41c1528e0d43156d7d811dd6be40))
## [1.0.1-dev.1](https://github.com/ReVanced/revanced-library/compare/v1.0.0...v1.0.1-dev.1) (2023-09-24)
### Bug Fixes
* Check if file exists before trying to open it ([8ddc6e9](https://github.com/ReVanced/revanced-library/commit/8ddc6e9d6f3c41c1528e0d43156d7d811dd6be40))
# 1.0.0 (2023-09-23)
### Features
* Add initial project structure ([833291d](https://github.com/ReVanced/revanced-library/commit/833291dc68568f11afbf00e443cc857313489424))
# 1.0.0-dev.1 (2023-09-23)

View File

@@ -2,8 +2,8 @@ public final class app/revanced/library/ApkSigner {
public static final field INSTANCE Lapp/revanced/library/ApkSigner;
public final fun newApkSignerBuilder (Lapp/revanced/library/ApkSigner$PrivateKeyCertificatePair;Ljava/lang/String;Ljava/lang/String;)Lcom/android/apksig/ApkSigner$Builder;
public final fun newApkSignerBuilder (Ljava/security/KeyStore;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Lcom/android/apksig/ApkSigner$Builder;
public final fun newKeyStore (Ljava/io/OutputStream;Ljava/lang/String;Ljava/util/List;)V
public final fun newKeyStore (Ljava/util/List;)Ljava/security/KeyStore;
public final fun newKeystore (Ljava/io/OutputStream;Ljava/lang/String;Ljava/util/List;)V
public final fun newPrivateKeyCertificatePair (Ljava/lang/String;Ljava/util/Date;)Lapp/revanced/library/ApkSigner$PrivateKeyCertificatePair;
public static synthetic fun newPrivateKeyCertificatePair$default (Lapp/revanced/library/ApkSigner;Ljava/lang/String;Ljava/util/Date;ILjava/lang/Object;)Lapp/revanced/library/ApkSigner$PrivateKeyCertificatePair;
public final fun readKeyCertificatePair (Ljava/security/KeyStore;Ljava/lang/String;Ljava/lang/String;)Lapp/revanced/library/ApkSigner$PrivateKeyCertificatePair;

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 11 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 11 KiB

View File

@@ -0,0 +1 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg width="100%" height="100%" viewBox="0 0 800 800" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" xmlns:serif="http://www.serif.com/" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:2;"><g id="Logo"><g id="Ring"><circle id="Ring-Background" serif:id="Ring Background" cx="400" cy="400" r="400" style="fill:#1b1b1b;"/><path id="Ring1" serif:id="Ring" d="M400,0c220.766,0 400,179.234 400,400c-0,220.766 -179.234,400 -400,400c-220.766,-0 -400,-179.234 -400,-400c0,-220.766 179.234,-400 400,-400Zm-0,36c200.897,-0 364,163.103 364,364c0,200.897 -163.103,364 -364,364c-200.897,0 -364,-163.103 -364,-364c-0,-200.897 163.103,-364 364,-364Z" style="fill:url(#_Linear1);"/></g><g id="Shape"><path id="V-Shape" serif:id="V Shape" d="M538.74,269.872c1.481,-3.382 1.157,-7.283 -0.863,-10.373c-2.021,-3.091 -5.464,-4.954 -9.156,-4.954c-5.148,0 -10.435,0 -14.165,0c-3.1,0 -5.907,1.834 -7.153,4.672c-12.468,28.396 -78.273,178.273 -100.25,228.328c-1.246,2.838 -4.053,4.671 -7.154,4.671c-3.1,0 -5.907,-1.833 -7.153,-4.671c-21.977,-50.055 -87.782,-199.932 -100.25,-228.328c-1.246,-2.838 -4.053,-4.672 -7.153,-4.672c-3.73,0 -9.017,0 -14.164,0c-3.693,0 -7.135,1.863 -9.156,4.954c-2.02,3.09 -2.344,6.991 -0.863,10.373c23.557,53.766 101.872,232.519 117.871,269.034c1.743,3.979 5.674,6.549 10.018,6.549c6.293,-0 15.408,-0 21.701,-0c4.344,-0 8.275,-2.57 10.018,-6.549c15.999,-36.515 94.315,-215.268 117.872,-269.034Z" style="fill:#fff;"/><path id="Diamond" d="M408.119,395.312c-1.675,2.901 -4.77,4.688 -8.119,4.688c-3.349,-0 -6.444,-1.787 -8.119,-4.688c-16.997,-29.44 -56.156,-97.264 -73.153,-126.704c-1.675,-2.901 -1.675,-6.474 0,-9.375c1.675,-2.901 4.77,-4.688 8.119,-4.688c33.995,0 112.311,0 146.306,0c3.349,0 6.444,1.787 8.119,4.688c1.675,2.901 1.675,6.474 -0,9.375c-16.997,29.44 -56.156,97.264 -73.153,126.704Z" style="fill:url(#_Linear2);"/></g></g><defs><linearGradient id="_Linear1" x1="0" y1="0" x2="1" y2="0" gradientUnits="userSpaceOnUse" gradientTransform="matrix(4.89859e-14,800,-800,4.89859e-14,400.001,3.31681e-10)"><stop offset="0" style="stop-color:#f04e98;stop-opacity:1"/><stop offset="0.5" style="stop-color:#5f65d4;stop-opacity:1"/><stop offset="1" style="stop-color:#4e98f0;stop-opacity:1"/></linearGradient><linearGradient id="_Linear2" x1="0" y1="0" x2="1" y2="0" gradientUnits="userSpaceOnUse" gradientTransform="matrix(1.77155e-14,289.317,-282.535,1.73003e-14,400,254.545)"><stop offset="0" style="stop-color:#f04e98;stop-opacity:1"/><stop offset="0.5" style="stop-color:#5f65d4;stop-opacity:1"/><stop offset="1" style="stop-color:#4e98f0;stop-opacity:1"/></linearGradient></defs></svg>

After

Width:  |  Height:  |  Size: 2.8 KiB

View File

@@ -1,11 +1,18 @@
plugins {
kotlin("jvm") version "1.9.0"
kotlin("jvm") version "1.9.10"
alias(libs.plugins.binary.compatibility.validator)
`maven-publish`
}
group = "app.revanced"
repositories {
mavenCentral()
mavenLocal()
maven { url = uri("https://jitpack.io") }
google()
}
dependencies {
implementation(libs.revanced.patcher)
implementation(libs.kotlin.reflect)
@@ -34,17 +41,6 @@ java {
}
publishing {
repositories {
mavenLocal()
maven {
name = "GitHubPackages"
url = uri("https://maven.pkg.github.com/revanced/revanced-library")
credentials {
username = System.getenv("GITHUB_ACTOR")
password = System.getenv("GITHUB_TOKEN")
}
}
}
publications {
create<MavenPublication>("gpr") {
from(components["java"])

View File

@@ -1,4 +1,4 @@
org.gradle.parallel = true
org.gradle.caching = true
kotlin.code.style = official
version = 1.0.0-dev.1
version = 1.3.0-dev.1

View File

@@ -1,18 +1,18 @@
[versions]
apksig = "8.1.1"
apksig = "8.1.4"
bcpkix-jdk18on = "1.76"
jackson-module-kotlin = "2.14.3"
jadb = "2531a28109"
kotlin-reflect = "1.9.0"
kotlin-test = "1.8.20-RC"
revanced-patcher = "15.0.1"
jadb = "1.2.1"
kotlin-reflect = "1.9.10"
kotlin-test = "1.9.10"
revanced-patcher = "19.0.0"
binary-compatibility-validator = "0.13.2"
[libraries]
apksig = { module = "com.android.tools.build:apksig", version.ref = "apksig" }
bcpkix-jdk18on = { module = "org.bouncycastle:bcpkix-jdk18on", version.ref = "bcpkix-jdk18on" }
jackson-module-kotlin = { module = "com.fasterxml.jackson.module:jackson-module-kotlin", version.ref = "jackson-module-kotlin" }
jadb = { module = "com.github.revanced:jadb", version.ref = "jadb" }
jadb = { module = "app.revanced:jadb", version.ref = "jadb" }
kotlin-reflect = { module = "org.jetbrains.kotlin:kotlin-reflect", version.ref = "kotlin-reflect" }
kotlin-test = { module = "org.jetbrains.kotlin:kotlin-test", version.ref = "kotlin-test" }
revanced-patcher = { module = "app.revanced:revanced-patcher", version.ref = "revanced-patcher" }

View File

@@ -1,7 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.2-bin.zip
networkTimeout=10000
validateDistributionUrl=true
distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip
distributionSha256Sum=3e1af3ae886920c3ac87f7a91f816c0c7c436f276a6eefdb3da152100fef72ae
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
zipStorePath=wrapper/dist

8614
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -1,9 +1,9 @@
{
"devDependencies": {
"@saithodev/semantic-release-backmerge": "^3.1.0",
"@semantic-release/changelog": "^6.0.2",
"@saithodev/semantic-release-backmerge": "^3.2.1",
"@semantic-release/changelog": "^6.0.3",
"@semantic-release/git": "^10.0.1",
"gradle-semantic-release-plugin": "^1.7.6",
"semantic-release": "^20.1.0"
"gradle-semantic-release-plugin": "^1.8.0",
"semantic-release": "^22.0.8"
}
}

View File

@@ -1,23 +1,7 @@
val githubUsername: String = providers.gradleProperty("gpr.user").orNull ?: System.getenv("GITHUB_ACTOR")
val githubPassword: String = providers.gradleProperty("gpr.key").orNull ?: System.getenv("GITHUB_TOKEN")
rootProject.name = "revanced-library"
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
mavenCentral()
mavenLocal()
google()
maven { url = uri("https://jitpack.io") }
listOf("revanced-patcher", "jadb").forEach { repo ->
maven {
url = uri("https://maven.pkg.github.com/revanced/$repo")
credentials {
username = githubUsername
password = githubPassword
}
}
}
buildCache {
local {
isEnabled = !System.getenv().containsKey("CI")
}
}
rootProject.name = "revanced-library"

View File

@@ -45,7 +45,7 @@ object ApkSigner {
// Generate a new key pair.
val keyPair = KeyPairGenerator.getInstance("RSA").apply {
initialize(2048)
initialize(4096)
}.generateKeyPair()
var serialNumber: BigInteger
@@ -116,8 +116,9 @@ object ApkSigner {
logger.fine("Creating keystore")
return KeyStore.getInstance("BKS", BouncyCastleProvider.PROVIDER_NAME).apply {
load(null)
entries.forEach { entry ->
load(null)
// Add all entries to the keystore.
setKeyEntry(
entry.alias,
@@ -136,7 +137,7 @@ object ApkSigner {
* @param keyStorePassword The password for the keystore.
* @param entries The entries to add to the keystore.
*/
fun newKeystore(
fun newKeyStore(
keyStoreOutputStream: OutputStream,
keyStorePassword: String,
entries: List<KeyStoreEntry>

View File

@@ -30,7 +30,16 @@ object Options {
.map { patch ->
Patch(
patch.name!!,
patch.options.values.map { option -> Option(option.key, option.value) }
patch.options.values.map { option ->
val optionValue = try {
option.value
} catch (e: PatchOptionException) {
logger.warning("Using default option value for the ${patch.name} patch: ${e.message}")
option.default
}
Option(option.key, optionValue)
}
)
}
// See https://github.com/revanced/revanced-patches/pull/2434/commits/60e550550b7641705e81aa72acfc4faaebb225e7.
@@ -61,15 +70,17 @@ object Options {
filter { it.options.any() }.let { patches ->
if (patches.isEmpty()) return
val patchOptions = deserialize(json)
val jsonPatches = deserialize(json).associate {
it.patchName to it.options.associate { option -> option.key to option.value }
}
patches.forEach patch@{ patch ->
patchOptions.find { option -> option.patchName == patch.name!! }?.let {
it.options.forEach { option ->
patches.forEach { patch ->
jsonPatches[patch.name]?.let { jsonPatchOptions ->
jsonPatchOptions.forEach { (option, value) ->
try {
patch.options[option.key] = option.value
patch.options[option] = value
} catch (e: PatchOptionException) {
logger.severe(e.toString())
logger.warning("Could not set option value for the ${patch.name} patch: ${e.message}")
}
}
}

View File

@@ -3,6 +3,7 @@ package app.revanced.library.adb
import app.revanced.library.adb.AdbManager.Apk
import app.revanced.library.adb.Constants.CREATE_DIR
import app.revanced.library.adb.Constants.DELETE
import app.revanced.library.adb.Constants.GET_INSTALLED_PATH
import app.revanced.library.adb.Constants.INSTALLATION_PATH
import app.revanced.library.adb.Constants.INSTALL_MOUNT
import app.revanced.library.adb.Constants.INSTALL_PATCHED_APK
@@ -10,7 +11,6 @@ import app.revanced.library.adb.Constants.MOUNT_PATH
import app.revanced.library.adb.Constants.MOUNT_SCRIPT
import app.revanced.library.adb.Constants.PATCHED_APK_PATH
import app.revanced.library.adb.Constants.PLACEHOLDER
import app.revanced.library.adb.Constants.RESOLVE_ACTIVITY
import app.revanced.library.adb.Constants.RESTART
import app.revanced.library.adb.Constants.TMP_PATH
import app.revanced.library.adb.Constants.UMOUNT
@@ -24,16 +24,23 @@ import java.util.logging.Logger
/**
* Adb manager. Used to install and uninstall [Apk] files.
*
* @param deviceSerial The serial of the device.
* @param deviceSerial The serial of the device. If null, the first connected device will be used.
*/
sealed class AdbManager private constructor(deviceSerial: String? = null) {
sealed class AdbManager private constructor(deviceSerial: String?) {
protected val logger: Logger = Logger.getLogger(AdbManager::class.java.name)
protected val device = JadbConnection().devices.find { device -> device.serial == deviceSerial }
?: throw DeviceNotFoundException(deviceSerial)
protected val device = with(JadbConnection().devices) {
if (isEmpty()) throw DeviceNotFoundException()
deviceSerial?.let {
firstOrNull { it.serial == deviceSerial } ?: throw DeviceNotFoundException(deviceSerial)
} ?: first().also {
logger.warning("No device serial supplied. Using device with serial ${it.serial}")
}
}!!
init {
logger.fine("Established connection to $deviceSerial")
logger.fine("Connected to ${device.serial}")
}
/**
@@ -58,18 +65,23 @@ sealed class AdbManager private constructor(deviceSerial: String? = null) {
/**
* Gets an [AdbManager] for the supplied device serial.
*
* @param deviceSerial The device serial.
* @param deviceSerial The device serial. If null, the first connected device will be used.
* @param root Whether to use root or not.
* @return The [AdbManager].
* @throws DeviceNotFoundException If the device can not be found.
*/
fun getAdbManager(deviceSerial: String, root: Boolean = false): AdbManager =
fun getAdbManager(deviceSerial: String? = null, root: Boolean = false): AdbManager =
if (root) RootAdbManager(deviceSerial) else UserAdbManager(deviceSerial)
}
class RootAdbManager internal constructor(deviceSerial: String) : AdbManager(deviceSerial) {
/**
* Adb manager for rooted devices.
*
* @param deviceSerial The device serial. If null, the first connected device will be used.
*/
class RootAdbManager internal constructor(deviceSerial: String?) : AdbManager(deviceSerial) {
init {
if (!device.hasSu()) throw IllegalArgumentException("Root required on $deviceSerial. Task failed")
if (!device.hasSu()) throw IllegalArgumentException("Root required on ${device.serial}. Task failed")
}
override fun install(apk: Apk) {
@@ -77,21 +89,21 @@ sealed class AdbManager private constructor(deviceSerial: String? = null) {
val packageName = apk.packageName ?: throw PackageNameRequiredException()
device.run(RESOLVE_ACTIVITY, packageName).inputStream.bufferedReader().readLine().let { line ->
if (line != "No activity found") return@let
device.run(GET_INSTALLED_PATH, packageName).inputStream.bufferedReader().readLine().let { line ->
if (line != null) return@let
throw throw FailedToFindInstalledPackageException(packageName)
}
device.push(apk.file, TMP_PATH)
device.run("$CREATE_DIR $INSTALLATION_PATH")
device.run(INSTALL_PATCHED_APK, packageName)
device.run("$CREATE_DIR $INSTALLATION_PATH").waitFor()
device.run(INSTALL_PATCHED_APK, packageName).waitFor()
device.createFile(TMP_PATH, MOUNT_SCRIPT.applyReplacement(packageName))
device.run(INSTALL_MOUNT, packageName)
device.run(UMOUNT, packageName) // Sanity check.
device.run(MOUNT_PATH, packageName)
device.run(INSTALL_MOUNT, packageName).waitFor()
device.run(UMOUNT, packageName).waitFor() // Sanity check.
device.run(MOUNT_PATH, packageName).waitFor()
device.run(RESTART, packageName)
device.run(DELETE, TMP_PATH)
@@ -103,8 +115,9 @@ sealed class AdbManager private constructor(deviceSerial: String? = null) {
device.run(UMOUNT, packageName)
device.run(DELETE.applyReplacement(PATCHED_APK_PATH), packageName)
device.run(DELETE, MOUNT_PATH)
device.run(DELETE, MOUNT_PATH.applyReplacement(packageName))
device.run(DELETE, TMP_PATH)
device.run(RESTART, packageName)
super.uninstall(packageName)
}
@@ -115,10 +128,17 @@ sealed class AdbManager private constructor(deviceSerial: String? = null) {
}
}
class UserAdbManager internal constructor(deviceSerial: String) : AdbManager(deviceSerial) {
/**
* Adb manager for non-rooted devices.
*
* @param deviceSerial The device serial. If null, the first connected device will be used.
*/
class UserAdbManager internal constructor(deviceSerial: String?) : AdbManager(deviceSerial) {
private val packageManager = PackageManager(device)
override fun install(apk: Apk) {
logger.info("Installing ${apk.file.name}")
PackageManager(device).install(apk.file)
super.install(apk)
@@ -141,7 +161,7 @@ sealed class AdbManager private constructor(deviceSerial: String? = null) {
*/
class Apk(val file: File, val packageName: String? = null)
class DeviceNotFoundException internal constructor(deviceSerial: String?) :
class DeviceNotFoundException internal constructor(deviceSerial: String? = null) :
Exception(deviceSerial?.let {
"The device with the ADB device serial \"$deviceSerial\" can not be found"
} ?: "No ADB device found")

View File

@@ -2,7 +2,6 @@ package app.revanced.library.adb
import se.vidstige.jadb.JadbDevice
import se.vidstige.jadb.RemoteFile
import se.vidstige.jadb.ShellProcess
import se.vidstige.jadb.ShellProcessBuilder
import java.io.File
@@ -16,19 +15,14 @@ internal fun JadbDevice.buildCommand(command: String, su: Boolean = true): Shell
return shellProcessBuilder(cmd, *args.toTypedArray())
}
internal fun JadbDevice.run(command: String, su: Boolean = true): ShellProcess {
return this.buildCommand(command, su).start()!!
}
internal fun JadbDevice.run(command: String, su: Boolean = true) =
this.buildCommand(command, su).start()
internal fun JadbDevice.hasSu() =
this.startCommand("su -h", false).waitFor() == 0
this.run("whoami", true).waitFor() == 0
internal fun JadbDevice.push(file: File, targetFilePath: String) =
push(file, RemoteFile(targetFilePath))
internal fun JadbDevice.createFile(targetFile: String, content: String) =
push(content.byteInputStream(), System.currentTimeMillis(), 644, RemoteFile(targetFile))
private fun JadbDevice.startCommand(command: String, su: Boolean) =
shellProcessBuilder(if (su) "su -c '$command'" else command).start()
push(content.byteInputStream(), System.currentTimeMillis(), 644, RemoteFile(targetFile))

View File

@@ -10,9 +10,8 @@ internal object Constants {
internal const val DELETE = "rm -rf $PLACEHOLDER"
internal const val CREATE_DIR = "mkdir -p"
internal const val RESOLVE_ACTIVITY = "pm resolve-activity --brief $PLACEHOLDER"
internal const val RESTART = "$RESOLVE_ACTIVITY | tail -n 1 | " +
"xargs am start -n && kill ${'$'}(pidof -s $PLACEHOLDER)"
internal const val RESTART = "am start -S $PLACEHOLDER"
internal const val GET_INSTALLED_PATH = "pm path $PLACEHOLDER"
internal const val INSTALL_PATCHED_APK = "base_path=\"$PATCHED_APK_PATH\" && " +
"mv $TMP_PATH ${'$'}base_path && " +
@@ -30,7 +29,9 @@ internal object Constants {
#!/system/bin/sh
MAGISKTMP="${'$'}(magisk --path)" || MAGISKTMP=/sbin
MIRROR="${'$'}MAGISKTMP/.magisk/mirror"
while [ "${'$'}(getprop sys.boot_completed | tr -d '\r')" != "1" ]; do sleep 1; done
until [ "${'$'}(getprop sys.boot_completed)" = 1 ]; do sleep 3; done
until [ -d "/sdcard/Android" ]; do sleep 1; done
base_path="$PATCHED_APK_PATH"
stock_path=${'$'}( pm path $PLACEHOLDER | grep base | sed 's/package://g' )

View File

@@ -7,6 +7,14 @@ import java.util.logging.SimpleFormatter
@Suppress("MemberVisibilityCanBePrivate")
object Logger {
/**
* Rules for allowed loggers.
*/
private val allowedLoggersRules = arrayOf<String.() -> Boolean>(
{ startsWith("app.revanced") }, // ReVanced loggers.
{ this == "" } // Logs warnings when compiling resources (Logger in class brut.util.OS).
)
private val rootLogger = java.util.logging.Logger.getLogger("")
/**
@@ -64,7 +72,9 @@ object Logger {
removeAllHandlers()
val publishHandler = handler@{ log: String, level: Level, loggerName: String? ->
if (loggerName?.startsWith("app.revanced") != true) return@handler
loggerName?.let { name ->
if (allowedLoggersRules.none { it(name) }) return@handler
}
log.toByteArray().let {
if (level.intValue() > Level.WARNING.intValue())

View File

@@ -13,7 +13,12 @@ import java.util.zip.Deflater
class ZipFile(file: File) : Closeable {
private var entries: MutableList<ZipEntry> = mutableListOf()
private val filePointer: RandomAccessFile = RandomAccessFile(file, if (file.canWrite()) "rw" else "r")
// Open file for writing if it doesn't exist (because the intention is to write) or is writable.
private val filePointer: RandomAccessFile = RandomAccessFile(
file,
if (!file.exists() || file.canWrite()) "rw" else "r"
)
private var centralDirectoryNeedsRewrite = false
private val compressionLevel = 5

View File

@@ -3,8 +3,9 @@ package app.revanced.library
import app.revanced.library.Options.setOptions
import app.revanced.patcher.data.BytecodeContext
import app.revanced.patcher.patch.BytecodePatch
import app.revanced.patcher.patch.options.types.BooleanPatchOption.Companion.booleanPatchOption
import app.revanced.patcher.patch.options.types.StringPatchOption.Companion.stringPatchOption
import app.revanced.patcher.patch.annotation.Patch
import app.revanced.patcher.patch.options.PatchOption.PatchExtensions.booleanPatchOption
import app.revanced.patcher.patch.options.PatchOption.PatchExtensions.stringPatchOption
import org.junit.jupiter.api.MethodOrderer
import org.junit.jupiter.api.Order
import org.junit.jupiter.api.Test
@@ -35,9 +36,10 @@ internal object PatchOptionsTest {
private const val CHANGED_JSON =
"[{\"patchName\":\"PatchOptionsTestPatch\",\"options\":[{\"key\":\"key1\",\"value\":\"test\"},{\"key\":\"key2\",\"value\":false}]}]"
object PatchOptionsTestPatch : BytecodePatch(name = "PatchOptionsTestPatch") {
var option1 by stringPatchOption("key1", null, "title1", "description1")
var option2 by booleanPatchOption("key2", true, "title2", "description2")
@Patch("PatchOptionsTestPatch")
object PatchOptionsTestPatch : BytecodePatch() {
var option1 by stringPatchOption("key1", null, null, "title1", "description1")
var option2 by booleanPatchOption("key2", true, null, "title2", "description2")
override fun execute(context: BytecodeContext) {
// Do nothing

View File

@@ -3,6 +3,7 @@ package app.revanced.library
import app.revanced.patcher.PatchSet
import app.revanced.patcher.data.BytecodeContext
import app.revanced.patcher.patch.BytecodePatch
import app.revanced.patcher.patch.Patch
import org.junit.jupiter.api.Test
import kotlin.test.assertEquals
@@ -42,9 +43,16 @@ internal object PatchUtilsTest {
expected: String?, patches: PatchSet, compatiblePackageName: String
) = assertEquals(expected, PatchUtils.getMostCommonCompatibleVersion(patches, compatiblePackageName))
private fun newPatch(packageName: String, vararg versions: String) = object : BytecodePatch(
compatiblePackages = setOf(CompatiblePackage(packageName, versions.toSet()))
) {
private fun newPatch(packageName: String, vararg versions: String) = object : BytecodePatch() {
init {
// Set the compatible packages field to the supplied package name and versions reflectively,
// because the setter is private but needed for testing.
val compatiblePackagesField = Patch::class.java.getDeclaredField("compatiblePackages")
compatiblePackagesField.isAccessible = true
compatiblePackagesField.set(this, setOf(CompatiblePackage(packageName, versions.toSet())))
}
override fun execute(context: BytecodeContext) {}
}
}