public static void addDecrypter(Decrypter decrypter) { Decrypter oldDecrypter = decrypters.putIfAbsent(decrypter.getId(), decrypter); if (oldDecrypter != null) { log.warn( "Replace decrypter [" + decrypter.getId() + ", " + oldDecrypter.getClass() + "] with [" + decrypter.getClass() + "]"); } }
private Map<String, byte[]> decryptGamepack(final byte[] gamepack) { System.out.println("Decrypting gamepack."); try { final Decrypter decrypter = new Decrypter(gamepack, game.getParameter("-1"), game.getParameter("0")); decrypter.decrypt(); System.out.println("Successfully decrypted gamepack."); return decrypter.getClasses(); } catch (final Exception e) { System.out.println("Unable to decrypt gamepack."); e.printStackTrace(); } return null; }
public void up(MessageBatch batch) { Decrypter decrypter = new Decrypter(); batch.map(decrypter); decrypter.unlock(); if (!batch.isEmpty()) up_prot.up(batch); }