-
-
Notifications
You must be signed in to change notification settings - Fork 487
feat: Add Spoof app signature
patch
#5158
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
By patch you can read the app manifest forvm the signature. Please try that |
Only in signature version below 3 (there are 4 different versions how to sign an apk by now). Try to look into the youtube.apk, you will notice no certs in META-INF (it uses version 3) If I had missed something, let me know Site note: the source stamp which exists in the apk root is something entirely different than the signer certificate |
In this case add a patch option to manually input the signature for the patch |
In addition or as replacement? |
I dont know what you mean by in addition but if v4 cant be obtained from inside a patch, you can still ask user to manually input it in a patch option |
793c0f2
to
b112417
Compare
patches/src/main/kotlin/app/revanced/patches/all/misc/spoof/SignatureSpoofPatch.kt
Outdated
Show resolved
Hide resolved
Spoof app signature
patch
patches/src/main/kotlin/app/revanced/patches/all/misc/spoof/SignatureSpoofPatch.kt
Outdated
Show resolved
Hide resolved
e0407aa
to
8752d06
Compare
patches/src/main/kotlin/app/revanced/patches/all/misc/spoof/SignatureSpoofPatch.kt
Show resolved
Hide resolved
patches/src/main/kotlin/app/revanced/patches/all/misc/spoof/BaseSignatureSpoofPatch.kt
Outdated
Show resolved
Hide resolved
patches/src/main/kotlin/app/revanced/patches/all/misc/spoof/SignatureSpoofPatch.kt
Outdated
Show resolved
Hide resolved
patches/src/main/kotlin/app/revanced/patches/all/misc/spoof/SignatureSpoofPatch.kt
Outdated
Show resolved
Hide resolved
patches/src/main/kotlin/app/revanced/patches/all/misc/spoof/SignatureSpoofPatch.kt
Show resolved
Hide resolved
patches/src/main/kotlin/app/revanced/patches/all/misc/spoof/SignatureSpoofPatch.kt
Outdated
Show resolved
Hide resolved
8752d06
to
dde4931
Compare
patches/src/main/kotlin/app/revanced/patches/all/misc/spoof/SignatureSpoofPatch.kt
Outdated
Show resolved
Hide resolved
dde4931
to
708a867
Compare
|
||
val fakeSignaturePermission = document.createElement("uses-permission") | ||
fakeSignaturePermission.setAttribute("android:name", "android.permission.FAKE_PACKAGE_SIGNATURE") | ||
manifest.appendChild(fakeSignaturePermission) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.let(manifest::appendChild) shouldve been used
val child = document.createElement("application") | ||
manifest.appendChild(child) | ||
child |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.also(manifest::appendChild) shouldve been used
val fakeSignatureMetadata = document.createElement("meta-data") | ||
fakeSignatureMetadata.setAttribute("android:name", "fake-signature") | ||
fakeSignatureMetadata.setAttribute("android:value", optionToSignature(signature)) | ||
application.appendChild(fakeSignatureMetadata) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
apply and let shouldve been used here
} | ||
} | ||
|
||
internal fun optionToSignature(signature: String?): String? { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldve been private
I meant, what do you think about the apksig issue with Manager. |
} | ||
} | ||
|
||
internal fun optionToSignature(signature: String?): String? { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Validator should just check if input is a valid path, because a path is never a signature, not sure what is going on here.
This line shades apksig into the patches and thus is accessible from the patches classloader. |
I don't understand how it can be class not found |
Is proguard stripping away the library during release? |
The dependency is added to the gradle module where the java plugin is applied, not the android plugin, so I don't think proguard strips it away. Check the .dex file classes |
There are no dependencies in patches/build/revanced/classes.dex, haven't been able to open the .rvp file. |
Run the buildAndroid task, the final rvp has the dex in it |
Nope, the "rvp" from my build, nor the one from the release contains the dependency (or dependencies at all) |
Check the rvp file for .class files |
Nope, not in the classes.dex and also not as .class files. Steps to reproduce my results:
|
A patches jar is not a fat jar, so it is not containing the classes from dependencies jar. The reason that this patch is currently working on the ReVanced CLI is due to the coincidence that the ReVanced CLI depends on apksig. ReVanced Manager also depends on apksig, but unlike ReVanced CLI, ProGuard shrinks and obfuscates the apksig library except for "internal" package. |
Now to this question again I would prefer the second option. It is present anyway, it just has to be removed from every project (because then it would be duplicate) and added to the "revanced-patcher" as dependency, making it available to the patches as well as the cli and manager. It then also needs to be whitelisted in the revanced-manager in the proguard rules. |
Patches is using the java plugin: So all dependencies are shaded into the JAR. |
I am not sure, but applying the shadow plugin should make patches contain all dependencies. This can be added to the patches gradle plugin. However, how are duplicate classes handled? If its shaded into patches jar and cli also has it, I am not sure if any issues would occur. |
The java plugin doesn't shade dependencies. Thats why the "shadow" plugin exists. |
Now it would be great if this question could be answered |
Why not try using shadow plugin, and if it works with CLI then go with that. |
Ok, then with shadow. |
Is there any reason that this line stays in the patches and not the patches-plugin? revanced-patches/patches/build.gradle.kts Lines 16 to 17 in f060fd5
If I am modifying the dependency logic of plugin anyway I might just hardcode that in? |
# [5.24.0](v5.23.0...v5.24.0) (2025-07-09) ### Bug Fixes * Add scrollable content to modern style settings dialogs ([ReVanced#5211](https://github.com/xChickens/revanced-patches/issues/5211)) ([e6876d5](e6876d5)) * **Bandcamp - Remove play limits:** Support latest app version ([ReVanced#5124](https://github.com/xChickens/revanced-patches/issues/5124)) ([863e92b](863e92b)) * Correctly name `Enable ROM signature spoofing` patch ([d85881a](d85881a)) * **Disable Pairip license check:** Change patch to default off ([74b6a94](74b6a94)) * Fix accidental changes ([e2ac841](e2ac841)) * Fix refactoring typo ([ec0ae42](ec0ae42)) * **Google Photos:** Resolve startup crash for Android 5.0 devices ([0294533](0294533)) * **Google Photos:** Resolve startup crash if MicroG GmsCore does not already have granted permissions ([a93d74d](a93d74d)) * **Hide ADB status:** Resolve app crash on startup ([ReVanced#5029](https://github.com/xChickens/revanced-patches/issues/5029)) ([1abebd5](1abebd5)) * **Messenger - Remove Meta AI:** Improve patch logic ([ReVanced#5153](https://github.com/xChickens/revanced-patches/issues/5153)) ([4ad4887](4ad4887)) * **Messenger:** Remove outdated `Disable switching emoji to sticker` patch ([ReVanced#5044](https://github.com/xChickens/revanced-patches/issues/5044)) ([7b182ca](7b182ca)) * **Pandora - Disable ads:** Support latest app target ([ReVanced#5185](https://github.com/xChickens/revanced-patches/issues/5185)) ([ca83047](ca83047)) * **SoundCloud:** Constrain patches to last working app target ([e8ea89f](e8ea89f)) * **Spotify - Custom theme:** Apply accent color in more places ([ReVanced#5039](https://github.com/xChickens/revanced-patches/issues/5039)) ([9357887](9357887)) * **Spotify - Fix third party launchers widgets:** Add missing compatibility annotation ([0493f80](0493f80)) * **Spotify - Spoof client patch:** Block sending bad integrity verdicts to potentially fix account suspensions ([ReVanced#5274](https://github.com/xChickens/revanced-patches/issues/5274)) ([f7b574c](f7b574c)) * **Spotify - Spoof client:** Handle remaining edge cases to obtain a session ([ReVanced#5285](https://github.com/xChickens/revanced-patches/issues/5285)) ([2bb2d59](2bb2d59)) * **Spotify - Spoof client:** Skip native login screens ([ReVanced#5228](https://github.com/xChickens/revanced-patches/issues/5228)) ([c5ebc63](c5ebc63)) * **Spotify - Unlock Premium:** Fix hiding context menu ads on newest versions ([ReVanced#5318](https://github.com/xChickens/revanced-patches/issues/5318)) ([73fd832](73fd832)) * **Spotify - Unlock Premium:** Fix hiding context menu ads on newest versions by simplifying fingerprint ([ReVanced#5318](https://github.com/xChickens/revanced-patches/issues/5318)) ([dad0ff4](dad0ff4)) * **Spotify Lite:** Remove obsolete `Enable on demand` patch ([ReVanced#5046](https://github.com/xChickens/revanced-patches/issues/5046)) ([4886d47](4886d47)) * **Spotify:** `Hide Create button` patch failing in edge cases ([ReVanced#5131](https://github.com/xChickens/revanced-patches/issues/5131)) ([0923600](0923600)) * **Spotify:** Add `Spoof client` patch to fix various issues by using a web platform access token ([ReVanced#5173](https://github.com/xChickens/revanced-patches/issues/5173)) ([b7b75bb](b7b75bb)) * **Spotify:** Fix `Hide Create button` and `Sanitize sharing links` for older but supported app targets ([ReVanced#5159](https://github.com/xChickens/revanced-patches/issues/5159)) ([e7dd061](e7dd061)) * **Spotify:** Prevent hiding all navigation bar buttons ([ReVanced#5122](https://github.com/xChickens/revanced-patches/issues/5122)) ([8afbef0](8afbef0)) * **Spotify:** Remove other ads type from the browse screen ([ReVanced#5333](https://github.com/xChickens/revanced-patches/issues/5333)) ([c68533a](c68533a)) * **Sync for Reddit - Spoof client:** Use www instead of ssl API to fix auth related issues ([6fea672](6fea672)) * **Threads - Hide ads:** Constrain patch to the last working app target ([ReVanced#5189](https://github.com/xChickens/revanced-patches/issues/5189)) ([3558c44](3558c44)) * **YouTube - GmsCore support:** Restore patch functionality from prior merge ([7686bbe](7686bbe)) * **YouTube - Hide ads:** Fix "Hide shopping links" ([ReVanced#5267](https://github.com/xChickens/revanced-patches/issues/5267)) ([2fe4607](2fe4607)) * **YouTube - Hide ads:** Hide new type of general ad ([ReVanced#5004](https://github.com/xChickens/revanced-patches/issues/5004)) ([37e59d2](37e59d2)) * **YouTube - Hide ads:** Hide new type of general ad ([ReVanced#5345](https://github.com/xChickens/revanced-patches/issues/5345)) ([f23716b](f23716b)) * **YouTube - Hide ads:** Hide new type of product ad in video description ([ReVanced#5225](https://github.com/xChickens/revanced-patches/issues/5225)) ([1e2efad](1e2efad)) * **YouTube - Hide layout components:** Do not hide playlist sort button if 'Hide AI comments summary' is on ([5f3e48e](5f3e48e)) * **YouTube - Hide layout components:** Fix "Hide AI Comments summary" in Comments ([ReVanced#5284](https://github.com/xChickens/revanced-patches/issues/5284)) ([d42370e](d42370e)) * **YouTube - Hide layout components:** Fix "Hide AI-generated video summary" in video description ([ReVanced#5269](https://github.com/xChickens/revanced-patches/issues/5269)) ([5203da0](5203da0)) * **YouTube - Hide layout components:** Fix "Hide ticket shelf" hiding unwanted components ([ReVanced#5292](https://github.com/xChickens/revanced-patches/issues/5292)) ([d6b1f7a](d6b1f7a)) * **YouTube - Hide layout components:** Fix "Hide video description attributes" ([ReVanced#5250](https://github.com/xChickens/revanced-patches/issues/5250)) ([2f22d45](2f22d45)) * **YouTube - Hide layout components:** Fix `Hide video recommendation labels` ([ReVanced#4956](https://github.com/xChickens/revanced-patches/issues/4956)) ([ae05ac3](ae05ac3)) * **YouTube - Hide layout components:** Remove broken option 'Hide comments emoji picker' ([ReVanced#5121](https://github.com/xChickens/revanced-patches/issues/5121)) ([9a6a639](9a6a639)) * **YouTube - Hide Shorts components:** Disable A/B player flags that prevents hiding buttons ([bef0dac](bef0dac)) * **YouTube - Hide Shorts components:** Disable A/B player that prevents hiding buttons ([ReVanced#5104](https://github.com/xChickens/revanced-patches/issues/5104)) ([835b7bd](835b7bd)) * **YouTube - Hide Shorts components:** Fix "Hide Use this sound button" ([ReVanced#5233](https://github.com/xChickens/revanced-patches/issues/5233)) ([5d6ec9e](5d6ec9e)) * **YouTube - Hide Shorts components:** Fix "Hide Use this template button" ([ReVanced#5249](https://github.com/xChickens/revanced-patches/issues/5249)) ([b399ecb](b399ecb)) * **YouTube - Hide Shorts components:** Fix hiding of untoggled components ([ReVanced#5266](https://github.com/xChickens/revanced-patches/issues/5266)) ([008e192](008e192)) * **YouTube - Open Shorts in regular player:** Do not exit app when pressing back button in regular player ([ReVanced#5020](https://github.com/xChickens/revanced-patches/issues/5020)) ([3384f8d](3384f8d)) * **YouTube - Playback speed:** Allow custom speeds with 0.01x precision ([ReVanced#5360](https://github.com/xChickens/revanced-patches/issues/5360)) ([0eecef0](0eecef0)) * **YouTube - Settings:** Correctly show summary text if search box is closed before searching ([d0ae835](d0ae835)) * **YouTube - SponsorBlock:** Do not show undo skip if PiP is active ([ReVanced#5314](https://github.com/xChickens/revanced-patches/issues/5314)) ([18af8de](18af8de)) * **YouTube - SponsorBlock:** Fix segment category summary not showing category description ([06934a6](06934a6)) * **YouTube - Video quality:** Remove non-functional Shorts 144p default quality ([3113cd6](3113cd6)) * **YouTube:** Always use single threaded layout to resolve layout bugs in unpatched YouTube ([ReVanced#5226](https://github.com/xChickens/revanced-patches/issues/5226)) ([1f539b1](1f539b1)) * **YouTube:** Better handle incorrect duplicate translations ([20abac5](20abac5)) * **YouTube:** Fix refactoring app startup exception ([1b00c90](1b00c90)) * **YouTube:** Remove old app targets that are no longer supported by YouTube ([ReVanced#5192](https://github.com/xChickens/revanced-patches/issues/5192)) ([c9e54e1](c9e54e1)) * **YouTube:** Support A/B Shorts layout for RYD and component hiding ([ReVanced#5081](https://github.com/xChickens/revanced-patches/issues/5081)) ([8ecacaa](8ecacaa)) * **Yuka - Unlock premium:** Remove broken patch that is no longer supported ([ReVanced#5018](https://github.com/xChickens/revanced-patches/issues/5018)) ([fac6e59](fac6e59)) ### Features * Add `Disable pairip license check` patch ([ReVanced#4927](https://github.com/xChickens/revanced-patches/issues/4927)) ([42d2c27](42d2c27)) * Add `Hide app icon` patch ([ReVanced#4977](https://github.com/xChickens/revanced-patches/issues/4977)) ([92311b8](92311b8)) * Add `Spoof app signature` patch ([ReVanced#5158](https://github.com/xChickens/revanced-patches/issues/5158)) ([78b25aa](78b25aa)) * **Cricbuzz:** Add `Hide ads` patch ([ReVanced#4998](https://github.com/xChickens/revanced-patches/issues/4998)) ([83ccfa8](83ccfa8)) * **Crunchyroll:** Add `Hide ads` patch ([ReVanced#5201](https://github.com/xChickens/revanced-patches/issues/5201)) ([46b4398](46b4398)) * **GmsCore support:** Open vendor specific DontKillMyApp if available ([ReVanced#4952](https://github.com/xChickens/revanced-patches/issues/4952)) ([b89927a](b89927a)) * **Google Photos:** Add `Enable DCIM folders backup control` patch ([ReVanced#5138](https://github.com/xChickens/revanced-patches/issues/5138)) ([328d232](328d232)) * **Lightroom:** Constrain patches to last working version ([ReVanced#5335](https://github.com/xChickens/revanced-patches/issues/5335)) ([32ce70e](32ce70e)) * **Messenger:** Add `Hide Facebook button` patch ([ReVanced#5057](https://github.com/xChickens/revanced-patches/issues/5057)) ([9175b23](9175b23)) * **Messenger:** Add `Remove Meta AI` patch ([ReVanced#4945](https://github.com/xChickens/revanced-patches/issues/4945)) ([012dff7](012dff7)) * **NU.nl:** Support version `11.3.0` ([ReVanced#4925](https://github.com/xChickens/revanced-patches/issues/4925)) ([bedde60](bedde60)) * **Prime Video:** Add `Rename shared permissions` patch ([ReVanced#5049](https://github.com/xChickens/revanced-patches/issues/5049)) ([80f1fc6](80f1fc6)) * **Proton Mail:** Add `Remove free accounts limit` patch ([ReVanced#4970](https://github.com/xChickens/revanced-patches/issues/4970)) ([b0440ad](b0440ad)) * **Spotify:** Add `Change lyrics provider` patch ([ReVanced#4937](https://github.com/xChickens/revanced-patches/issues/4937)) ([8736b6a](8736b6a)) * **Spotify:** Add `Fix Facebook login` patch ([ReVanced#5023](https://github.com/xChickens/revanced-patches/issues/5023)) ([34932dc](34932dc)) * **Spotify:** Add `Fix third party launchers widgets` patch ([ReVanced#4893](https://github.com/xChickens/revanced-patches/issues/4893)) ([23bfdc9](23bfdc9)) * **Spotify:** Add `Hide Create button` patch ([ReVanced#5062](https://github.com/xChickens/revanced-patches/issues/5062)) ([3201681](3201681)) * **Spotify:** Remove ads section from browse ([ReVanced#5193](https://github.com/xChickens/revanced-patches/issues/5193)) ([ebd4dcc](ebd4dcc)) * **Sync for Reddit:** Add `Fix post thumbnails` patch ([e1ec30c](e1ec30c)) * **Threads:** Hide Ads ([ReVanced#5064](https://github.com/xChickens/revanced-patches/issues/5064)) ([3c4cecb](3c4cecb)) * Use modern style settings dialogs ([ReVanced#5109](https://github.com/xChickens/revanced-patches/issues/5109)) ([312b6dc](312b6dc)) * **YouTube - Change header:** Add in-app setting to change the app header ([ReVanced#5346](https://github.com/xChickens/revanced-patches/issues/5346)) ([9ba45b6](9ba45b6)) * **YouTube - Enable debugging:** Add settings menu to share debug logs ([ReVanced#5021](https://github.com/xChickens/revanced-patches/issues/5021)) ([1ec4a88](1ec4a88)) * **YouTube - Hide description components:** Add `Hide Ask` ([ReVanced#4972](https://github.com/xChickens/revanced-patches/issues/4972)) ([ebc94a5](ebc94a5)) * **YouTube - Hide layout components:** Add `Hide channel links preview` and `Hide 'Visit Community' button` in channel page ([ReVanced#5320](https://github.com/xChickens/revanced-patches/issues/5320)) ([9d9cce3](9d9cce3)) * **YouTube - Hide layout components:** Add `Hide in history` option to filter bar ([ReVanced#5271](https://github.com/xChickens/revanced-patches/issues/5271)) ([ba242a3](ba242a3)) * **YouTube - Hide layout components:** Add `Hide ticket shelf` ([ReVanced#4969](https://github.com/xChickens/revanced-patches/issues/4969)) ([6436af7](6436af7)) * **YouTube - Hide player components:** Hide related video overlay in fullscreen ([ReVanced#4938](https://github.com/xChickens/revanced-patches/issues/4938)) ([ac9be97](ac9be97)) * **YouTube - Hide player overlay buttons:** Add in app setting for "Hide player control buttons background" ([ReVanced#5147](https://github.com/xChickens/revanced-patches/issues/5147)) ([dd8afa2](dd8afa2)) * **YouTube - Hide Shorts components:** Add `Hide Effects button` ([ReVanced#5255](https://github.com/xChickens/revanced-patches/issues/5255)) ([240897a](240897a)) * **YouTube - Hide Shorts components:** Add hide 'New posts' button ([ac6b916](ac6b916)) * **YouTube - Hide Shorts components:** Add option to hide comment panel ([ReVanced#5102](https://github.com/xChickens/revanced-patches/issues/5102)) ([22b9bee](22b9bee)) * **YouTube - Hide video action buttons:** Add `Hide Stop ads` ([ReVanced#5245](https://github.com/xChickens/revanced-patches/issues/5245)) ([274dcc6](274dcc6)) * **YouTube - Playback Speed:** Use modern custom speed dialog ([ReVanced#5069](https://github.com/xChickens/revanced-patches/issues/5069)) ([9a1e6ca](9a1e6ca)) * **YouTube - Settings:** Add a color picker ([ReVanced#4981](https://github.com/xChickens/revanced-patches/issues/4981)) ([1e0e398](1e0e398)) * **YouTube - Settings:** Add ability to search in settings ([ReVanced#4881](https://github.com/xChickens/revanced-patches/issues/4881)) ([aca8b20](aca8b20)) * **YouTube - SponsorBlock:** Add "Undo automatic skip toast" ([ReVanced#5277](https://github.com/xChickens/revanced-patches/issues/5277)) ([7fa169a](7fa169a)) * **YouTube - Swipe controls:** Add separate color settings for the brightness and volume bars ([ReVanced#5043](https://github.com/xChickens/revanced-patches/issues/5043)) ([80f50e8](80f50e8)) * **YouTube - Theme:** Add option for black and white splash screen animation ([ReVanced#5119](https://github.com/xChickens/revanced-patches/issues/5119)) ([42db0c2](42db0c2)) * **YouTube:** Add `Disable haptic feedback` patch ([ReVanced#5033](https://github.com/xChickens/revanced-patches/issues/5033)) ([bbe7974](bbe7974)) * **YouTube:** Add an option to disable toasts when changing default playback speed or quality ([ReVanced#5230](https://github.com/xChickens/revanced-patches/issues/5230)) ([c68cde3](c68cde3)) * **YouTube:** Support version `20.13.41` ([ReVanced#5253](https://github.com/xChickens/revanced-patches/issues/5253)) ([d284c3d](d284c3d))
Some custom roms have a patch, that adds a "FAKE_PACKAGE_SIGNATURE" permission, which allows the app to be seen with an other signature by other apps.
It is used for example by MicroG (to pretend to be GooglePlayServices).
Not every custom rom has it by default, and some only with the microg signature hardcoded. If it is supported though, I think its a better alternative to the "Mount install".