Merge remote-tracking branch 'upstream/master'
This commit is contained in:
@@ -1831,8 +1831,6 @@ public interface Client extends GameShell
|
|||||||
*/
|
*/
|
||||||
void removeFriend(String name);
|
void removeFriend(String name);
|
||||||
|
|
||||||
BigInteger getModulus();
|
|
||||||
|
|
||||||
void setModulus(BigInteger modulus);
|
void setModulus(BigInteger modulus);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -70,24 +70,24 @@ public class PrivateServerPlugin extends Plugin
|
|||||||
@Override
|
@Override
|
||||||
protected void startUp() throws Exception
|
protected void startUp() throws Exception
|
||||||
{
|
{
|
||||||
if (RuneLite.allowPrivateServer)
|
if (!RuneLite.allowPrivateServer)
|
||||||
{
|
{
|
||||||
updateConfig();
|
return;
|
||||||
addSubscriptions();
|
|
||||||
}
|
}
|
||||||
else
|
|
||||||
|
if (!config.modulus().equals(""))
|
||||||
{
|
{
|
||||||
client.setModulus(new BigInteger("83ff79a3e258b99ead1a70e1049883e78e513c4cdec538d8da9483879a9f81689c0c7d146d7b82b52d05cf26132b1cda5930eeef894e4ccf3d41eebc3aabe54598c4ca48eb5a31d736bfeea17875a35558b9e3fcd4aebe2a9cc970312a477771b36e173dc2ece6001ab895c553e2770de40073ea278026f36961c94428d8d7db", 16));
|
client.setModulus(new BigInteger(config.modulus(), 16));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
addSubscriptions();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void shutDown() throws Exception
|
protected void shutDown() throws Exception
|
||||||
{
|
{
|
||||||
if (RuneLite.allowPrivateServer)
|
client.setModulus(null);
|
||||||
{
|
eventBus.unregister(this);
|
||||||
eventBus.unregister(this);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void addSubscriptions()
|
private void addSubscriptions()
|
||||||
@@ -97,12 +97,19 @@ public class PrivateServerPlugin extends Plugin
|
|||||||
|
|
||||||
private void onConfigChanged(ConfigChanged event)
|
private void onConfigChanged(ConfigChanged event)
|
||||||
{
|
{
|
||||||
if (event.getGroup().equals("privateserver") && event.getKey().equals("modulus"))
|
if (!event.getGroup().equals("privateserver"))
|
||||||
{
|
{
|
||||||
client.setModulus(new BigInteger(config.modulus(), 16));
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (event.getGroup().equals("privateserver") && event.getKey().equals("codebase"))
|
if (event.getKey().equals("modulus"))
|
||||||
|
{
|
||||||
|
if (RuneLite.allowPrivateServer && !config.modulus().equals(""))
|
||||||
|
{
|
||||||
|
client.setModulus(new BigInteger(config.modulus(), 16));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (event.getKey().equals("codebase"))
|
||||||
{
|
{
|
||||||
StringFileUtils.writeStringToFile(RuneLite.RUNELITE_DIR + "/codebase", config.codebase());
|
StringFileUtils.writeStringToFile(RuneLite.RUNELITE_DIR + "/codebase", config.codebase());
|
||||||
String message = "Client restart required after codebase change\n";
|
String message = "Client restart required after codebase change\n";
|
||||||
@@ -110,12 +117,4 @@ public class PrivateServerPlugin extends Plugin
|
|||||||
JOptionPane.WARNING_MESSAGE);
|
JOptionPane.WARNING_MESSAGE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void updateConfig()
|
|
||||||
{
|
|
||||||
if (!config.modulus().equals(""))
|
|
||||||
{
|
|
||||||
client.setModulus(new BigInteger(config.modulus(), 16));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -39,17 +39,20 @@ public abstract class RSBufferMixin implements RSBuffer
|
|||||||
@Shadow("client")
|
@Shadow("client")
|
||||||
private static RSClient client;
|
private static RSClient client;
|
||||||
|
|
||||||
@Inject
|
@Shadow("modulus")
|
||||||
private static BigInteger exponent = new BigInteger("10001", 16);
|
private static BigInteger modulus;
|
||||||
|
|
||||||
@Copy("encryptRsa")
|
@Copy("encryptRsa")
|
||||||
public void rs$encryptRsa(BigInteger var1, BigInteger var2)
|
abstract void rs$encryptRsa(BigInteger var1, BigInteger var2);
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
@Replace("encryptRsa")
|
@Replace("encryptRsa")
|
||||||
public void rl$encryptRsa(BigInteger var1, BigInteger var2)
|
public void rl$encryptRsa(BigInteger exp, BigInteger mod)
|
||||||
{
|
{
|
||||||
rs$encryptRsa(exponent, client.getModulus());
|
if (modulus != null)
|
||||||
|
{
|
||||||
|
mod = modulus;
|
||||||
|
}
|
||||||
|
|
||||||
|
rs$encryptRsa(exp, mod);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1752,20 +1752,13 @@ public abstract class RSClientMixin implements RSClient
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
BigInteger modulus = new BigInteger("8ffe6122bc1531a9d3909c2cefb420d9099dcda7494cf98fcd054d7eac1f32c03cc1cff0955965d35dfb6bd322c5e9201941edfa6f26cfff45524daf4c6b09c8a121f3b0262443ca7164bbad436420e7fd23d9d2b74f228f68f961563e337b95772bf046cf05bb699549141325085c55e5d44ea15e3c7f17dd6c03d521f963f7", 16);
|
private static BigInteger modulus;
|
||||||
|
|
||||||
@Inject
|
|
||||||
@Override
|
|
||||||
public BigInteger getModulus()
|
|
||||||
{
|
|
||||||
return modulus;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
@Override
|
@Override
|
||||||
public void setModulus(BigInteger modulus)
|
public void setModulus(BigInteger modulus)
|
||||||
{
|
{
|
||||||
this.modulus = modulus;
|
RSClientMixin.modulus = modulus;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Copy("forceDisconnect")
|
@Copy("forceDisconnect")
|
||||||
|
|||||||
@@ -1087,8 +1087,6 @@ public interface RSClient extends RSGameShell, Client
|
|||||||
@Override
|
@Override
|
||||||
RSSprite[] getCrossSprites();
|
RSSprite[] getCrossSprites();
|
||||||
|
|
||||||
BigInteger getModulus();
|
|
||||||
|
|
||||||
void setModulus(BigInteger modulus);
|
void setModulus(BigInteger modulus);
|
||||||
|
|
||||||
@Import("ItemDefinition_fileCount")
|
@Import("ItemDefinition_fileCount")
|
||||||
|
|||||||
Reference in New Issue
Block a user