Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

With GUI is working but with command give error #52

Closed
AskMeCode opened this issue Sep 6, 2019 · 26 comments
Closed

With GUI is working but with command give error #52

AskMeCode opened this issue Sep 6, 2019 · 26 comments
Labels
bug Something isn't working fixed The problem was fixed good first issue Good for newcomers

Comments

@AskMeCode
Copy link

Hello dear
When i use obfuscator-gui is working good i build the same config to use it with command.
i use this command:
java -jar .\Obfuscator\obfuscator-193.jar --config .\Obfuscator\Conf.json --jarIn abc.jar --jarOut .\Temp\abc2.jar

but i have this error:

Loading classpath...
Reading input...
Building Hierarchy...
Finishing...

Processing completed. If you found a bug / if the output
pen an issue at https://github.com/superblaubeere27/obfuscat
ERROR: java/lang/Object is missing in the classPath.
me.superblaubeere27.jobf.utils.MissingClassException: java/l
g in the classPath.
at me.superblaubeere27.jobf.JObfImpl.buildHierarchy(
at me.superblaubeere27.jobf.processors.name.NameObfu
t(NameObfuscation.java:62)
at me.superblaubeere27.jobf.JObfImpl.processJar(JObf
at me.superblaubeere27.jobf.JObf.main(JObf.java:231)

Can you give help please.

@x4e
Copy link
Collaborator

x4e commented Sep 8, 2019

Can you post the config contents? I'm guessing that you have not included

C:\\Program Files\\Java\\jre1.8.0_211\\lib

in the classpath (libraries section of config).

@superblaubeere27 superblaubeere27 added good first issue Good for newcomers question Further information is requested and removed further information required labels Sep 8, 2019
@superblaubeere27
Copy link
Owner

@AskMeCode It is how @cookiedragon234, you foget to add the JRE Runtime libraries. You are using MacOSX, so the JDK is somewhere else. If you don't know how to find it: Here is the solution on StackOverflow https://stackoverflow.com/questions/18144660/what-is-path-of-jdk-on-mac.
You just have to add the <JDK>/lib Folder. You can check if it's the right folder by checking if rt.jar is in it. In the case you can't find it just answere, we will help you :D

@AskMeCode
Copy link
Author

Thank you for your answer but as i told you with interface-gui is working without any problem i have already add this C:\Program Files\Java\jre1.8.0_201\lib
also exist in the config file

@x4e
Copy link
Collaborator

x4e commented Sep 8, 2019

@AskMeCode can you post your config?

@AskMeCode
Copy link
Author

AskMeCode commented Sep 8, 2019

  "input": "C:\\Users\\test\\Desktop\\file\\abc_ori.jar",
  "output": "C:\\Users\\test\\Desktop\\file\\Temp\\abc.jar",
  "script": "function isRemappingEnabledForClass(node) {\n    return false;\n}\nfunction isObfuscatorEnabledForClass(node) {\n    return true;\n}",
  "libraries": [
    "C:\\Program Files\\Java\\jre1.8.0_201\\lib"
  ],

@x4e
Copy link
Collaborator

x4e commented Sep 8, 2019

Can you post the entire config in a format as specified here https://help.github.com/en/articles/creating-and-highlighting-code-blocks#fenced-code-blocks (``` on each side of the text)

@x4e
Copy link
Collaborator

x4e commented Sep 8, 2019

Ok, the issue is that file paths must have the directory delimiters ("\") escaped (making them "\\").

This is your current config:

{
	"input": "C:\Users\said\Desktop\dex2jar-2.0\abc_ori.jar",
	"output": "C:\Users\said\Desktop\dex2jar-2.0\Temp\abc.jar",
	"script": "function isRemappingEnabledForClass(node) {\n return false;\n}\nfunction isObfuscatorEnabledForClass(node) {\n return true;\n}",
	"libraries": [
		"C:\Program Files\Java\jre1.8.0_201\lib"
	],
	"Crasher": {
		"Enabled": false
	},
	"InvokeDynamic": {
		"Enabled": false
	},
	"HWIDPRotection": {
		"Enabled": false,
		"HWID": "17BC92BE25B05F9D583AEDA89ED4906F"
	},
	"Optimizer": {
		"Enabled": false,
		"Replace String.equals()": false,
		"Replace String.equalsIgnoreCase()": false,
		"Optimize static string calls": false
	},
	"LineNumberRemover": {
		"Enabled": false,
		"Rename local variables": false,
		"Remove Line Numbers": true,
		"Remove Debug Names": true,
		"Add Local Variables": true,
		"New SourceFile Name": ""
	},
	"StringEncryption": {
		"Enabled": false,
		"HideStrings": false,
		"AES": false
	},
	"NumberObfuscation": {
		"Enabled": true,
		"Extract to Array": true,
		"Obfuscate Zero": true,
		"Shift": false,
		"And": false,
		"Multiple Instructions": true
	},
	"ReferenceProxy": {
		"Enabled": false
	},
	"ShuffleMembers": {
		"Enabled": true
	},
	"InnerClassRemover": {
		"Enabled": true,
		"Remap": false,
		"Remove Metadata": true
	},
	"NameObfuscation": {
		"Enabled": true
	},
	"Packager": {
		"Enabled": false,
		"Use MainClass from the JAR manifest": true,
		"Main class": "org.example.Main"
	},
	"FlowObfuscator": {
		"Enabled": true,
		"Mangle Comparisons": true,
		"Replace GOTO": true,
		"Replace If": true,
		"Bad POP": true,
		"Bad Concat": true,
		"Mangle Switches": false,
		"Mangle Return": false,
		"Mangle Local Variables": false
	},
	"HideMembers": {
		"Enabled": false
	},
	"Inlining": {
		"Enabled": false
	}
}

so you need to change it to:

{
	"input": "C:\\Users\\said\\Desktop\\dex2jar-2.0\\abc_ori.jar",
	"output": "C:\\Users\\said\\Desktop\\dex2jar-2.0\\Temp\\abc.jar",
	"script": "function isRemappingEnabledForClass(node) {\n return false;\n}\nfunction isObfuscatorEnabledForClass(node) {\n return true;\n}",
	"libraries": [
		"C:\\Program Files\\Java\\jre1.8.0_201\\lib"
	],
	"Crasher": {
		"Enabled": false
	},
	"InvokeDynamic": {
		"Enabled": false
	},
	"HWIDPRotection": {
		"Enabled": false,
		"HWID": "17BC92BE25B05F9D583AEDA89ED4906F"
	},
	"Optimizer": {
		"Enabled": false,
		"Replace String.equals()": false,
		"Replace String.equalsIgnoreCase()": false,
		"Optimize static string calls": false
	},
	"LineNumberRemover": {
		"Enabled": false,
		"Rename local variables": false,
		"Remove Line Numbers": true,
		"Remove Debug Names": true,
		"Add Local Variables": true,
		"New SourceFile Name": ""
	},
	"StringEncryption": {
		"Enabled": false,
		"HideStrings": false,
		"AES": false
	},
	"NumberObfuscation": {
		"Enabled": true,
		"Extract to Array": true,
		"Obfuscate Zero": true,
		"Shift": false,
		"And": false,
		"Multiple Instructions": true
	},
	"ReferenceProxy": {
		"Enabled": false
	},
	"ShuffleMembers": {
		"Enabled": true
	},
	"InnerClassRemover": {
		"Enabled": true,
		"Remap": false,
		"Remove Metadata": true
	},
	"NameObfuscation": {
		"Enabled": true
	},
	"Packager": {
		"Enabled": false,
		"Use MainClass from the JAR manifest": true,
		"Main class": "org.example.Main"
	},
	"FlowObfuscator": {
		"Enabled": true,
		"Mangle Comparisons": true,
		"Replace GOTO": true,
		"Replace If": true,
		"Bad POP": true,
		"Bad Concat": true,
		"Mangle Switches": false,
		"Mangle Return": false,
		"Mangle Local Variables": false
	},
	"HideMembers": {
		"Enabled": false
	},
	"Inlining": {
		"Enabled": false
	}
}

@AskMeCode
Copy link
Author

sorry i have this "\" i don't know why is messing when i past the code

@AskMeCode
Copy link
Author

AskMeCode commented Sep 8, 2019

{
  "input": "C:\\Users\\test\\Desktop\\dfile\\abc_ori.jar",
  "output": "C:\\Users\\test\\Desktop\\dfile\\Temp\\abc.jar",
  "script": "function isRemappingEnabledForClass(node) {\n    return false;\n}\nfunction isObfuscatorEnabledForClass(node) {\n    return true;\n}",
  "libraries": [
    "C:\\Program Files\\Java\\jre1.8.0_201\\lib"
  ],
  "Crasher": {
    "Enabled": false
  },
  "InvokeDynamic": {
    "Enabled": false
  },
  "HWIDPRotection": {
    "Enabled": false,
    "HWID": "17BC92BE25B05F9D583AEDA89ED4906F"
  },
  "Optimizer": {
    "Enabled": false,
    "Replace String.equals()": false,
    "Replace String.equalsIgnoreCase()": false,
    "Optimize static string calls": false
  },
  "LineNumberRemover": {
    "Enabled": false,
    "Rename local variables": false,
    "Remove Line Numbers": true,
    "Remove Debug Names": true,
    "Add Local Variables": true,
    "New SourceFile Name": ""
  },
  "StringEncryption": {
    "Enabled": false,
    "HideStrings": false,
    "AES": false
  },
  "NumberObfuscation": {
    "Enabled": true,
    "Extract to Array": true,
    "Obfuscate Zero": true,
    "Shift": false,
    "And": false,
    "Multiple Instructions": true
  },
  "ReferenceProxy": {
    "Enabled": false
  },
  "ShuffleMembers": {
    "Enabled": true
  },
  "InnerClassRemover": {
    "Enabled": true,
    "Remap": false,
    "Remove Metadata": true
  },
  "NameObfuscation": {
    "Enabled": true
  },
  "Packager": {
    "Enabled": false,
    "Use MainClass from the JAR manifest": true,
    "Main class": "org.example.Main"
  },
  "FlowObfuscator": {
    "Enabled": true,
    "Mangle Comparisons": true,
    "Replace GOTO": true,
    "Replace If": true,
    "Bad POP": true,
    "Bad Concat": true,
    "Mangle Switches": false,
    "Mangle Return": false,
    "Mangle Local Variables": false
  },
  "HideMembers": {
    "Enabled": false
  },
  "Inlining": {
    "Enabled": false
  }
}

@x4e
Copy link
Collaborator

x4e commented Sep 8, 2019

Can you confirm that the directory is correct? If you go to it in file explorer it should look like this:
Directory

Make sure rt.jar is there.

@AskMeCode
Copy link
Author

yes i have check this i can send you screenshot also if you like

@x4e
Copy link
Collaborator

x4e commented Sep 8, 2019

If you open rt.jar in winrar and go to java/lang can you see Object.class?

Object

And does it also have the same file size?

@AskMeCode
Copy link
Author

But why with the interface is working good
image

@AskMeCode
Copy link
Author

If you open rt.jar in winrar and go to java/lang can you see Object.class?

Object

And does it also have the same file size?

image

@x4e x4e assigned x4e and unassigned x4e Sep 9, 2019
@KingDeng
Copy link

KingDeng commented Sep 9, 2019

Is this issue fixed?I have the same error, I'm sure jre library path is correct, but always missing java/lang/Object

@superblaubeere27
Copy link
Owner

@KingDeng can you run tree in the folder you specified and send us the results?

@KingDeng
Copy link

KingDeng commented Sep 10, 2019

@superblaubeere27 this is tree results:
tree
image
this is my config:
image
I found some strange things, I have installed two jdks on company's pc,one 1.7,other 1.8, then obfuscator cmd and gui con't run; but I only installed a jdk on my private pc, the gui can run, cmd con't run.

@superblaubeere27
Copy link
Owner

@KingDeng This is pretty confusing, because I can't reproduce the behaviour.

@superblaubeere27
Copy link
Owner

I have to withdraw my statement from earlier, I faced this issue, when I tried to make a gradle plugin for the obfuscator. I will find the error and fix it.

@superblaubeere27
Copy link
Owner

I was able to reproduce and fix it. I will commit the changes tomorrow.

@superblaubeere27 superblaubeere27 added this to the 1.9.4 Subrelease milestone Sep 12, 2019
@superblaubeere27 superblaubeere27 removed the question Further information is requested label Sep 12, 2019
@superblaubeere27 superblaubeere27 added bug Something isn't working fixed The problem was fixed labels Sep 12, 2019
@superblaubeere27
Copy link
Owner

Fixed in cfd6d9e

@AskMeCode
Copy link
Author

Thanks dear @superblaubeere27 but were is the link to download 1.9.4 ?

@superblaubeere27
Copy link
Owner

@AskMeCode Here is the latest build of JitPack: https://jitpack.io/com/github/superblaubeere27/obfuscator/obfuscator-core/8fb0fc2e37/obfuscator-core-8fb0fc2e37.jar

@AskMeCode
Copy link
Author

AskMeCode commented Sep 13, 2019

dear @superblaubeere27 can you help to add the function load config for the version 1.71 ? because this is the alone version work great for me without any crash in my app and it is fast

@superblaubeere27
Copy link
Owner

@AskMeCode In CLI? No. This is a newer feature. In GUI yes. This is fully supported in 1.7+. If there is a bug please report it so we can fix it :D

@a8underscore
Copy link

I get this issue in gui @superblaubeere27 but not in command line

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working fixed The problem was fixed good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

5 participants