Automate Java source code obfuscation with a flexible Web API for PHP, Python, JavaScript, Rust, and C# (.NET / NuGet).
You can use all of the features of JObfuscator via our Web API interface. The Web API is based on POST requests and emits JSON encoded responses.
For faster deployment, installation packages for the JObfuscator Web API have been uploaded to popular repositories (Packagist, PyPI, npm, crates.io, NuGet). Source code has also been published on GitHub:
| Repository | Language | Installation | Package | Sources |
|---|---|---|---|---|
![]() |
PHP | Run:
or add the following to |
Packagist | GitHub |
![]() |
Python | |
PyPI | GitHub |
![]() |
JavaScript | Run:
or add the following to |
npm | GitHub |
![]() |
Rust | Run:
or add the following to |
Crates | GitHub |
![]() |
C# | Run:
or add to your |
NuGet | GitHub |
<?php
/******************************************************************************
* JObfuscator WebApi interface usage example.
*
* In this example we will obfuscate sample source with default options.
*
* Version : v1.04
* Language : PHP
* Author : Bartosz W?jcik
* Web page : https://www.pelock.com
*
*****************************************************************************/
//
// include JObfuscator class
//
use PELock\JObfuscator;
//
// if you don't want to use Composer use include_once
//
//include_once "JObfuscator.php";
//
// create JObfuscator class instance (we are using our activation key)
//
$myJObfuscator = new PELock\JObfuscator("ABCD-ABCD-ABCD-ABCD");
//
// source code in Java format
//
$sourceCode = 'import java.util.*;
import java.lang.*;
import java.io.*;
//
// you must include custom annotation
// to enable entire class or a single
// method obfuscation
//
@Obfuscate
class Ideone
{
//@Obfuscate
public static double calculateSD(double numArray[])
{
double sum = 0.0, standardDeviation = 0.0;
int length = numArray.length;
for(double num : numArray) {
sum += num;
}
double mean = sum/length;
for(double num: numArray) {
standardDeviation += Math.pow(num - mean, 2);
}
return Math.sqrt(standardDeviation/length);
}
//
// selective obfuscation strategies
// can be applied for the entire
// class or a single method (by
// default all obfuscation strategies
// are enabled when you use @Obfuscate
// annotation alone)
//
//@Obfuscate(
// ints_math_crypt = true,
// dbls_math_crypt = true,
// string_split = true,
// crypt_strings = true,
// string_char_vault = true,
// rename_methods = false,
// rename_variables = true,
// shuffle_methods = true,
// array_int_crypt = true,
// array_double_crypt = true,
// array_char_crypt = true,
// array_string_crypt = true,
// mix_code_flow = true,
// ints_from_double_math = true,
// opaque_mixer_chain = true,
// complexify_booleans = true,
// try_finally_noise = true,
// ints_to_arrays = true,
// dbls_to_arrays = true
// )
public static void main(String[] args) {
double[] numArray = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 };
double SD = calculateSD(numArray);
System.out.format("Standard Deviation = %.6f", SD);
}
}';
//
// by default all obfuscation options are enabled, so we can just simply call:
//
$result = $myJObfuscator->ObfuscateJavaSource($sourceCode);
//
// it's also possible to pass a Java source file path instead of a string e.g.
//
// $result = $myJObfuscator->ObfuscateJavaFile("/path/to/project/source.java");
//
// $result[] array holds the obfuscation results as well as other information
//
// $result["error"] - error code
// $result["output"] - obfuscated code
// $result["demo"] - was it used in demo mode (invalid or empty activation key was used)
// $result["credits_left"] - usage credits left after this operation
// $result["credits_total"] - total number of credits for this activation code
// $result["expired"] - if this was the last usage credit for the activation key it will be set to true
//
if ($result !== false)
{
// display obfuscated code
if ($result["error"] === \PELock\JObfuscator::ERROR_SUCCESS)
{
// format output code for HTML display
echo "<pre>" . htmlentities($result["output"]) . "</pre>";
}
else
{
die("An error occurred, error code: " . $result["error"]);
}
}
else
{
die("Something unexpected happen while trying to obfuscate the code.");
}
?>
#!/usr/bin/env python
###############################################################################
#
# JObfuscator WebApi interface usage example.
#
# In this example we will obfuscate sample source with default options.
#
# Version : v1.04
# Language : Python
# Author : Bartosz W?jcik
# Web page : https://www.pelock.com
#
###############################################################################
#
# include JObfuscator module
#
from jobfuscator import JObfuscator
#
# if you don't want to use Python module, you can import directly from the file
#
#from pelock.jobfuscator import JObfuscator
#
# create JObfuscator class instance (we are using our activation key)
#
myJObfuscator = JObfuscator("ABCD-ABCD-ABCD-ABCD")
#
# source code in Java format
#
sourceCode = """import java.util.*;
import java.lang.*;
import java.io.*;
//
// you must include custom annotation
// to enable entire class or a single
// method obfuscation
//
@Obfuscate
class Ideone
{
//@Obfuscate
public static double calculateSD(double numArray[])
{
double sum = 0.0, standardDeviation = 0.0;
int length = numArray.length;
for(double num : numArray) {
sum += num;
}
double mean = sum/length;
for(double num: numArray) {
standardDeviation += Math.pow(num - mean, 2);
}
return Math.sqrt(standardDeviation/length);
}
//
// selective obfuscation strategies
// can be applied for the entire
// class or a single method (by
// default all obfuscation strategies
// are enabled when you use @Obfuscate
// annotation alone)
//
//@Obfuscate(
// ints_math_crypt = true,
// dbls_math_crypt = true,
// string_split = true,
// crypt_strings = true,
// string_char_vault = true,
// rename_methods = false,
// rename_variables = true,
// shuffle_methods = true,
// array_int_crypt = true,
// array_double_crypt = true,
// array_char_crypt = true,
// array_string_crypt = true,
// mix_code_flow = true,
// ints_from_double_math = true,
// opaque_mixer_chain = true,
// complexify_booleans = true,
// try_finally_noise = true,
// ints_to_arrays = true,
// dbls_to_arrays = true
// )
public static void main(String[] args) {
double[] numArray = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 };
double SD = calculateSD(numArray);
System.out.format("Standard Deviation = %.6f", SD);
}
}"""
#
# by default all obfuscation options are enabled, so we can just simply call
#
result = myJObfuscator.obfuscate_java_source(sourceCode)
#
# it's also possible to pass a Java source file path instead of a string with the source e.g.
#
# result = myJObfuscator.obfuscate_java_file("/path/to/project/source.java")
#
# result[] array holds the obfuscation results as well as other information
#
# result["error"] - error code
# result["output"] - obfuscated code
# result["demo"] - was it used in demo mode (invalid or empty activation key was used)
# result["credits_left"] - usage credits left after this operation
# result["credits_total"] - total number of credits for this activation code
# result["expired"] - if this was the last usage credit for the activation key it will be set to True
#
if result and "error" in result:
# display obfuscated code
if result["error"] == JObfuscator.ERROR_SUCCESS:
# format output code for HTML display
print(result["output"])
else:
print(f'An error occurred, error code: {result["error"]}')
else:
print("Something unexpected happen while trying to obfuscate the code.")
/******************************************************************************
* JObfuscator WebApi interface usage example.
*
* In this example we will obfuscate sample source with default options.
*
* Version : v1.0.0
* Language : JavaScript
* Author : Bartosz W?jcik
* Web page : https://www.pelock.com
*
*****************************************************************************/
import JObfuscator from "jobfuscator";
//
// include JObfuscator class
//
//
// if you don't want to use npm use import from a local copy
//
// import JObfuscator from "./jobfuscator.js";
//
// create JObfuscator class instance (we are using our activation key)
//
const myJObfuscator = new JObfuscator("ABCD-ABCD-ABCD-ABCD");
//
// source code in Java format
//
const sourceCode = `import java.util.*;
import java.lang.*;
import java.io.*;
//
// you must include custom annotation
// to enable entire class or a single
// method obfuscation
//
@Obfuscate
class Ideone
{
//@Obfuscate
public static double calculateSD(double numArray[])
{
double sum = 0.0, standardDeviation = 0.0;
int length = numArray.length;
for(double num : numArray) {
sum += num;
}
double mean = sum/length;
for(double num: numArray) {
standardDeviation += Math.pow(num - mean, 2);
}
return Math.sqrt(standardDeviation/length);
}
//
// selective obfuscation strategies
// can be applied for the entire
// class or a single method (by
// default all obfuscation strategies
// are enabled when you use @Obfuscate
// annotation alone)
//
//@Obfuscate(
// ints_math_crypt = true,
// dbls_math_crypt = true,
// string_split = true,
// crypt_strings = true,
// string_char_vault = true,
// rename_methods = false,
// rename_variables = true,
// shuffle_methods = true,
// array_int_crypt = true,
// array_double_crypt = true,
// array_char_crypt = true,
// array_string_crypt = true,
// mix_code_flow = true,
// ints_from_double_math = true,
// opaque_mixer_chain = true,
// complexify_booleans = true,
// try_finally_noise = true,
// ints_to_arrays = true,
// dbls_to_arrays = true
// )
public static void main(String[] args) {
double[] numArray = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 };
double SD = calculateSD(numArray);
System.out.format("Standard Deviation = %.6f", SD);
}
}`;
//
// by default all obfuscation options are enabled, so we can just simply call:
//
const result = await myJObfuscator.obfuscateJavaSource(sourceCode);
//
// it's also possible to pass a Java source file path instead of a string e.g.
//
// const result = await myJObfuscator.obfuscateJavaFile("/path/to/project/source.java");
//
// result object holds the obfuscation results as well as other information
//
// result.error - error code
// result.output - obfuscated code
// result.demo - was it used in demo mode (invalid or empty activation key was used)
// result.credits_left - usage credits left after this operation
// result.credits_total - total number of credits for this activation code
// result.expired - if this was the last usage credit for the activation key it will be set to true
//
if (result !== null) {
//
// display obfuscated code
//
if (result.error === JObfuscator.ERROR_SUCCESS) {
console.log(result.output);
} else {
throw new Error("An error occurred, error code: " + result.error);
}
} else {
throw new Error("Something unexpected happen while trying to obfuscate the code.");
}
/******************************************************************************
* JObfuscator WebApi interface usage example.
*
* In this example we will obfuscate sample source with default options.
*
* Version : v1.0.0
* Language : Rust
* Author : Bartosz W?jcik
* Web page : https://www.pelock.com
*
*****************************************************************************/
use jobfuscator::{JObfuscator, JObfuscatorResponse};
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
//
// include JObfuscator class
//
//
// if you don't want to use crates.io use a path dependency in Cargo.toml
//
// jobfuscator = { path = "../jobfuscator" }
//
// create JObfuscator class instance (we are using our activation key)
//
let my_jobfuscator = JObfuscator::new(Some("ABCD-ABCD-ABCD-ABCD".to_string()));
//
// source code in Java format
//
let source_code = r#"import java.util.*;
import java.lang.*;
import java.io.*;
//
// you must include custom annotation
// to enable entire class or a single
// method obfuscation
//
@Obfuscate
class Ideone
{
//@Obfuscate
public static double calculateSD(double numArray[])
{
double sum = 0.0, standardDeviation = 0.0;
int length = numArray.length;
for(double num : numArray) {
sum += num;
}
double mean = sum/length;
for(double num: numArray) {
standardDeviation += Math.pow(num - mean, 2);
}
return Math.sqrt(standardDeviation/length);
}
//
// selective obfuscation strategies
// can be applied for the entire
// class or a single method (by
// default all obfuscation strategies
// are enabled when you use @Obfuscate
// annotation alone)
//
//@Obfuscate(
// ints_math_crypt = true,
// dbls_math_crypt = true,
// string_split = true,
// crypt_strings = true,
// string_char_vault = true,
// rename_methods = false,
// rename_variables = true,
// shuffle_methods = true,
// array_int_crypt = true,
// array_double_crypt = true,
// array_char_crypt = true,
// array_string_crypt = true,
// mix_code_flow = true,
// ints_from_double_math = true,
// opaque_mixer_chain = true,
// complexify_booleans = true,
// try_finally_noise = true,
// ints_to_arrays = true,
// dbls_to_arrays = true
// )
public static void main(String[] args) {
double[] numArray = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 };
double SD = calculateSD(numArray);
System.out.format("Standard Deviation = %.6f", SD);
}
}"#;
//
// by default all obfuscation options are enabled, so we can just simply call:
//
let result = my_jobfuscator
.obfuscate_java_source(source_code, true)
.await;
//
// it's also possible to pass a Java source file path instead of a string e.g.
//
// let result = my_jobfuscator
// .obfuscate_java_file(std::path::Path::new("/path/to/project/source.java"), true)
// .await;
//
// result object holds the obfuscation results as well as other information
//
// result.error - error code
// result.output - obfuscated code
// result.demo - was it used in demo mode (invalid or empty activation key was used)
// result.credits_left - usage credits left after this operation
// result.credits_total - total number of credits for this activation code
// result.expired - if this was the last usage credit for the activation key it will be set to true
//
match result {
Some(JObfuscatorResponse::Object(obj)) => {
//
// display obfuscated code
//
if obj.error == JObfuscator::ERROR_SUCCESS {
println!("{}", obj.output.unwrap_or_default());
} else {
return Err(format!("An error occurred, error code: {}", obj.error).into());
}
}
Some(JObfuscatorResponse::Json(_)) => {}
None => {
return Err("Something unexpected happen while trying to obfuscate the code.".into());
}
}
Ok(())
}
/******************************************************************************
* JObfuscator WebApi interface usage example.
*
* In this example we will obfuscate sample source with default options.
*
* Version : v1.0.0
* Language : C#
* Author : Bartosz W?jcik
* Web page : https://www.pelock.com
*
* NuGet PackageReference Include="JObfuscator"
* Sources : https://github.com/PELock/JObfuscator-CSharp
*
*****************************************************************************/
using PELock;
//
// create JObfuscator class instance (we are using our activation key)
//
var myJObfuscator = new JObfuscator("ABCD-ABCD-ABCD-ABCD");
//
// source code in Java format
//
const string SourceCode =
"""
import java.util.*;
import java.lang.*;
import java.io.*;
//
// you must include custom annotation
// to enable entire class or a single
// method obfuscation
//
@Obfuscate
class Ideone
{
//@Obfuscate
public static double calculateSD(double numArray[])
{
double sum = 0.0, standardDeviation = 0.0;
int length = numArray.length;
for(double num : numArray) {
sum += num;
}
double mean = sum/length;
for(double num: numArray) {
standardDeviation += Math.pow(num - mean, 2);
}
return Math.sqrt(standardDeviation/length);
}
//
// selective obfuscation strategies
// can be applied for the entire
// class or a single method (by
// default all obfuscation strategies
// are enabled when you use @Obfuscate
// annotation alone)
//
//@Obfuscate(
// ints_math_crypt = true,
// dbls_math_crypt = true,
// string_split = true,
// crypt_strings = true,
// string_char_vault = true,
// rename_methods = false,
// rename_variables = true,
// shuffle_methods = true,
// array_int_crypt = true,
// array_double_crypt = true,
// array_char_crypt = true,
// array_string_crypt = true,
// mix_code_flow = true,
// ints_from_double_math = true,
// opaque_mixer_chain = true,
// complexify_booleans = true,
// try_finally_noise = true,
// ints_to_arrays = true,
// dbls_to_arrays = true
// )
public static void main(String[] args) {
double[] numArray = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 };
double SD = calculateSD(numArray);
System.out.format("Standard Deviation = %.6f", SD);
}
}
""";
//
// by default all obfuscation options are enabled, so we can just simply call:
//
var result = await myJObfuscator.ObfuscateJavaSourceAsync(SourceCode);
//
// it's also possible to pass a Java source file path instead of a string e.g.
//
// var result = await myJObfuscator.ObfuscateJavaFileAsync("/path/to/project/source.java");
//
// result object holds the obfuscation results as well as other information
//
// result?.Error - error code (see JObfuscator.Error*)
// result?.Output - obfuscated code
// result?.Demo - was it used in demo mode (invalid or empty activation key was used)
// result?.CreditsLeft - usage credits left after this operation
// result?.CreditsTotal - total number of credits for this activation code
// result?.Expired - if this was the last usage credit for the activation key it will be set to true
//
if (result is not null)
{
//
// display obfuscated code
//
if (result.Error == JObfuscator.ErrorSuccess && result.Output is not null)
Console.WriteLine(result.Output);
else
throw new InvalidOperationException("An error occurred, error code: " + result.Error);
}
else
{
throw new InvalidOperationException("Something unexpected happen while trying to obfuscate the code.");
}
<?php
/******************************************************************************
* JObfuscator WebApi interface usage example.
*
* In this example we will obfuscate sample source with custom options.
*
* Version : v1.04
* Language : PHP
* Author : Bartosz W?jcik
* Web page : https://www.pelock.com
*
*****************************************************************************/
//
// include JObfuscator class
//
use PELock\JObfuscator;
//
// if you don't want to use Composer use include_once
//
//include_once "JObfuscator.php";
//
// create JObfuscator class instance (we are using our activation key)
//
$myJObfuscator = new PELock\JObfuscator("ABCD-ABCD-ABCD-ABCD");
//
// should the source code be compressed (both input & compressed)
//
$myJObfuscator->enableCompression = true;
//
// global obfuscation options
//
// when disabled will discard any @Obfuscate annotation declaration
// in the Java source code
//
// you can disable a particular obfuscation strategy globally if it
// fails or you don't want to use it without modifying the source codes
//
// by default all obfuscation strategies are enabled
//
//
// change linear code execution flow to non-linear version
//
$myJObfuscator->mixCodeFlow = true;
//
// rename variable names to random string values
//
$myJObfuscator->renameVariables = true;
//
// rename method names to random string values
//
$myJObfuscator->renameMethods = true;
//
// shuffle order of methods in the output source
//
$myJObfuscator->shuffleMethods = true;
//
// encrypt int/double/char/string array literals with runtime decryption
//
$myJObfuscator->arrayIntCrypt = true;
$myJObfuscator->arrayDoubleCrypt = true;
$myJObfuscator->arrayCharCrypt = true;
$myJObfuscator->arrayStringCrypt = true;
//
// encrypt integers using more than 15 floating point math functions from the java.lang.Math.* class
//
$myJObfuscator->intsMathCrypt = true;
//
// encrypt doubles using floating point math functions from the java.lang.Math.* class
//
$myJObfuscator->dblsMathCrypt = true;
//
// split string literals into nested String.concat(...) chains before string encryption
//
$myJObfuscator->stringSplit = true;
//
// encrypt strings using polymorphic encryption algorithms
//
$myJObfuscator->cryptStrings = true;
//
// rebuild string literals from hidden char arrays
//
$myJObfuscator->stringCharVault = true;
//
// express selected integers through equivalent double math expressions
//
$myJObfuscator->intsFromDoubleMath = true;
//
// inject opaque mixer chains and unreachable guards
//
$myJObfuscator->opaqueMixerChain = true;
//
// replace boolean literals with equivalent runtime expressions
//
$myJObfuscator->complexifyBooleans = true;
//
// wrap selected statements in noisy try/finally blocks
//
$myJObfuscator->tryFinallyNoise = true;
//
// for each method, extract all possible integers from the code and store them in an array
//
$myJObfuscator->intsToArrays = true;
//
// for each method, extract all possible doubles from the code and store them in an array
//
$myJObfuscator->dblsToArrays = true;
//
// source code in Java format
//
$sourceCode = 'import java.util.*;
import java.lang.*;
import java.io.*;
//
// you must include custom annotation
// to enable entire class or a single
// method obfuscation
//
@Obfuscate
class Ideone
{
//@Obfuscate
public static double calculateSD(double numArray[])
{
double sum = 0.0, standardDeviation = 0.0;
int length = numArray.length;
for(double num : numArray) {
sum += num;
}
double mean = sum/length;
for(double num: numArray) {
standardDeviation += Math.pow(num - mean, 2);
}
return Math.sqrt(standardDeviation/length);
}
//
// selective obfuscation strategies
// can be applied for the entire
// class or a single method (by
// default all obfuscation strategies
// are enabled when you use @Obfuscate
// annotation alone)
//
//@Obfuscate(
// ints_math_crypt = true,
// dbls_math_crypt = true,
// string_split = true,
// crypt_strings = true,
// string_char_vault = true,
// rename_methods = false,
// rename_variables = true,
// shuffle_methods = true,
// array_int_crypt = true,
// array_double_crypt = true,
// array_char_crypt = true,
// array_string_crypt = true,
// mix_code_flow = true,
// ints_from_double_math = true,
// opaque_mixer_chain = true,
// complexify_booleans = true,
// try_finally_noise = true,
// ints_to_arrays = true,
// dbls_to_arrays = true
// )
public static void main(String[] args) {
double[] numArray = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 };
double SD = calculateSD(numArray);
System.out.format("Standard Deviation = %.6f", SD);
}
}';
//
// by default all options are enabled, both helper random numbers
// generation & obfuscation strategies, so we can just simply call:
//
$result = $myJObfuscator->ObfuscateJavaSource($sourceCode);
//
// it's also possible to pass a Java source file path instead of a string e.g.
//
// $result = $myJObfuscator->ObfuscateJavaFile("/path/to/project/source.java");
//
// $result[] array holds the obfuscation results as well as other information
//
// $result["error"] - error code
// $result["output"] - obfuscated code
// $result["demo"] - was it used in demo mode (invalid or empty activation key was used)
// $result["credits_left"] - usage credits left after this operation
// $result["credits_total"] - total number of credits for this activation code
// $result["expired"] - if this was the last usage credit for the activation key it will be set to true
//
if ($result !== false)
{
// display obfuscated code
if ($result["error"] === \PELock\JObfuscator::ERROR_SUCCESS)
{
// format output code for HTML display
echo "<pre>" . htmlentities($result["output"]) . "</pre>";
}
else
{
die("An error occurred, error code: " . $result["error"]);
}
}
else
{
die("Something unexpected happen while trying to obfuscate the code.");
}
?>
#!/usr/bin/env python
###############################################################################
#
# JObfuscator WebApi interface usage example.
#
# In this example we will obfuscate sample source with custom options.
#
# Version : v1.04
# Language : Python
# Author : Bartosz W?jcik
# Web page : https://www.pelock.com
#
###############################################################################
#
# include JObfuscator module
#
from jobfuscator import JObfuscator
#
# if you don't want to use Python module, you can import directly from the file
#
#from pelock.jobfuscator import JObfuscator
#
# create JObfuscator class instance (we are using our activation key)
#
myJObfuscator = JObfuscator("ABCD-ABCD-ABCD-ABCD")
#
# global obfuscation options
#
# when disabled will discard any @Obfuscate annotation declaration
# in the Java source code
#
# you can disable a particular obfuscation strategy globally if it
# fails or you don't want to use it without modifying the source codes
#
# by default all obfuscation strategies are enabled
#
#
# should the source code be compressed (both input & compressed)
#
myJObfuscator.enableCompression = True
#
# change linear code execution flow to non-linear version
#
myJObfuscator.mixCodeFlow = True
#
# rename variable names to random string values
#
myJObfuscator.renameVariables = True
#
# rename method names to random string values
#
myJObfuscator.renameMethods = True
#
# shuffle order of methods in the output source
#
myJObfuscator.shuffleMethods = True
#
# encrypt int/double/char/string array literals with runtime decryption
#
myJObfuscator.arrayIntCrypt = True
myJObfuscator.arrayDoubleCrypt = True
myJObfuscator.arrayCharCrypt = True
myJObfuscator.arrayStringCrypt = True
#
# encrypt integers using more than 15 floating point math functions from the java.lang.Math.* class
#
myJObfuscator.intsMathCrypt = True
#
# encrypt doubles using floating point math functions from the java.lang.Math.* class
#
myJObfuscator.dblsMathCrypt = True
#
# split string literals into nested String.concat(...) chains before string encryption
#
myJObfuscator.stringSplit = True
#
# encrypt strings using polymorphic encryption algorithms
#
myJObfuscator.cryptStrings = True
#
# rebuild string literals from hidden char arrays
#
myJObfuscator.stringCharVault = True
#
# express selected integers through equivalent double math expressions
#
myJObfuscator.intsFromDoubleMath = True
#
# inject opaque mixer chains and unreachable guards
#
myJObfuscator.opaqueMixerChain = True
#
# replace boolean literals with equivalent runtime expressions
#
myJObfuscator.complexifyBooleans = True
#
# wrap selected statements in noisy try/finally blocks
#
myJObfuscator.tryFinallyNoise = True
#
# for each method, extract all possible integers from the code and store them in an array
#
myJObfuscator.intsToArrays = True
#
# for each method, extract all possible doubles from the code and store them in an array
#
myJObfuscator.dblsToArrays = True
#
# source code in Java format
#
sourceCode = """import java.util.*;
import java.lang.*;
import java.io.*;
//
// you must include custom annotation
// to enable entire class or a single
// method obfuscation
//
@Obfuscate
class Ideone
{
//@Obfuscate
public static double calculateSD(double numArray[])
{
double sum = 0.0, standardDeviation = 0.0;
int length = numArray.length;
for(double num : numArray) {
sum += num;
}
double mean = sum/length;
for(double num: numArray) {
standardDeviation += Math.pow(num - mean, 2);
}
return Math.sqrt(standardDeviation/length);
}
//
// selective obfuscation strategies
// can be applied for the entire
// class or a single method (by
// default all obfuscation strategies
// are enabled when you use @Obfuscate
// annotation alone)
//
//@Obfuscate(
// ints_math_crypt = true,
// dbls_math_crypt = true,
// string_split = true,
// crypt_strings = true,
// string_char_vault = true,
// rename_methods = false,
// rename_variables = true,
// shuffle_methods = true,
// array_int_crypt = true,
// array_double_crypt = true,
// array_char_crypt = true,
// array_string_crypt = true,
// mix_code_flow = true,
// ints_from_double_math = true,
// opaque_mixer_chain = true,
// complexify_booleans = true,
// try_finally_noise = true,
// ints_to_arrays = true,
// dbls_to_arrays = true
// )
public static void main(String[] args) {
double[] numArray = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 };
double SD = calculateSD(numArray);
System.out.format("Standard Deviation = %.6f", SD);
}
}"""
#
# by default all obfuscation options are enabled, so we can just simply call
#
result = myJObfuscator.obfuscate_java_source(sourceCode)
#
# result[] array holds the obfuscation results as well as other information
#
# result["error"] - error code
# result["output"] - obfuscated code
# result["demo"] - was it used in demo mode (invalid or empty activation key was used)
# result["credits_left"] - usage credits left after this operation
# result["credits_total"] - total number of credits for this activation code
# result["expired"] - if this was the last usage credit for the activation key it will be set to True
#
if result and "error" in result:
# display obfuscated code
if result["error"] == JObfuscator.ERROR_SUCCESS:
# format output code for HTML display
print(result["output"])
else:
print(f'An error occurred, error code: {result["error"]}')
else:
print("Something unexpected happen while trying to obfuscate the code.")
/******************************************************************************
* JObfuscator WebApi interface usage example.
*
* In this example we will obfuscate sample source with custom options.
*
* Version : v1.0.0
* Language : JavaScript
* Author : Bartosz W?jcik
* Web page : https://www.pelock.com
*
*****************************************************************************/
import JObfuscator from "jobfuscator";
//
// include JObfuscator class
//
//
// if you don't want to use npm use import from a local copy
//
// import JObfuscator from "./jobfuscator.js";
//
// create JObfuscator class instance (we are using our activation key)
//
const myJObfuscator = new JObfuscator("ABCD-ABCD-ABCD-ABCD");
//
// should the source code be compressed (both input & compressed)
//
myJObfuscator.enableCompression = true;
//
// global obfuscation options
//
// when disabled will discard any @Obfuscate annotation declaration
// in the Java source code
//
// you can disable a particular obfuscation strategy globally if it
// fails or you don't want to use it without modifying the source codes
//
// by default all obfuscation strategies are enabled
//
//
// change linear code execution flow to non-linear version
//
myJObfuscator.mixCodeFlow = true;
//
// rename variable names to random string values
//
myJObfuscator.renameVariables = true;
//
// rename method names to random string values
//
myJObfuscator.renameMethods = true;
//
// shuffle order of methods in the output source
//
myJObfuscator.shuffleMethods = true;
//
// encrypt int/double/char/string array literals with runtime decryption
//
myJObfuscator.arrayIntCrypt = true;
myJObfuscator.arrayDoubleCrypt = true;
myJObfuscator.arrayCharCrypt = true;
myJObfuscator.arrayStringCrypt = true;
//
// encrypt integers using more than 15 floating point math functions from the java.lang.Math.* class
//
myJObfuscator.intsMathCrypt = true;
//
// encrypt doubles using floating point math functions from the java.lang.Math.* class
//
myJObfuscator.dblsMathCrypt = true;
//
// split string literals into nested String.concat(...) chains before string encryption
//
myJObfuscator.stringSplit = true;
//
// encrypt strings using polymorphic encryption algorithms
//
myJObfuscator.cryptStrings = true;
//
// rebuild string literals from hidden char arrays
//
myJObfuscator.stringCharVault = true;
//
// express selected integers through equivalent double math expressions
//
myJObfuscator.intsFromDoubleMath = true;
//
// inject opaque mixer chains and unreachable guards
//
myJObfuscator.opaqueMixerChain = true;
//
// replace boolean literals with equivalent runtime expressions
//
myJObfuscator.complexifyBooleans = true;
//
// wrap selected statements in noisy try/finally blocks
//
myJObfuscator.tryFinallyNoise = true;
//
// for each method, extract all possible integers from the code and store them in an array
//
myJObfuscator.intsToArrays = true;
//
// for each method, extract all possible doubles from the code and store them in an array
//
myJObfuscator.dblsToArrays = true;
//
// source code in Java format
//
const sourceCode = `import java.util.*;
import java.lang.*;
import java.io.*;
//
// you must include custom annotation
// to enable entire class or a single
// method obfuscation
//
@Obfuscate
class Ideone
{
//@Obfuscate
public static double calculateSD(double numArray[])
{
double sum = 0.0, standardDeviation = 0.0;
int length = numArray.length;
for(double num : numArray) {
sum += num;
}
double mean = sum/length;
for(double num: numArray) {
standardDeviation += Math.pow(num - mean, 2);
}
return Math.sqrt(standardDeviation/length);
}
//
// selective obfuscation strategies
// can be applied for the entire
// class or a single method (by
// default all obfuscation strategies
// are enabled when you use @Obfuscate
// annotation alone)
//
//@Obfuscate(
// ints_math_crypt = true,
// dbls_math_crypt = true,
// string_split = true,
// crypt_strings = true,
// string_char_vault = true,
// rename_methods = false,
// rename_variables = true,
// shuffle_methods = true,
// array_int_crypt = true,
// array_double_crypt = true,
// array_char_crypt = true,
// array_string_crypt = true,
// mix_code_flow = true,
// ints_from_double_math = true,
// opaque_mixer_chain = true,
// complexify_booleans = true,
// try_finally_noise = true,
// ints_to_arrays = true,
// dbls_to_arrays = true
// )
public static void main(String[] args) {
double[] numArray = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 };
double SD = calculateSD(numArray);
System.out.format("Standard Deviation = %.6f", SD);
}
}`;
//
// by default all options are enabled, both helper random numbers
// generation & obfuscation strategies, so we can just simply call:
//
const result = await myJObfuscator.obfuscateJavaSource(sourceCode);
//
// it's also possible to pass a Java source file path instead of a string e.g.
//
// const result = await myJObfuscator.obfuscateJavaFile("/path/to/project/source.java");
//
// result object holds the obfuscation results as well as other information
//
// result.error - error code
// result.output - obfuscated code
// result.demo - was it used in demo mode (invalid or empty activation key was used)
// result.credits_left - usage credits left after this operation
// result.credits_total - total number of credits for this activation code
// result.expired - if this was the last usage credit for the activation key it will be set to true
//
if (result !== null) {
//
// display obfuscated code
//
if (result.error === JObfuscator.ERROR_SUCCESS) {
console.log(result.output);
} else {
throw new Error("An error occurred, error code: " + result.error);
}
} else {
throw new Error("Something unexpected happen while trying to obfuscate the code.");
}
/******************************************************************************
* JObfuscator WebApi interface usage example.
*
* In this example we will obfuscate sample source with custom options.
*
* Version : v1.0.0
* Language : Rust
* Author : Bartosz W?jcik
* Web page : https://www.pelock.com
*
*****************************************************************************/
use jobfuscator::{JObfuscator, JObfuscatorResponse};
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
//
// include JObfuscator class
//
//
// if you don't want to use crates.io use a path dependency in Cargo.toml
//
// jobfuscator = { path = "../jobfuscator" }
//
// create JObfuscator class instance (we are using our activation key)
//
let mut my_jobfuscator = JObfuscator::new(Some("ABCD-ABCD-ABCD-ABCD".to_string()));
//
// should the source code be compressed (both input & compressed)
//
my_jobfuscator.enable_compression = true;
//
// global obfuscation options
//
// when disabled will discard any @Obfuscate annotation declaration
// in the Java source code
//
// you can disable a particular obfuscation strategy globally if it
// fails or you don't want to use it without modifying the source codes
//
// by default all obfuscation strategies are enabled
//
//
// change linear code execution flow to non-linear version
//
my_jobfuscator.mix_code_flow = true;
//
// rename variable names to random string values
//
my_jobfuscator.rename_variables = true;
//
// rename method names to random string values
//
my_jobfuscator.rename_methods = true;
//
// shuffle order of methods in the output source
//
my_jobfuscator.shuffle_methods = true;
//
// encrypt int/double/char/string array literals with runtime decryption
//
my_jobfuscator.array_int_crypt = true;
my_jobfuscator.array_double_crypt = true;
my_jobfuscator.array_char_crypt = true;
my_jobfuscator.array_string_crypt = true;
//
// encrypt integers using more than 15 floating point math functions from the java.lang.Math.* class
//
my_jobfuscator.ints_math_crypt = true;
//
// encrypt doubles using floating point math functions from the java.lang.Math.* class
//
my_jobfuscator.dbls_math_crypt = true;
//
// split string literals into nested String.concat(...) chains before string encryption
//
my_jobfuscator.string_split = true;
//
// encrypt strings using polymorphic encryption algorithms
//
my_jobfuscator.crypt_strings = true;
//
// rebuild string literals from hidden char arrays
//
my_jobfuscator.string_char_vault = true;
//
// express selected integers through equivalent double math expressions
//
my_jobfuscator.ints_from_double_math = true;
//
// inject opaque mixer chains and unreachable guards
//
my_jobfuscator.opaque_mixer_chain = true;
//
// replace boolean literals with equivalent runtime expressions
//
my_jobfuscator.complexify_booleans = true;
//
// wrap selected statements in noisy try/finally blocks
//
my_jobfuscator.try_finally_noise = true;
//
// for each method, extract all possible integers from the code and store them in an array
//
my_jobfuscator.ints_to_arrays = true;
//
// for each method, extract all possible doubles from the code and store them in an array
//
my_jobfuscator.dbls_to_arrays = true;
//
// source code in Java format
//
let source_code = r#"import java.util.*;
import java.lang.*;
import java.io.*;
//
// you must include custom annotation
// to enable entire class or a single
// method obfuscation
//
@Obfuscate
class Ideone
{
//@Obfuscate
public static double calculateSD(double numArray[])
{
double sum = 0.0, standardDeviation = 0.0;
int length = numArray.length;
for(double num : numArray) {
sum += num;
}
double mean = sum/length;
for(double num: numArray) {
standardDeviation += Math.pow(num - mean, 2);
}
return Math.sqrt(standardDeviation/length);
}
//
// selective obfuscation strategies
// can be applied for the entire
// class or a single method (by
// default all obfuscation strategies
// are enabled when you use @Obfuscate
// annotation alone)
//
//@Obfuscate(
// ints_math_crypt = true,
// dbls_math_crypt = true,
// string_split = true,
// crypt_strings = true,
// string_char_vault = true,
// rename_methods = false,
// rename_variables = true,
// shuffle_methods = true,
// array_int_crypt = true,
// array_double_crypt = true,
// array_char_crypt = true,
// array_string_crypt = true,
// mix_code_flow = true,
// ints_from_double_math = true,
// opaque_mixer_chain = true,
// complexify_booleans = true,
// try_finally_noise = true,
// ints_to_arrays = true,
// dbls_to_arrays = true
// )
public static void main(String[] args) {
double[] numArray = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 };
double SD = calculateSD(numArray);
System.out.format("Standard Deviation = %.6f", SD);
}
}"#;
//
// by default all options are enabled, both helper random numbers
// generation & obfuscation strategies, so we can just simply call:
//
let result = my_jobfuscator
.obfuscate_java_source(source_code, true)
.await;
//
// it's also possible to pass a Java source file path instead of a string e.g.
//
// let result = my_jobfuscator
// .obfuscate_java_file(std::path::Path::new("/path/to/project/source.java"), true)
// .await;
//
// result object holds the obfuscation results as well as other information
//
// result.error - error code
// result.output - obfuscated code
// result.demo - was it used in demo mode (invalid or empty activation key was used)
// result.credits_left - usage credits left after this operation
// result.credits_total - total number of credits for this activation code
// result.expired - if this was the last usage credit for the activation key it will be set to true
//
match result {
Some(JObfuscatorResponse::Object(obj)) => {
//
// display obfuscated code
//
if obj.error == JObfuscator::ERROR_SUCCESS {
println!("{}", obj.output.unwrap_or_default());
} else {
return Err(format!("An error occurred, error code: {}", obj.error).into());
}
}
Some(JObfuscatorResponse::Json(_)) => {}
None => {
return Err("Something unexpected happen while trying to obfuscate the code.".into());
}
}
Ok(())
}
/******************************************************************************
* JObfuscator WebApi interface usage example.
*
* In this example we will obfuscate sample source with custom options.
*
* Version : v1.0.0
* Language : C#
* Author : Bartosz W?jcik
* Web page : https://www.pelock.com
*
* NuGet PackageReference Include="JObfuscator"
* Sources : https://github.com/PELock/JObfuscator-CSharp
*
*****************************************************************************/
using PELock;
//
// create JObfuscator class instance (we are using our activation key)
//
var myJObfuscator = new JObfuscator("ABCD-ABCD-ABCD-ABCD");
//
// should the source code be compressed (both input & compressed)
//
myJObfuscator.EnableCompression = true;
//
// global obfuscation options
//
// when disabled will discard any @Obfuscate annotation declaration
// in the Java source code
//
// you can disable a particular obfuscation strategy globally if it
// fails or you don't want to use it without modifying the source codes
//
// by default all obfuscation strategies are enabled
//
//
// change linear code execution flow to non-linear version
//
myJObfuscator.MixCodeFlow = true;
//
// rename variable names to random string values
//
myJObfuscator.RenameVariables = true;
//
// rename method names to random string values
//
myJObfuscator.RenameMethods = true;
//
// shuffle order of methods in the output source
//
myJObfuscator.ShuffleMethods = true;
//
// encrypt int/double/char/string array literals with runtime decryption
//
myJObfuscator.ArrayIntCrypt = true;
myJObfuscator.ArrayDoubleCrypt = true;
myJObfuscator.ArrayCharCrypt = true;
myJObfuscator.ArrayStringCrypt = true;
//
// encrypt integers using more than 15 floating point math functions from the java.lang.Math.* class
//
myJObfuscator.IntsMathCrypt = true;
//
// encrypt doubles using floating point math functions from the java.lang.Math.* class
//
myJObfuscator.DblsMathCrypt = true;
//
// split string literals into nested String.concat(...) chains before string encryption
//
myJObfuscator.StringSplit = true;
//
// encrypt strings using polymorphic encryption algorithms
//
myJObfuscator.CryptStrings = true;
//
// rebuild string literals from hidden char arrays
//
myJObfuscator.StringCharVault = true;
//
// express selected integers through equivalent double math expressions
//
myJObfuscator.IntsFromDoubleMath = true;
//
// inject opaque mixer chains and unreachable guards
//
myJObfuscator.OpaqueMixerChain = true;
//
// replace boolean literals with equivalent runtime expressions
//
myJObfuscator.ComplexifyBooleans = true;
//
// wrap selected statements in noisy try/finally blocks
//
myJObfuscator.TryFinallyNoise = true;
//
// for each method, extract all possible integers from the code and store them in an array
//
myJObfuscator.IntsToArrays = true;
//
// for each method, extract all possible doubles from the code and store them in an array
//
myJObfuscator.DblsToArrays = true;
//
// source code in Java format
//
const string SourceCode =
"""
import java.util.*;
import java.lang.*;
import java.io.*;
//
// you must include custom annotation
// to enable entire class or a single
// method obfuscation
//
@Obfuscate
class Ideone
{
//@Obfuscate
public static double calculateSD(double numArray[])
{
double sum = 0.0, standardDeviation = 0.0;
int length = numArray.length;
for(double num : numArray) {
sum += num;
}
double mean = sum/length;
for(double num: numArray) {
standardDeviation += Math.pow(num - mean, 2);
}
return Math.sqrt(standardDeviation/length);
}
//
// selective obfuscation strategies
// can be applied for the entire
// class or a single method (by
// default all obfuscation strategies
// are enabled when you use @Obfuscate
// annotation alone)
//
//@Obfuscate(
// ints_math_crypt = true,
// dbls_math_crypt = true,
// string_split = true,
// crypt_strings = true,
// string_char_vault = true,
// rename_methods = false,
// rename_variables = true,
// shuffle_methods = true,
// array_int_crypt = true,
// array_double_crypt = true,
// array_char_crypt = true,
// array_string_crypt = true,
// mix_code_flow = true,
// ints_from_double_math = true,
// opaque_mixer_chain = true,
// complexify_booleans = true,
// try_finally_noise = true,
// ints_to_arrays = true,
// dbls_to_arrays = true
// )
public static void main(String[] args) {
double[] numArray = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 };
double SD = calculateSD(numArray);
System.out.format("Standard Deviation = %.6f", SD);
}
}
""";
//
// by default all options are enabled, both helper random numbers
// generation & obfuscation strategies, so we can just simply call:
//
var result = await myJObfuscator.ObfuscateJavaSourceAsync(SourceCode);
//
// it's also possible to pass a Java source file path instead of a string e.g.
//
// var result = await myJObfuscator.ObfuscateJavaFileAsync("/path/to/project/source.java");
//
// result object holds the obfuscation results as well as other information
//
// result?.Error - error code (see JObfuscator.Error*)
// result?.Output - obfuscated code
// result?.Demo - was it used in demo mode (invalid or empty activation key was used)
// result?.CreditsLeft - usage credits left after this operation
// result?.CreditsTotal - total number of credits for this activation code
// result?.Expired - if this was the last usage credit for the activation key it will be set to true
//
if (result is not null)
{
//
// display obfuscated code
//
if (result.Error == JObfuscator.ErrorSuccess && result.Output is not null)
Console.WriteLine(result.Output);
else
throw new InvalidOperationException("An error occurred, error code: " + result.Error);
}
else
{
throw new InvalidOperationException("Something unexpected happen while trying to obfuscate the code.");
}
<?php
/******************************************************************************
* JObfuscator WebApi interface usage example.
*
* In this example we will verify our activation key status.
*
* Version : v1.04
* Language : PHP
* Author : Bartosz W?jcik
* Web page : https://www.pelock.com
*
*****************************************************************************/
//
// include JObfuscator class
//
use PELock\JObfuscator;
//
// if you don't want to use Composer use include_once
//
//include_once "JObfuscator.php";
//
// create JObfuscator class instance (we are using our activation key)
//
$myJObfuscator = new PELock\JObfuscator("ABCD-ABCD-ABCD-ABCD");
//
// login to the service
//
$result = $myJObfuscator->Login();
//
// $result[] array holds the information about the license
//
// $result["demo"] - is it a demo mode (invalid or empty activation key was used)
// $result["credits_left"] - usage credits left after this operation
// $result["credits_total"] - total number of credits for this activation code
// $result["string_limit"] - max. source code size allowed (it's 1500 bytes for demo mode)
//
if ($result !== false)
{
echo "Demo version status - " . ($result["demo"] ? "true" : "false") . "<br>";
echo "Usage credits left - " . $result["credits_left"] . "<br>";
echo "Total usage credits - " . $result["credits_total"] . "<br>";
echo "Max. source code size - " . $result["string_limit"] . "<br>";
}
else
{
die("Something unexpected happen while trying to login to the service.");
}
?>
#!/usr/bin/env python
###############################################################################
#
# JObfuscator WebApi interface usage example.
#
# In this example we will verify our activation key status.
#
# Version : v1.04
# Language : Python
# Author : Bartosz W?jcik
# Web page : https://www.pelock.com
#
###############################################################################
#
# include JObfuscator module
#
from jobfuscator import JObfuscator
#
# if you don't want to use Python module, you can import directly from the file
#
#from pelock.jobfuscator import JObfuscator
#
# create JObfuscator class instance (we are using our activation key)
#
myJObfuscator = JObfuscator("ABCD-ABCD-ABCD-ABCD")
#
# login to the service
#
result = myJObfuscator.login()
#
# result[] array holds the information about the license
#
# result["demo"] - is it a demo mode (invalid or empty activation key was used)
# result["credits_left"] - usage credits left after this operation
# result["credits_total"] - total number of credits for this activation code
# result["string_limit"] - max. source code size allowed (it's 1500 bytes for demo mode)
#
if result:
print(f'Demo version status - {"True" if result["demo"] else "False"}')
print(f'Usage credits left - {result["credits_left"]}')
print(f'Total usage credits - {result["credits_total"]}')
print(f'Max. source code size - {result["string_limit"]}')
else:
print("Something unexpected happen while trying to login to the service.")
/******************************************************************************
* JObfuscator WebApi interface usage example.
*
* In this example we will verify our activation key status.
*
* Version : v1.0.0
* Language : JavaScript
* Author : Bartosz W?jcik
* Web page : https://www.pelock.com
*
*****************************************************************************/
import JObfuscator from "jobfuscator";
//
// include JObfuscator class
//
//
// if you don't want to use npm use import from a local copy
//
// import JObfuscator from "./jobfuscator.js";
//
// create JObfuscator class instance (we are using our activation key)
//
const myJObfuscator = new JObfuscator("ABCD-ABCD-ABCD-ABCD");
//
// login to the service
//
const result = await myJObfuscator.login();
//
// result object holds the information about the license
//
// result.demo - is it a demo mode (invalid or empty activation key was used)
// result.credits_left - usage credits left after this operation
// result.credits_total - total number of credits for this activation code
// result.string_limit - max. source code size allowed (it's 1500 bytes for demo mode)
//
if (result !== null) {
console.log("Demo version status - " + (result.demo ? "true" : "false"));
console.log("Usage credits left - " + result.credits_left);
console.log("Total usage credits - " + result.credits_total);
console.log("Max. source code size - " + result.string_limit);
} else {
throw new Error("Something unexpected happen while trying to login to the service.");
}
/******************************************************************************
* JObfuscator WebApi interface usage example.
*
* In this example we will verify our activation key status.
*
* Version : v1.0.0
* Language : Rust
* Author : Bartosz W?jcik
* Web page : https://www.pelock.com
*
*****************************************************************************/
use jobfuscator::{JObfuscator, JObfuscatorResponse};
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
//
// include JObfuscator class
//
//
// if you don't want to use crates.io use a path dependency in Cargo.toml
//
// jobfuscator = { path = "../jobfuscator" }
//
// create JObfuscator class instance (we are using our activation key)
//
let my_jobfuscator = JObfuscator::new(Some("ABCD-ABCD-ABCD-ABCD".to_string()));
//
// login to the service
//
let result = my_jobfuscator.login(true).await;
//
// result object holds the information about the license
//
// result.demo - is it a demo mode (invalid or empty activation key was used)
// result.credits_left - usage credits left after this operation
// result.credits_total - total number of credits for this activation code
// result.string_limit - max. source code size allowed (it's 1500 bytes for demo mode)
//
match result {
Some(JObfuscatorResponse::Object(obj)) => {
println!(
"Demo version status - {}",
if obj.demo.unwrap_or(false) {
"true"
} else {
"false"
}
);
println!(
"Usage credits left - {}",
obj.credits_left.unwrap_or(0)
);
println!(
"Total usage credits - {}",
obj.credits_total.unwrap_or(0)
);
println!(
"Max. source code size - {}",
obj.string_limit.unwrap_or(0)
);
}
Some(JObfuscatorResponse::Json(_)) => {}
None => {
return Err("Something unexpected happen while trying to login to the service.".into());
}
}
Ok(())
}
/******************************************************************************
* JObfuscator WebApi interface usage example.
*
* In this example we will verify our activation key status.
*
* Version : v1.0.0
* Language : C#
* Author : Bartosz W?jcik
* Web page : https://www.pelock.com
*
* NuGet PackageReference Include="JObfuscator"
* Sources : https://github.com/PELock/JObfuscator-CSharp
*
*****************************************************************************/
using PELock;
//
// create JObfuscator class instance (we are using our activation key)
//
var myJObfuscator = new JObfuscator("ABCD-ABCD-ABCD-ABCD");
//
// login to the service
//
var result = await myJObfuscator.LoginAsync();
//
// result object holds the information about the license
//
// result?.Demo - is it a demo mode (invalid or empty activation key was used)
// result?.CreditsLeft - usage credits left after this operation
// result?.CreditsTotal - total number of credits for this activation code
// result?.StringLimit - Max. source code size allowed (it's 1500 bytes for demo mode)
//
if (result is not null)
{
Console.WriteLine("Demo version status - " + (result.Demo == true ? "true" : "false"));
Console.WriteLine("Usage credits left - " + result.CreditsLeft);
Console.WriteLine("Total usage credits - " + result.CreditsTotal);
Console.WriteLine("Max. source code size - " + result.StringLimit);
}
else
{
throw new InvalidOperationException("Something unexpected happen while trying to login to the service.");
}
$result["error"] [out]| Name | Value | Description |
|---|---|---|
| ERROR_SUCCESS | 0 |
Everything went fine. |
| ERROR_INPUT_SIZE | 1 |
Source code size is too big. Most probably you hit the demo mode limitation (2000 characters max.). |
| ERROR_INPUT | 2 |
Malformed source code, check the syntax. |
| ERROR_PARSING | 3 |
Java source code parsing error. |
| ERROR_OBFUSCATION | 4 |
Java parsed code obfuscation error. |
| ERROR_OUTPUT | 5 |
Java error while generating output code. |
$result["output"] [out, optional]$result["demo"] [out]$result["credits_left"] [out]$result["credits_total"] [out]$result["expired"] [out, optional]true it means our activation code has expired (it was the last run).$result["string_limit"] [out, optional]| PHP Library | JObfuscator |
| Python 3 Module | JObfuscator |
| JavaScript (npm) | JObfuscator |
| Rust crate | JObfuscator |
| C# NuGet package | JObfuscator |
If you would like to ask me about JObfuscator, or something's not clear, mail me. I'll be happy to answer all of your questions.