chore: merge branch dev to main (#1553)

Signed-off-by: oSumAtrIX <johan.melkonyan1@web.de>
Co-authored-by: oSumAtrIX <johan.melkonyan1@web.de>
Co-authored-by: LisoUseInAIKyrios <118716522+LisoUseInAIKyrios@users.noreply.github.com>
Co-authored-by: illerokcob <113302047+illerokcob@users.noreply.github.com>
This commit is contained in:
github-actions[bot]
2023-01-28 20:07:06 +01:00
committed by GitHub
parent cd10e9f95d
commit 22245de7d5
10 changed files with 93 additions and 6 deletions

View File

@ -0,0 +1,9 @@
package app.revanced.patches.irplus.ad.annotations
import app.revanced.patcher.annotation.Compatibility
import app.revanced.patcher.annotation.Package
@Compatibility([Package("net.binarymode.android.irplus")])
@Target(AnnotationTarget.CLASS)
@Retention(AnnotationRetention.RUNTIME)
internal annotation class IrplusAdsCompatibility

View File

@ -0,0 +1,12 @@
package app.revanced.patches.irplus.ad.fingerprints
import app.revanced.patcher.extensions.or
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
import org.jf.dexlib2.AccessFlags
object IrplusAdsFingerprint : MethodFingerprint(
"V",
AccessFlags.PUBLIC or AccessFlags.CONSTRUCTOR,
listOf("L", "Z"),
strings = listOf("TAGGED")
)

View File

@ -0,0 +1,33 @@
package app.revanced.patches.irplus.ad.patch
import app.revanced.patcher.annotation.Description
import app.revanced.patcher.annotation.Name
import app.revanced.patcher.annotation.Version
import app.revanced.patcher.data.BytecodeContext
import app.revanced.patcher.extensions.addInstruction
import app.revanced.patcher.patch.BytecodePatch
import app.revanced.patcher.patch.PatchResult
import app.revanced.patcher.patch.PatchResultSuccess
import app.revanced.patcher.patch.annotations.Patch
import app.revanced.patches.irplus.ad.annotations.IrplusAdsCompatibility
import app.revanced.patches.irplus.ad.fingerprints.IrplusAdsFingerprint
@Patch
@Name("remove-ads")
@Description("Removes all ads from the app.")
@IrplusAdsCompatibility
@Version("0.0.1")
class IrplusAdsPatch : BytecodePatch(
listOf(IrplusAdsFingerprint)
) {
override fun execute(context: BytecodeContext): PatchResult {
val method = IrplusAdsFingerprint.result!!.mutableMethod
// By overwriting the second parameter of the method,
// the view which holds the advertisement is removed.
method.addInstruction(0, "const/4 p2, 0x0")
return PatchResultSuccess()
}
}

View File

@ -31,14 +31,14 @@ class CopyVideoUrlResourcePatch : ResourcePatch {
StringResource("revanced_copy_video_url_title", "Copy video URL settings"),
listOf(
SwitchPreference(
"revanced_copy_video_url",
"revanced_copy_video_url_enabled",
StringResource("revanced_copy_video_url_enabled_title", "Show copy video URL button"),
true,
StringResource("revanced_copy_video_url_enabled_summary_on", "Button is shown, click to copy video URL without timestamp"),
StringResource("revanced_copy_video_url_enabled_summary_off", "Button is not shown")
),
SwitchPreference(
"revanced_copy_video_url_timestamp",
"revanced_copy_video_url_timestamp_enabled",
StringResource("revanced_copy_video_url_timestamp_enabled_title", "Show copy timestamp URL button"),
true,
StringResource("revanced_copy_video_url_timestamp_enabled_summary_on", "Button is shown, click to copy video URL with timestamp"),

View File

@ -30,7 +30,7 @@ class DownloadsResourcePatch : ResourcePatch {
StringResource("revanced_downloads_title", "Download settings"),
listOf(
SwitchPreference(
"revanced_downloads",
"revanced_downloads_enabled",
StringResource("revanced_downloads_enabled_title", "Show download button"),
true,
StringResource("revanced_downloads_enabled_summary_on", "Download button is shown"),

View File

@ -14,7 +14,8 @@ internal object MicroGResourceHelper {
* @param context The resource context.
* @param stringsHost The file which hosts the strings.
*/
fun addStrings(context: ResourceContext, stringsHost: String = "microg/host/values/strings.xml") = context.mergeStrings(stringsHost)
fun addStrings(context: ResourceContext, stringsHost: String = "microg/host/values/strings.xml") =
context.mergeStrings(stringsHost)
/**
* Patch the manifest to work with MicroG.
@ -47,6 +48,9 @@ internal object MicroGResourceHelper {
).replace(
"$fromPackageName.permission.C2D_MESSAGE",
"$toPackageName.permission.C2D_MESSAGE"
).replace(
"$fromPackageName.DYNAMIC_RECEIVER_NOT_EXPORTED_PERMISSION",
"$toPackageName.DYNAMIC_RECEIVER_NOT_EXPORTED_PERMISSION"
).replace(
"com.google.android.c2dm",
"${Constants.MICROG_VENDOR}.android.c2dm"