Starting to make a complexer toggler and picker
This commit is contained in:
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'
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,6 +9,12 @@ 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 divide;
|
||||||
|
public static boolean power;
|
||||||
|
public static boolean root;
|
||||||
|
public static boolean mrDividend;
|
||||||
|
public static boolean mrDivisor;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Safe to use with D mode
|
* Safe to use with D mode
|
||||||
@@ -86,7 +92,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><&f>(<&e>" + dividend + "<&b>%<&e>" + divisor + "<&f>)<&r>";
|
||||||
|
}
|
||||||
|
Utils.verbose("<&dh><&b>mRootDivisor has ran!<&r>" +
|
||||||
"\nWanted: " + i +
|
"\nWanted: " + i +
|
||||||
"\nDivisor: " + divisor +
|
"\nDivisor: " + divisor +
|
||||||
"\nDividend: " + dividend +
|
"\nDividend: " + dividend +
|
||||||
@@ -115,5 +124,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();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -171,4 +171,8 @@ public class Obf {
|
|||||||
|
|
||||||
return (eval(toAdd) == target) ? toAdd : "(" + target + ")";
|
return (eval(toAdd) == target) ? toAdd : "(" + target + ")";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static String pickComplexer() {
|
||||||
|
return "e";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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,6 +47,11 @@ public class Main {
|
|||||||
boolean doCopy = false;
|
boolean doCopy = false;
|
||||||
String mode = "N";
|
String mode = "N";
|
||||||
|
|
||||||
|
Complexers.divide = true;
|
||||||
|
Complexers.power = true;
|
||||||
|
Complexers.root = true;
|
||||||
|
Complexers.mrDividend = true;
|
||||||
|
Complexers.mrDivisor = true;
|
||||||
|
|
||||||
for (String arg : args) {
|
for (String arg : args) {
|
||||||
switch (arg) {
|
switch (arg) {
|
||||||
@@ -58,6 +66,8 @@ public class Main {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
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() {
|
||||||
|
|||||||
Reference in New Issue
Block a user