Skip to content

Commit

Permalink
feat: Add identity hash code to unnamed patches
Browse files Browse the repository at this point in the history
  • Loading branch information
oSumAtrIX committed Dec 7, 2024
1 parent ead701b commit 88a3252
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/main/kotlin/app/revanced/patcher/patch/Patch.kt
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,8 @@ sealed class Patch<C : PatchContext<*>>(
finalizeBlock?.invoke(context)
}

override fun toString() = name ?: "Patch"
override fun toString() = name ?:
"Patch@${System.identityHashCode(this)}"
}

internal fun Patch<*>.anyRecursively(
Expand Down Expand Up @@ -161,7 +162,7 @@ class BytecodePatch internal constructor(

override fun finalize(context: PatcherContext) = finalize(context.bytecodeContext)

override fun toString() = name ?: "BytecodePatch"
override fun toString() = name ?: "Bytecode${super.toString()}"
}

/**
Expand Down Expand Up @@ -204,7 +205,7 @@ class RawResourcePatch internal constructor(

override fun finalize(context: PatcherContext) = finalize(context.resourceContext)

override fun toString() = name ?: "RawResourcePatch"
override fun toString() = name ?: "RawResource${super.toString()}"
}

/**
Expand Down Expand Up @@ -247,7 +248,7 @@ class ResourcePatch internal constructor(

override fun finalize(context: PatcherContext) = finalize(context.resourceContext)

override fun toString() = name ?: "ResourcePatch"
override fun toString() = name ?: "Resource${super.toString()}"
}

/**
Expand Down

0 comments on commit 88a3252

Please # to comment.