feat(Strava): Add Export route patch
This commit is contained in:
committed by
Ohan Melkonyan
parent
b632d0f042
commit
9cb66197cf
+25
@@ -0,0 +1,25 @@
|
||||
package app.revanced.patches.strava.route.export
|
||||
|
||||
import app.revanced.patcher.extensions.addInstructions
|
||||
import app.revanced.patcher.patch.bytecodePatch
|
||||
import app.revanced.patches.strava.misc.extension.sharedExtensionPatch
|
||||
|
||||
private const val ROUTE_EXPORT_CLASS_DESCRIPTOR = "Lapp/revanced/extension/strava/AddRouteExportPatch;"
|
||||
|
||||
@Suppress("unused")
|
||||
val addRouteExportPatch = bytecodePatch(
|
||||
name = "Add route export",
|
||||
description = "Extends the route menu with items to export them in GPX or TCX formats.",
|
||||
) {
|
||||
compatibleWith("com.strava")
|
||||
|
||||
dependsOn(sharedExtensionPatch)
|
||||
|
||||
apply {
|
||||
// Intercept onCreate to display the export dialog over.
|
||||
shareSheetActivityOnCreateMethod.addInstructions(
|
||||
0,
|
||||
"invoke-static {p0}, $ROUTE_EXPORT_CLASS_DESCRIPTOR->showExportDialog(Landroid/app/Activity;)V"
|
||||
)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
package app.revanced.patches.strava.route.export
|
||||
|
||||
import app.revanced.patcher.definingClass
|
||||
import app.revanced.patcher.gettingFirstMethodDeclaratively
|
||||
import app.revanced.patcher.name
|
||||
import app.revanced.patcher.patch.BytecodePatchContext
|
||||
|
||||
internal val BytecodePatchContext.shareSheetActivityOnCreateMethod by gettingFirstMethodDeclaratively {
|
||||
name("onCreate")
|
||||
definingClass("Lcom/strava/sharing/view/ShareSheetActivity;")
|
||||
}
|
||||
Reference in New Issue
Block a user