Tengo un archivo .site que pertenece a un programa llamado "Multiclicker2" quiero ver el codigo del archivo .site.
Ya decompile el Multiclicker2 con JD (Java Decompiler) y encontre esta clase que contiene el codigo que creo es como codifica y decodifica el archivo.
Código:
package org.multiclicker2.utils;
import java.util.Arrays;
import org.multiclicker2.a.d;
public class Base64Coder
{
private static final char[] jdField_a_of_type_ArrayOfChar;
private static final int[] jdField_a_of_type_ArrayOfInt;
public static String encodeString(String paramString)
{
return new String(encode(paramString.getBytes()));
}
public static char[] encode(byte[] paramArrayOfByte)
{
return encode(paramArrayOfByte, paramArrayOfByte.length);
}
public static char[] encode(byte[] paramArrayOfByte, int paramInt)
{
if ((paramInt < 0) || (paramInt > paramArrayOfByte.length)) {
throw new IllegalArgumentException("Invalid len or len greater than actual length of the input.");
}
char[] arrayOfChar = new char[(paramInt + 2) / 3 << 2];
int i = 0;
int j = 0;
int k;
int m;
int n;
while (i + 2 < paramInt)
{
k = (paramArrayOfByte[i] & 0xFF) >> 2;
m = (paramArrayOfByte[i] << 4 | (paramArrayOfByte[(i + 1)] & 0xFF) >> 4) & 0x3F;
n = (paramArrayOfByte[(i + 1)] << 2 | (paramArrayOfByte[(i + 2)] & 0xFF) >> 6) & 0x3F;
int i1 = paramArrayOfByte[(i + 2)] & 0x3F;
arrayOfChar[(j++)] = jdField_a_of_type_ArrayOfChar[k];
arrayOfChar[(j++)] = jdField_a_of_type_ArrayOfChar[m];
arrayOfChar[(j++)] = jdField_a_of_type_ArrayOfChar[n];
arrayOfChar[(j++)] = jdField_a_of_type_ArrayOfChar[i1];
i += 3;
}
switch (paramInt - i)
{
case 0:
break;
case 1:
k = (paramArrayOfByte[i] & 0xFF) >> 2;
m = paramArrayOfByte[i] << 4 & 0x3F;
arrayOfChar[(j++)] = jdField_a_of_type_ArrayOfChar[k];
arrayOfChar[(j++)] = jdField_a_of_type_ArrayOfChar[m];
arrayOfChar[(j++)] = '=';
arrayOfChar[j] = '=';
break;
case 2:
k = (paramArrayOfByte[i] & 0xFF) >> 2;
m = (paramArrayOfByte[i] << 4 | (paramArrayOfByte[(i + 1)] & 0xFF) >> 4) & 0x3F;
n = paramArrayOfByte[(i + 1)] << 2 & 0x3F;
arrayOfChar[(j++)] = jdField_a_of_type_ArrayOfChar[k];
arrayOfChar[(j++)] = jdField_a_of_type_ArrayOfChar[m];
arrayOfChar[(j++)] = jdField_a_of_type_ArrayOfChar[n];
arrayOfChar[j] = '=';
}
return arrayOfChar;
}
public static String decodeString(String paramString)
{
return new String(decode(paramString));
}
public static byte[] decode(String paramString)
{
return decode(paramString.toCharArray());
}
private static int a(char paramChar)
{
if (paramChar >= jdField_a_of_type_ArrayOfInt.length) {
throw new IllegalArgumentException("Not Base64 data.");
}
if ((paramChar = jdField_a_of_type_ArrayOfInt[paramChar]) < 0) {
throw new IllegalArgumentException("Not Base64 data.");
}
return paramChar;
}
public static byte[] decode(char[] paramArrayOfChar)
{
if (paramArrayOfChar.length % 4 != 0) {
throw new IllegalArgumentException("Not Base64 data.");
}
for (int i = paramArrayOfChar.length; (i > 0) && (paramArrayOfChar[(i - 1)] == '='); i--) {}
byte[] arrayOfByte = new byte[i * 3 / 4];
int j = 0;
int k = 0;
int m;
int n;
int i1;
while (j + 3 < i)
{
m = a(paramArrayOfChar[j]);
n = a(paramArrayOfChar[(j + 1)]);
i1 = a(paramArrayOfChar[(j + 2)]);
int i2 = a(paramArrayOfChar[(j + 3)]);
arrayOfByte[(k++)] = ((byte)(m << 2 | n >> 4));
arrayOfByte[(k++)] = ((byte)(n << 4 | i1 >> 2));
arrayOfByte[(k++)] = ((byte)(i1 << 6 | i2));
j += 4;
}
switch (paramArrayOfChar.length - i)
{
case 0:
break;
case 1:
if (j + 2 >= paramArrayOfChar.length) {
throw new IllegalArgumentException("Not Base64 data.");
}
m = a(paramArrayOfChar[j]);
n = a(paramArrayOfChar[(j + 1)]);
i1 = a(paramArrayOfChar[(j + 2)]);
arrayOfByte[(k++)] = ((byte)(m << 2 | n >> 4));
arrayOfByte[k] = ((byte)(n << 4 | i1 >> 2));
break;
case 2:
if (j + 1 >= paramArrayOfChar.length) {
throw new IllegalArgumentException("Not Base64 data.");
}
m = a(paramArrayOfChar[j]);
n = a(paramArrayOfChar[(j + 1)]);
arrayOfByte[k] = ((byte)(m << 2 | n >> 4));
}
return arrayOfByte;
}
public Base64Coder()
{
d.a("Do not instantiate Base64Coder. Provided methods are static.");
}
static
{
int i = (jdField_a_of_type_ArrayOfChar = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".toCharArray())[0];
for (int j = 1; j < jdField_a_of_type_ArrayOfChar.length; j++) {
if (jdField_a_of_type_ArrayOfChar[j] > i) {
i = jdField_a_of_type_ArrayOfChar[j];
}
}
Arrays.fill(jdField_a_of_type_ArrayOfInt = new int[i + 1], -1);
for (j = 0; j < jdField_a_of_type_ArrayOfChar.length; j++) {
jdField_a_of_type_ArrayOfInt[jdField_a_of_type_ArrayOfChar[j]] = j;
}
}
}
La pregunta es; ¿Cómo puedo decodificar el archivo .site usando este código? (En caso de que este codigo me sirva).
Gracias