Rename bundler to patcher

Closes #116.

This commit also changes the output directory from
nonfree/var/cache/bundle to nonfree/var/cache/client.

Signed-off-by: Graham <gpe@openrs2.org>
Graham 4 years ago
parent 30828308b2
commit c24d9ceb35
  1. 6
      .idea/runConfigurations/Patcher.xml
  2. 2
      all/build.gradle.kts
  3. 6
      all/src/main/kotlin/org/openrs2/Command.kt
  4. 15
      bundler/src/main/kotlin/org/openrs2/bundler/BundleCommand.kt
  5. 2
      deob/build.gradle.kts
  6. 10
      deob/src/main/kotlin/org/openrs2/deob/DeobfuscatorModule.kt
  7. 6
      deob/src/main/kotlin/org/openrs2/deob/transform/PatcherTransformer.kt
  8. 4
      patcher/build.gradle.kts
  9. 15
      patcher/src/main/kotlin/org/openrs2/patcher/PatchCommand.kt
  10. 8
      patcher/src/main/kotlin/org/openrs2/patcher/Patcher.kt
  11. 32
      patcher/src/main/kotlin/org/openrs2/patcher/PatcherModule.kt
  12. 4
      patcher/src/main/kotlin/org/openrs2/patcher/PatcherQualifier.kt
  13. 2
      patcher/src/main/kotlin/org/openrs2/patcher/Resource.kt
  14. 2
      patcher/src/main/kotlin/org/openrs2/patcher/transform/BufferSizeTransformer.kt
  15. 2
      patcher/src/main/kotlin/org/openrs2/patcher/transform/CachePathTransformer.kt
  16. 2
      patcher/src/main/kotlin/org/openrs2/patcher/transform/DomainTransformer.kt
  17. 2
      patcher/src/main/kotlin/org/openrs2/patcher/transform/HighDpiTransformer.kt
  18. 2
      patcher/src/main/kotlin/org/openrs2/patcher/transform/HostCheckTransformer.kt
  19. 2
      patcher/src/main/kotlin/org/openrs2/patcher/transform/LoadLibraryTransformer.kt
  20. 2
      patcher/src/main/kotlin/org/openrs2/patcher/transform/MacResizeTransformer.kt
  21. 2
      patcher/src/main/kotlin/org/openrs2/patcher/transform/MemoryAllocationTransformer.kt
  22. 2
      patcher/src/main/kotlin/org/openrs2/patcher/transform/NameTransformer.kt
  23. 2
      patcher/src/main/kotlin/org/openrs2/patcher/transform/PlatformDetectionTransformer.kt
  24. 2
      patcher/src/main/kotlin/org/openrs2/patcher/transform/PublicKeyTransformer.kt
  25. 4
      patcher/src/main/kotlin/org/openrs2/patcher/transform/ResourceTransformer.kt
  26. 2
      patcher/src/main/kotlin/org/openrs2/patcher/transform/RightClickTransformer.kt
  27. 2
      patcher/src/main/kotlin/org/openrs2/patcher/transform/TypoTransformer.kt
  28. 2
      settings.gradle.kts

@ -1,12 +1,12 @@
<component name="ProjectRunConfigurationManager"> <component name="ProjectRunConfigurationManager">
<configuration default="false" name="Bundler" type="JetRunConfigurationType"> <configuration default="false" name="Patcher" type="JetRunConfigurationType">
<module name="openrs2.bundler.main" /> <module name="openrs2.patcher.main" />
<option name="VM_PARAMETERS" value="" /> <option name="VM_PARAMETERS" value="" />
<option name="PROGRAM_PARAMETERS" value="" /> <option name="PROGRAM_PARAMETERS" value="" />
<option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" /> <option name="ALTERNATIVE_JRE_PATH_ENABLED" value="false" />
<option name="ALTERNATIVE_JRE_PATH" /> <option name="ALTERNATIVE_JRE_PATH" />
<option name="PASS_PARENT_ENVS" value="true" /> <option name="PASS_PARENT_ENVS" value="true" />
<option name="MAIN_CLASS_NAME" value="org.openrs2.bundler.BundleCommandKt" /> <option name="MAIN_CLASS_NAME" value="org.openrs2.patcher.PatchCommandKt" />
<option name="WORKING_DIRECTORY" value="" /> <option name="WORKING_DIRECTORY" value="" />
<method v="2"> <method v="2">
<option name="Make" enabled="true" /> <option name="Make" enabled="true" />

