1
.idea/misc.xml
generated
1
.idea/misc.xml
generated
@@ -1,4 +1,3 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<project version="4">
|
<project version="4">
|
||||||
<component name="ASMSmaliIdeaPluginConfiguration">
|
<component name="ASMSmaliIdeaPluginConfiguration">
|
||||||
<asm skipDebug="true" skipFrames="true" skipCode="false" expandFrames="false" />
|
<asm skipDebug="true" skipFrames="true" skipCode="false" expandFrames="false" />
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ plugins {
|
|||||||
}
|
}
|
||||||
|
|
||||||
group 'me.trouper'
|
group 'me.trouper'
|
||||||
version '0.0.3'
|
version '0.0.4'
|
||||||
|
|
||||||
repositories {
|
repositories {
|
||||||
mavenCentral()
|
mavenCentral()
|
||||||
@@ -11,6 +11,7 @@ repositories {
|
|||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
implementation 'net.objecthunter:exp4j:0.4.8'
|
implementation 'net.objecthunter:exp4j:0.4.8'
|
||||||
|
implementation 'com.ezylang:EvalEx:3.0.5'
|
||||||
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.8.1'
|
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.8.1'
|
||||||
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.8.1'
|
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.8.1'
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,13 +3,59 @@ package me.trouper.Functions;
|
|||||||
import me.trouper.Main;
|
import me.trouper.Main;
|
||||||
import me.trouper.Utils.Utils;
|
import me.trouper.Utils.Utils;
|
||||||
|
|
||||||
import java.util.Random;
|
import java.util.*;
|
||||||
|
|
||||||
import static me.trouper.Functions.Eval.eval;
|
import static me.trouper.Functions.Eval.eval;
|
||||||
import static me.trouper.Functions.Eval.isPerfectSquare;
|
import static me.trouper.Functions.Eval.isPerfectSquare;
|
||||||
|
|
||||||
public class Complexers {
|
public class Complexers {
|
||||||
|
/* Complexer Toggles */
|
||||||
|
public static boolean useDivide;
|
||||||
|
public static boolean usePower;
|
||||||
|
public static boolean useRoot;
|
||||||
|
public static boolean useRDividend;
|
||||||
|
public static boolean useRDivisor;
|
||||||
|
|
||||||
|
public static String pickComplexer() {
|
||||||
|
List<String> enabledComplexers = new ArrayList<>();
|
||||||
|
|
||||||
|
if (useDivide) enabledComplexers.add("divide");
|
||||||
|
if (usePower) enabledComplexers.add("power");
|
||||||
|
if (useRoot) enabledComplexers.add("root");
|
||||||
|
if (useRDividend) enabledComplexers.add("mrDividend");
|
||||||
|
if (useRDivisor) enabledComplexers.add("mrDivisor");
|
||||||
|
|
||||||
|
Collections.shuffle(enabledComplexers);
|
||||||
|
if (!enabledComplexers.isEmpty()) {
|
||||||
|
return enabledComplexers.get(0);
|
||||||
|
} else {
|
||||||
|
return "NONE";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public static String complex(int i, boolean deep) {
|
||||||
|
String complexer = pickComplexer();
|
||||||
|
if (isPerfectSquare(i)) complexer = "power";
|
||||||
|
switch (complexer) {
|
||||||
|
case "divide" -> {
|
||||||
|
return divide(i,deep);
|
||||||
|
}
|
||||||
|
case "power" -> {
|
||||||
|
return power(i,deep);
|
||||||
|
}
|
||||||
|
case "root" -> {
|
||||||
|
return root(i,deep);
|
||||||
|
}
|
||||||
|
case "mrDividend" -> {
|
||||||
|
return mRootDividend(i,deep);
|
||||||
|
}
|
||||||
|
case "mrDivisor" -> {
|
||||||
|
return mRootDivisor(i,deep);
|
||||||
|
}
|
||||||
|
default -> {
|
||||||
|
return divide(i,false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
/**
|
/**
|
||||||
* Safe to use with D mode
|
* Safe to use with D mode
|
||||||
* @param i Integer to divide
|
* @param i Integer to divide
|
||||||
@@ -24,13 +70,10 @@ public class Complexers {
|
|||||||
boolean expFac = false;
|
boolean expFac = false;
|
||||||
boolean expDoub = false;
|
boolean expDoub = false;
|
||||||
|
|
||||||
if (isPerfectSquare(factor)) expFac = true;
|
|
||||||
if (isPerfectSquare(doubled)) expDoub = true;
|
|
||||||
|
|
||||||
String result = "<&f>(<&r><&e>" + doubled + "<&b>/<&r><&e>" + factor + "<&f>)<&r>";
|
String result = "<&f>(<&r><&e>" + doubled + "<&b>/<&r><&e>" + factor + "<&f>)<&r>";
|
||||||
|
|
||||||
if (deep) {
|
if (deep) {
|
||||||
result = "<&3>(<&r><&d>" + ((expDoub) ? power(doubled,false) : divide(doubled,false)) + "<&b>/<&r><&d>" + ((expFac) ? power(factor,false) : divide(factor,false)) + "<&3>)<&r>";
|
result = "<&3>(<&r><&d>" + (complex(doubled,false)) + "<&b>/<&r><&d>" + (complex(factor,false)) + "<&3>)<&r>";
|
||||||
}
|
}
|
||||||
if (eval(result) != i) Utils.verbose("Failed to divide " + i + ", Attempted: " + result + "=" + eval(result));
|
if (eval(result) != i) Utils.verbose("Failed to divide " + i + ", Attempted: " + result + "=" + eval(result));
|
||||||
return eval(result) == i ? result : "(" + i + ")";
|
return eval(result) == i ? result : "(" + i + ")";
|
||||||
@@ -52,7 +95,7 @@ public class Complexers {
|
|||||||
String result = "<&r><&f>(<&e>" + root + "<&b>^<&e>2<&f>)<&r>";
|
String result = "<&r><&f>(<&e>" + root + "<&b>^<&e>2<&f>)<&r>";
|
||||||
|
|
||||||
if (deep) {
|
if (deep) {
|
||||||
result = "<&r><&3>(<&d>" + divide(root,false) + "<&b>^<&d>2<&3>)<&r>";
|
result = "<&r><&3>(<&d>" + complex(root,false) + "<&b>^<&d>2<&3>)<&r>";
|
||||||
}
|
}
|
||||||
if (eval(result) != i) Utils.verbose("<&ch>Failed to power <&r>" + i + ", Attempted: " + result + "=" + eval(result));
|
if (eval(result) != i) Utils.verbose("<&ch>Failed to power <&r>" + i + ", Attempted: " + result + "=" + eval(result));
|
||||||
return eval(result) == i ? result : "(" + i + ")";
|
return eval(result) == i ? result : "(" + i + ")";
|
||||||
@@ -69,7 +112,7 @@ public class Complexers {
|
|||||||
String result = "<&9>sqrt<&r><&f>(<&r><&e>" + squared + "<&f>)<&r>";
|
String result = "<&9>sqrt<&r><&f>(<&r><&e>" + squared + "<&f>)<&r>";
|
||||||
|
|
||||||
if (deep) {
|
if (deep) {
|
||||||
result = "<&1>sqrt<&r><&3>(<&r><&d>" + divide(squared,false) + "<&3>)<&r>";
|
result = "<&1>sqrt<&r><&3>(<&r><&d>" + complex(squared, false) + "<&3>)<&r>";
|
||||||
}
|
}
|
||||||
if (eval(result) != i) Utils.verbose("<&ch>Failed to root <&r>" + i + ", Attempted: " + result + "=" + eval(result));
|
if (eval(result) != i) Utils.verbose("<&ch>Failed to root <&r>" + i + ", Attempted: " + result + "=" + eval(result));
|
||||||
return (eval(result) == i) ? result : "(" + i + ")";
|
return (eval(result) == i) ? result : "(" + i + ")";
|
||||||
@@ -86,7 +129,10 @@ public class Complexers {
|
|||||||
int dividend = random.nextInt(9)+i+10;
|
int dividend = random.nextInt(9)+i+10;
|
||||||
int divisor = Utils.moduRootDivisor(dividend,i);
|
int divisor = Utils.moduRootDivisor(dividend,i);
|
||||||
String result = "<&r><&f>(<&e>" + dividend + "<&b>%<&e>" + divisor + "<&f>)<&r>";
|
String result = "<&r><&f>(<&e>" + dividend + "<&b>%<&e>" + divisor + "<&f>)<&r>";
|
||||||
Utils.verbose("<&dh><&b>mRootDivisor has been ran!<&r>" +
|
if (deep) {
|
||||||
|
result = "<&r><&7>(<&d>" + complex(dividend,false) + "<&b>%<&d>" + complex(divisor, false) + "<&7>)<&r>";
|
||||||
|
}
|
||||||
|
Utils.verbose("<&dh><&b>mRootDivisor has ran!<&r>" +
|
||||||
"\nWanted: " + i +
|
"\nWanted: " + i +
|
||||||
"\nDivisor: " + divisor +
|
"\nDivisor: " + divisor +
|
||||||
"\nDividend: " + dividend +
|
"\nDividend: " + dividend +
|
||||||
@@ -107,6 +153,9 @@ public class Complexers {
|
|||||||
int divisor = random.nextInt(9)+i+10;
|
int divisor = random.nextInt(9)+i+10;
|
||||||
int dividend = Utils.moduRootDividend(divisor,i);
|
int dividend = Utils.moduRootDividend(divisor,i);
|
||||||
String result = "<&r><&f>(<&e>" + dividend + "<&b>%<&e>" + divisor + "<&f>)<&r>";
|
String result = "<&r><&f>(<&e>" + dividend + "<&b>%<&e>" + divisor + "<&f>)<&r>";
|
||||||
|
if (deep) {
|
||||||
|
result = "<&r><&7>(<&d>" + complex(dividend,false) + "<&b>%<&d>" + complex(divisor,false) + "<&7>)<&r>";
|
||||||
|
}
|
||||||
Utils.verbose("<&dh><&b>mRootDividend has been ran!<&r>" +
|
Utils.verbose("<&dh><&b>mRootDividend has been ran!<&r>" +
|
||||||
"\nWanted:" + i +
|
"\nWanted:" + i +
|
||||||
"\nDivisor: " + divisor +
|
"\nDivisor: " + divisor +
|
||||||
@@ -115,5 +164,6 @@ public class Complexers {
|
|||||||
"\nResult: " + result);
|
"\nResult: " + result);
|
||||||
if (eval(result) != i) Utils.verbose("<&ch>Failed to mRootDividend<&r> " + i + ", Attempted: " + result + "=" + eval(result));
|
if (eval(result) != i) Utils.verbose("<&ch>Failed to mRootDividend<&r> " + i + ", Attempted: " + result + "=" + eval(result));
|
||||||
return (eval(result) == i) ? result : "(" + i + ")";
|
return (eval(result) == i) ? result : "(" + i + ")";
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,8 @@
|
|||||||
package me.trouper.Functions;
|
package me.trouper.Functions;
|
||||||
|
|
||||||
|
import com.ezylang.evalex.EvaluationException;
|
||||||
|
import com.ezylang.evalex.data.EvaluationValue;
|
||||||
|
import com.ezylang.evalex.parser.ParseException;
|
||||||
import me.trouper.Utils.Utils;
|
import me.trouper.Utils.Utils;
|
||||||
import net.objecthunter.exp4j.Expression;
|
import net.objecthunter.exp4j.Expression;
|
||||||
import net.objecthunter.exp4j.ExpressionBuilder;
|
import net.objecthunter.exp4j.ExpressionBuilder;
|
||||||
@@ -21,4 +24,9 @@ public class Eval {
|
|||||||
public static boolean isInt(double number) {
|
public static boolean isInt(double number) {
|
||||||
return (number == Math.floor(number)) && !Double.isInfinite(number);
|
return (number == Math.floor(number)) && !Double.isInfinite(number);
|
||||||
}
|
}
|
||||||
|
public static double evalM(String exp) throws EvaluationException, ParseException {
|
||||||
|
com.ezylang.evalex.Expression expression = new com.ezylang.evalex.Expression(exp);
|
||||||
|
EvaluationValue result = expression.evaluate();
|
||||||
|
return result.getNumberValue().doubleValue();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -53,7 +53,7 @@ public class Obf {
|
|||||||
eval = (int) eval(expression.toString());
|
eval = (int) eval(expression.toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
final String toAdd = complex(ri,deep,"n");
|
final String toAdd = Complexers.complex(ri,deep);
|
||||||
|
|
||||||
if (eval < target) {
|
if (eval < target) {
|
||||||
if (target - eval > 4069) {
|
if (target - eval > 4069) {
|
||||||
@@ -110,7 +110,7 @@ public class Obf {
|
|||||||
int ri = random.nextInt(9)+1;
|
int ri = random.nextInt(9)+1;
|
||||||
|
|
||||||
|
|
||||||
final String toAdd = complex(ri,deep,"d");
|
final String toAdd = Complexers.complex(ri,deep);
|
||||||
|
|
||||||
if (eval < target) {
|
if (eval < target) {
|
||||||
if (target - eval > 4096) {
|
if (target - eval > 4096) {
|
||||||
@@ -144,31 +144,4 @@ public class Obf {
|
|||||||
}
|
}
|
||||||
return expression.toString();
|
return expression.toString();
|
||||||
}
|
}
|
||||||
public static String increase(int target, int current, boolean deep, String mode) {
|
|
||||||
return target + "" + current;
|
|
||||||
}
|
|
||||||
public static String complex(int target, boolean deep, String mode) {
|
|
||||||
Random random = new Random();
|
|
||||||
String toAdd = "(" + target + ")";
|
|
||||||
int rComplexer;
|
|
||||||
switch (mode) {
|
|
||||||
case "n" -> rComplexer = random.nextInt(4)+1;
|
|
||||||
case "d" -> rComplexer = random.nextInt(3)+1;
|
|
||||||
default -> rComplexer = 1;
|
|
||||||
}
|
|
||||||
if (target == 1) {
|
|
||||||
toAdd = Complexers.power(target,deep);
|
|
||||||
} else if (isPerfectSquare(target)) {
|
|
||||||
toAdd = Complexers.power(target,deep);
|
|
||||||
} else {
|
|
||||||
switch (rComplexer) {
|
|
||||||
case 1 -> toAdd = Complexers.divide(target,deep);
|
|
||||||
case 2 -> toAdd = Complexers.mRootDivisor(target,deep);
|
|
||||||
case 3 -> toAdd = Complexers.mRootDividend(target,deep);
|
|
||||||
case 4 -> toAdd = Complexers.root(target,deep); // Won't reach this one, if its "d" due to it stopping at 3
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return (eval(toAdd) == target) ? toAdd : "(" + target + ")";
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package me.trouper;
|
package me.trouper;
|
||||||
|
|
||||||
|
import me.trouper.Functions.Complexers;
|
||||||
import me.trouper.Functions.Obf;
|
import me.trouper.Functions.Obf;
|
||||||
import me.trouper.Utils.Timer;
|
import me.trouper.Utils.Timer;
|
||||||
import me.trouper.Utils.Utils;
|
import me.trouper.Utils.Utils;
|
||||||
@@ -7,6 +8,7 @@ import me.trouper.Utils.Utils;
|
|||||||
import java.util.Scanner;
|
import java.util.Scanner;
|
||||||
|
|
||||||
import static me.trouper.Functions.Eval.eval;
|
import static me.trouper.Functions.Eval.eval;
|
||||||
|
import static me.trouper.Functions.Eval.evalM;
|
||||||
import static me.trouper.Utils.Utils.removeColors;
|
import static me.trouper.Utils.Utils.removeColors;
|
||||||
|
|
||||||
public class Main {
|
public class Main {
|
||||||
@@ -14,6 +16,7 @@ public class Main {
|
|||||||
public static boolean deep;
|
public static boolean deep;
|
||||||
public static boolean color;
|
public static boolean color;
|
||||||
public static boolean printHelp;
|
public static boolean printHelp;
|
||||||
|
|
||||||
/* Statistics */
|
/* Statistics */
|
||||||
public static int expCount = 0;
|
public static int expCount = 0;
|
||||||
public static int factorCount = 0;
|
public static int factorCount = 0;
|
||||||
@@ -44,7 +47,6 @@ public class Main {
|
|||||||
boolean doCopy = false;
|
boolean doCopy = false;
|
||||||
String mode = "N";
|
String mode = "N";
|
||||||
|
|
||||||
|
|
||||||
for (String arg : args) {
|
for (String arg : args) {
|
||||||
switch (arg) {
|
switch (arg) {
|
||||||
case "--copy", "-c" -> doCopy = true;
|
case "--copy", "-c" -> doCopy = true;
|
||||||
@@ -58,6 +60,14 @@ public class Main {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Complexers.useRoot = !mode.equals("D");
|
||||||
|
Complexers.usePower = true;
|
||||||
|
Complexers.useDivide = true;
|
||||||
|
Complexers.useRDivisor = true;
|
||||||
|
Complexers.useRDividend = true;
|
||||||
|
|
||||||
|
|
||||||
if (mode.equals("TEST")) {
|
if (mode.equals("TEST")) {
|
||||||
while (true) {
|
while (true) {
|
||||||
System.out.print("Enter an expression (or 'exit' to exit): ");
|
System.out.print("Enter an expression (or 'exit' to exit): ");
|
||||||
@@ -68,7 +78,7 @@ public class Main {
|
|||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
double result = eval(userInput);
|
double result = evalM(userInput);
|
||||||
System.out.println("Result: " + result);
|
System.out.println("Result: " + result);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
System.out.println("Error: " + e.getMessage());
|
System.out.println("Error: " + e.getMessage());
|
||||||
|
|||||||
@@ -39,14 +39,17 @@ public class Utils {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static void printHelp() {
|
public static void printHelp() {
|
||||||
System.out.println("Usage: java -jar Countroll-<version>.jar [options]");
|
System.out.println("""
|
||||||
System.out.println("Options:");
|
Usage: java -jar Countroll-<version>.jar [options]
|
||||||
System.out.println(" --copy, -c Copy the generated expression to the clipboard");
|
Options: values are formated as such: -m=d or -t=root
|
||||||
System.out.println(" --verbose, -v Enable verbose mode");
|
--copy, -c Copy the generated expression to the clipboard
|
||||||
System.out.println(" --deep, -d Enable deep obfuscation (under development)");
|
--verbose, -v Enable verbose mode
|
||||||
System.out.println(" --color, -rgb Enable colored output");
|
--deep, -d Enable deep obfuscation (under development)
|
||||||
System.out.println(" --help, --h, -h Show this help message");
|
--color, -rgb Enable colored output
|
||||||
System.out.println("Note: When using multiple options, separate them with spaces.");
|
--help, --h, -h Show this help message
|
||||||
|
--mode, -m Toggle the mode Values (Long): [duckgroup, numselli] Values (Brief): [d, n]
|
||||||
|
--toggle, -t Toggle off Complexer Values: [divide, power, root, mrDividend, mrDivisor]
|
||||||
|
Note: When using multiple options, separate them with spaces.""");
|
||||||
System.exit(0);
|
System.exit(0);
|
||||||
}
|
}
|
||||||
public static void printColorKey() {
|
public static void printColorKey() {
|
||||||
|
|||||||
7
src/main/java/me/trouper/Utils/Verbose.java
Normal file
7
src/main/java/me/trouper/Utils/Verbose.java
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
package me.trouper.Utils;
|
||||||
|
|
||||||
|
public class Verbose {
|
||||||
|
public static void send(String message, String klass, String type) {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user