@ -16,13 +16,13 @@ application {
dependencies { dependencies {
implementation(project(":archive")) implementation(project(":archive"))
implementation(project(":bundler"))
implementation(project(":compress-cli")) implementation(project(":compress-cli"))
implementation(project(":crc32")) implementation(project(":crc32"))
implementation(project(":decompiler")) implementation(project(":decompiler"))
implementation(project(":deob")) implementation(project(":deob"))
implementation(project(":deob-ast")) implementation(project(":deob-ast"))
implementation(project(":game")) implementation(project(":game"))
implementation(project(":patcher"))
} }
tasks.shadowJar { tasks.shadowJar {

@ -3,13 +3,13 @@ package org.openrs2
import com.github.ajalt.clikt.core.NoOpCliktCommand import com.github.ajalt.clikt.core.NoOpCliktCommand
import com.github.ajalt.clikt.core.subcommands import com.github.ajalt.clikt.core.subcommands
import org.openrs2.archive.ArchiveCommand import org.openrs2.archive.ArchiveCommand
import org.openrs2.bundler.BundleCommand
import org.openrs2.compress.cli.CompressCommand import org.openrs2.compress.cli.CompressCommand
import org.openrs2.crc32.Crc32Command import org.openrs2.crc32.Crc32Command
import org.openrs2.decompiler.DecompileCommand import org.openrs2.decompiler.DecompileCommand
import org.openrs2.deob.DeobfuscateCommand import org.openrs2.deob.DeobfuscateCommand
import org.openrs2.deob.ast.DeobfuscateAstCommand import org.openrs2.deob.ast.DeobfuscateAstCommand
import org.openrs2.game.GameCommand import org.openrs2.game.GameCommand
import org.openrs2.patcher.PatchCommand
public fun main(args: Array<String>): Unit = Command().main(args) public fun main(args: Array<String>): Unit = Command().main(args)
@ -17,13 +17,13 @@ public class Command : NoOpCliktCommand(name = "openrs2") {
init { init {
subcommands( subcommands(
ArchiveCommand(), ArchiveCommand(),
BundleCommand(),
CompressCommand(), CompressCommand(),
Crc32Command(), Crc32Command(),
DecompileCommand(), DecompileCommand(),
DeobfuscateCommand(), DeobfuscateCommand(),
DeobfuscateAstCommand(), DeobfuscateAstCommand(),
GameCommand() GameCommand(),
PatchCommand()
) )
} }
} }

@ -1,15 +0,0 @@
package org.openrs2.bundler
import com.github.ajalt.clikt.core.CliktCommand
import com.google.inject.Guice
import java.nio.file.Paths
public fun main(args: Array<String>): Unit = BundleCommand().main(args)
public class BundleCommand : CliktCommand(name = "bundle") {
override fun run() {
val injector = Guice.createInjector(BundlerModule)
val bundler = injector.getInstance(Bundler::class.java)
bundler.run(Paths.get("nonfree/lib"), Paths.get("nonfree/var/cache/bundle"), Paths.get("etc/loader.p12"))
}
}

@ -11,9 +11,9 @@ application {
dependencies { dependencies {
api("com.github.ajalt.clikt:clikt:${Versions.clikt}") api("com.github.ajalt.clikt:clikt:${Versions.clikt}")
implementation(project(":bundler"))
implementation(project(":deob-annotations")) implementation(project(":deob-annotations"))
implementation(project(":deob-util")) implementation(project(":deob-util"))
implementation(project(":patcher"))
implementation(project(":yaml")) implementation(project(":yaml"))
implementation("com.google.guava:guava:${Versions.guava}") implementation("com.google.guava:guava:${Versions.guava}")
implementation("it.unimi.dsi:fastutil:${Versions.fastutil}") implementation("it.unimi.dsi:fastutil:${Versions.fastutil}")

@ -4,11 +4,8 @@ import com.google.inject.AbstractModule
import com.google.inject.Scopes import com.google.inject.Scopes
import com.google.inject.multibindings.Multibinder import com.google.inject.multibindings.Multibinder
import org.openrs2.asm.transform.Transformer import org.openrs2.asm.transform.Transformer
import org.openrs2.bundler.BundlerModule
import org.openrs2.bundler.transform.ResourceTransformer
import org.openrs2.deob.transform.BitShiftTransformer import org.openrs2.deob.transform.BitShiftTransformer
import org.openrs2.deob.transform.BitwiseOpTransformer import org.openrs2.deob.transform.BitwiseOpTransformer
import org.openrs2.deob.transform.BundlerTransformer
import org.openrs2.deob.transform.CanvasTransformer import org.openrs2.deob.transform.CanvasTransformer
import org.openrs2.deob.transform.ClassLiteralTransformer import org.openrs2.deob.transform.ClassLiteralTransformer
import org.openrs2.deob.transform.ConstantArgTransformer import org.openrs2.deob.transform.ConstantArgTransformer
@ -28,6 +25,7 @@ import org.openrs2.deob.transform.OriginalNameTransformer
import org.openrs2.deob.transform.OriginalPcRestoreTransformer import org.openrs2.deob.transform.OriginalPcRestoreTransformer
import org.openrs2.deob.transform.OriginalPcSaveTransformer import org.openrs2.deob.transform.OriginalPcSaveTransformer
import org.openrs2.deob.transform.OverrideTransformer import org.openrs2.deob.transform.OverrideTransformer
import org.openrs2.deob.transform.PatcherTransformer
import org.openrs2.deob.transform.RedundantGotoTransformer import org.openrs2.deob.transform.RedundantGotoTransformer
import org.openrs2.deob.transform.RemapTransformer import org.openrs2.deob.transform.RemapTransformer
import org.openrs2.deob.transform.ResetTransformer import org.openrs2.deob.transform.ResetTransformer
@ -36,10 +34,12 @@ import org.openrs2.deob.transform.UnusedLocalTransformer
import org.openrs2.deob.transform.UnusedMethodTransformer import org.openrs2.deob.transform.UnusedMethodTransformer
import org.openrs2.deob.transform.VisibilityTransformer import org.openrs2.deob.transform.VisibilityTransformer
import org.openrs2.deob.util.DeobfuscatorUtilModule import org.openrs2.deob.util.DeobfuscatorUtilModule
import org.openrs2.patcher.PatcherModule
import org.openrs2.patcher.transform.ResourceTransformer
public object DeobfuscatorModule : AbstractModule() { public object DeobfuscatorModule : AbstractModule() {
override fun configure() { override fun configure() {
install(BundlerModule) install(PatcherModule)
install(DeobfuscatorUtilModule) install(DeobfuscatorUtilModule)
bind(Profile::class.java) bind(Profile::class.java)
@ -52,7 +52,7 @@ public object DeobfuscatorModule : AbstractModule() {
binder.addBinding().to(ClassLiteralTransformer::class.java) binder.addBinding().to(ClassLiteralTransformer::class.java)
binder.addBinding().to(InvokeSpecialTransformer::class.java) binder.addBinding().to(InvokeSpecialTransformer::class.java)
binder.addBinding().to(RemapTransformer::class.java) binder.addBinding().to(RemapTransformer::class.java)
binder.addBinding().to(BundlerTransformer::class.java) binder.addBinding().to(PatcherTransformer::class.java)
binder.addBinding().to(ResourceTransformer::class.java) binder.addBinding().to(ResourceTransformer::class.java)
binder.addBinding().to(OpaquePredicateTransformer::class.java) binder.addBinding().to(OpaquePredicateTransformer::class.java)
binder.addBinding().to(ExceptionTracingTransformer::class.java) binder.addBinding().to(ExceptionTracingTransformer::class.java)

@ -3,13 +3,13 @@ package org.openrs2.deob.transform
import com.github.michaelbull.logging.InlineLogger import com.github.michaelbull.logging.InlineLogger
import org.openrs2.asm.classpath.ClassPath import org.openrs2.asm.classpath.ClassPath
import org.openrs2.asm.transform.Transformer import org.openrs2.asm.transform.Transformer
import org.openrs2.bundler.BundlerQualifier import org.openrs2.patcher.PatcherQualifier
import javax.inject.Inject import javax.inject.Inject
import javax.inject.Singleton import javax.inject.Singleton
@Singleton @Singleton
public class BundlerTransformer @Inject constructor( public class PatcherTransformer @Inject constructor(
@BundlerQualifier private val transformers: Set<Transformer> @PatcherQualifier private val transformers: Set<Transformer>
) : Transformer() { ) : Transformer() {
override fun transform(classPath: ClassPath) { override fun transform(classPath: ClassPath) {
for (transformer in transformers) { for (transformer in transformers) {

@ -5,7 +5,7 @@ plugins {
} }
application { application {
mainClass.set("org.openrs2.bundler.BundleCommandKt") mainClass.set("org.openrs2.patcher.PatchCommandKt")
} }
dependencies { dependencies {
@ -24,7 +24,7 @@ publishing {
pom { pom {
packaging = "jar" packaging = "jar"
name.set("OpenRS2 Bundler") name.set("OpenRS2 Patcher")
description.set( description.set(
""" """
A tool for patching the RuneScape client to allow it to connect A tool for patching the RuneScape client to allow it to connect

@ -0,0 +1,15 @@
package org.openrs2.patcher
import com.github.ajalt.clikt.core.CliktCommand
import com.google.inject.Guice
import java.nio.file.Paths
public fun main(args: Array<String>): Unit = PatchCommand().main(args)
public class PatchCommand : CliktCommand(name = "patch") {
override fun run() {
val injector = Guice.createInjector(PatcherModule)
val patcher = injector.getInstance(Patcher::class.java)
patcher.run(Paths.get("nonfree/lib"), Paths.get("nonfree/var/cache/client"), Paths.get("etc/loader.p12"))
}
}

@ -1,4 +1,4 @@
package org.openrs2.bundler package org.openrs2.patcher
import com.github.michaelbull.logging.InlineLogger import com.github.michaelbull.logging.InlineLogger
import org.openrs2.asm.classpath.ClassPath import org.openrs2.asm.classpath.ClassPath
@ -11,9 +11,9 @@ import org.openrs2.asm.io.Pack200LibraryWriter
import org.openrs2.asm.io.PackClassLibraryWriter import org.openrs2.asm.io.PackClassLibraryWriter
import org.openrs2.asm.io.SignedJarLibraryWriter import org.openrs2.asm.io.SignedJarLibraryWriter
import org.openrs2.asm.transform.Transformer import org.openrs2.asm.transform.Transformer
import org.openrs2.bundler.transform.ResourceTransformer
import org.openrs2.conf.Config import org.openrs2.conf.Config
import org.openrs2.crypto.Pkcs12KeyStore import org.openrs2.crypto.Pkcs12KeyStore
import org.openrs2.patcher.transform.ResourceTransformer
import java.nio.file.Files import java.nio.file.Files
import java.nio.file.Path import java.nio.file.Path
import java.util.jar.Attributes import java.util.jar.Attributes
@ -23,8 +23,8 @@ import javax.inject.Inject
import javax.inject.Singleton import javax.inject.Singleton
@Singleton @Singleton
public class Bundler @Inject constructor( public class Patcher @Inject constructor(
@BundlerQualifier private val transformers: Set<Transformer>, @PatcherQualifier private val transformers: Set<Transformer>,
private val config: Config private val config: Config
) { ) {
private val unsignedManifest = Manifest().apply { private val unsignedManifest = Manifest().apply {

@ -1,30 +1,30 @@
package org.openrs2.bundler package org.openrs2.patcher
import com.google.inject.AbstractModule import com.google.inject.AbstractModule
import com.google.inject.multibindings.Multibinder import com.google.inject.multibindings.Multibinder
import org.openrs2.asm.transform.Transformer import org.openrs2.asm.transform.Transformer
import org.openrs2.bundler.transform.BufferSizeTransformer
import org.openrs2.bundler.transform.CachePathTransformer
import org.openrs2.bundler.transform.DomainTransformer
import org.openrs2.bundler.transform.HighDpiTransformer
import org.openrs2.bundler.transform.HostCheckTransformer
import org.openrs2.bundler.transform.LoadLibraryTransformer
import org.openrs2.bundler.transform.MacResizeTransformer
import org.openrs2.bundler.transform.MemoryAllocationTransformer
import org.openrs2.bundler.transform.NameTransformer
import org.openrs2.bundler.transform.PlatformDetectionTransformer
import org.openrs2.bundler.transform.PublicKeyTransformer
import org.openrs2.bundler.transform.RightClickTransformer
import org.openrs2.bundler.transform.TypoTransformer
import org.openrs2.conf.ConfigModule import org.openrs2.conf.ConfigModule
import org.openrs2.crypto.CryptoModule import org.openrs2.crypto.CryptoModule
import org.openrs2.patcher.transform.BufferSizeTransformer
import org.openrs2.patcher.transform.CachePathTransformer
import org.openrs2.patcher.transform.DomainTransformer
import org.openrs2.patcher.transform.HighDpiTransformer
import org.openrs2.patcher.transform.HostCheckTransformer
import org.openrs2.patcher.transform.LoadLibraryTransformer
import org.openrs2.patcher.transform.MacResizeTransformer
import org.openrs2.patcher.transform.MemoryAllocationTransformer
import org.openrs2.patcher.transform.NameTransformer
import org.openrs2.patcher.transform.PlatformDetectionTransformer
import org.openrs2.patcher.transform.PublicKeyTransformer
import org.openrs2.patcher.transform.RightClickTransformer
import org.openrs2.patcher.transform.TypoTransformer
public object BundlerModule : AbstractModule() { public object PatcherModule : AbstractModule() {
override fun configure() { override fun configure() {
install(ConfigModule) install(ConfigModule)
install(CryptoModule) install(CryptoModule)
val binder = Multibinder.newSetBinder(binder(), Transformer::class.java, BundlerQualifier::class.java) val binder = Multibinder.newSetBinder(binder(), Transformer::class.java, PatcherQualifier::class.java)
binder.addBinding().to(BufferSizeTransformer::class.java) binder.addBinding().to(BufferSizeTransformer::class.java)
binder.addBinding().to(CachePathTransformer::class.java) binder.addBinding().to(CachePathTransformer::class.java)
binder.addBinding().to(HostCheckTransformer::class.java) binder.addBinding().to(HostCheckTransformer::class.java)

@ -1,8 +1,8 @@
package org.openrs2.bundler package org.openrs2.patcher
import javax.inject.Qualifier import javax.inject.Qualifier
@Qualifier @Qualifier
@Retention(AnnotationRetention.RUNTIME) @Retention(AnnotationRetention.RUNTIME)
@Target(AnnotationTarget.FIELD, AnnotationTarget.VALUE_PARAMETER, AnnotationTarget.FUNCTION) @Target(AnnotationTarget.FIELD, AnnotationTarget.VALUE_PARAMETER, AnnotationTarget.FUNCTION)
public annotation class BundlerQualifier public annotation class PatcherQualifier

@ -1,4 +1,4 @@
package org.openrs2.bundler package org.openrs2.patcher
import com.github.michaelbull.logging.InlineLogger import com.github.michaelbull.logging.InlineLogger
import org.openrs2.asm.classpath.ClassPath import org.openrs2.asm.classpath.ClassPath

@ -1,4 +1,4 @@
package org.openrs2.bundler.transform package org.openrs2.patcher.transform
import com.github.michaelbull.logging.InlineLogger import com.github.michaelbull.logging.InlineLogger
import org.objectweb.asm.tree.ClassNode import org.objectweb.asm.tree.ClassNode

@ -1,4 +1,4 @@
package org.openrs2.bundler.transform package org.openrs2.patcher.transform
import com.github.michaelbull.logging.InlineLogger import com.github.michaelbull.logging.InlineLogger
import org.objectweb.asm.tree.ClassNode import org.objectweb.asm.tree.ClassNode

@ -1,4 +1,4 @@
package org.openrs2.bundler.transform package org.openrs2.patcher.transform
import com.github.michaelbull.logging.InlineLogger import com.github.michaelbull.logging.InlineLogger
import org.objectweb.asm.tree.ClassNode import org.objectweb.asm.tree.ClassNode

@ -1,4 +1,4 @@
package org.openrs2.bundler.transform package org.openrs2.patcher.transform
import com.github.michaelbull.logging.InlineLogger import com.github.michaelbull.logging.InlineLogger
import org.objectweb.asm.Opcodes import org.objectweb.asm.Opcodes

@ -1,4 +1,4 @@
package org.openrs2.bundler.transform package org.openrs2.patcher.transform
import com.github.michaelbull.logging.InlineLogger import com.github.michaelbull.logging.InlineLogger
import org.objectweb.asm.Opcodes import org.objectweb.asm.Opcodes

@ -1,4 +1,4 @@
package org.openrs2.bundler.transform package org.openrs2.patcher.transform
import com.github.michaelbull.logging.InlineLogger import com.github.michaelbull.logging.InlineLogger
import org.objectweb.asm.Opcodes import org.objectweb.asm.Opcodes

@ -1,4 +1,4 @@
package org.openrs2.bundler.transform package org.openrs2.patcher.transform
import com.github.michaelbull.logging.InlineLogger import com.github.michaelbull.logging.InlineLogger
import org.objectweb.asm.Opcodes import org.objectweb.asm.Opcodes

@ -1,4 +1,4 @@
package org.openrs2.bundler.transform package org.openrs2.patcher.transform
import com.github.michaelbull.logging.InlineLogger import com.github.michaelbull.logging.InlineLogger
import org.objectweb.asm.Opcodes import org.objectweb.asm.Opcodes

@ -1,4 +1,4 @@
package org.openrs2.bundler.transform package org.openrs2.patcher.transform
import com.github.michaelbull.logging.InlineLogger import com.github.michaelbull.logging.InlineLogger
import org.objectweb.asm.tree.ClassNode import org.objectweb.asm.tree.ClassNode

@ -1,4 +1,4 @@
package org.openrs2.bundler.transform package org.openrs2.patcher.transform
import com.github.michaelbull.logging.InlineLogger import com.github.michaelbull.logging.InlineLogger
import org.objectweb.asm.Opcodes import org.objectweb.asm.Opcodes

@ -1,4 +1,4 @@
package org.openrs2.bundler.transform package org.openrs2.patcher.transform
import com.github.michaelbull.logging.InlineLogger import com.github.michaelbull.logging.InlineLogger
import org.bouncycastle.crypto.params.RSAPrivateCrtKeyParameters import org.bouncycastle.crypto.params.RSAPrivateCrtKeyParameters

@ -1,4 +1,4 @@
package org.openrs2.bundler.transform package org.openrs2.patcher.transform
import com.github.michaelbull.logging.InlineLogger import com.github.michaelbull.logging.InlineLogger
import org.objectweb.asm.Opcodes import org.objectweb.asm.Opcodes
@ -15,7 +15,7 @@ import org.openrs2.asm.classpath.ClassPath
import org.openrs2.asm.classpath.Library import org.openrs2.asm.classpath.Library
import org.openrs2.asm.toAbstractInsnNode import org.openrs2.asm.toAbstractInsnNode
import org.openrs2.asm.transform.Transformer import org.openrs2.asm.transform.Transformer
import org.openrs2.bundler.Resource import org.openrs2.patcher.Resource
public class ResourceTransformer( public class ResourceTransformer(
private val resources: List<Resource>? = null, private val resources: List<Resource>? = null,

@ -1,4 +1,4 @@
package org.openrs2.bundler.transform package org.openrs2.patcher.transform
import com.github.michaelbull.logging.InlineLogger import com.github.michaelbull.logging.InlineLogger
import org.objectweb.asm.Opcodes import org.objectweb.asm.Opcodes

@ -1,4 +1,4 @@
package org.openrs2.bundler.transform package org.openrs2.patcher.transform
import com.github.michaelbull.logging.InlineLogger import com.github.michaelbull.logging.InlineLogger
import org.objectweb.asm.tree.ClassNode import org.objectweb.asm.tree.ClassNode

@ -5,7 +5,6 @@ include(
"archive", "archive",
"asm", "asm",
"buffer", "buffer",
"bundler",
"cache", "cache",
"compress", "compress",
"compress-cli", "compress-cli",
@ -28,6 +27,7 @@ include(
"nonfree:signlink", "nonfree:signlink",
"nonfree:unpack", "nonfree:unpack",
"nonfree:unpackclass", "nonfree:unpackclass",
"patcher",
"protocol", "protocol",
"util", "util",
"yaml" "yaml"

Loading…
Cancel
Save