Я хочу правильно запутать свои файлы Java. >
фрагмент кода одного из моих классов
как видите, применяется обфускация
Код: Выделить всё
public static final String Q = "Main";
public static boolean R;
public static boolean S;
public static int T;
public static LinearLayout U;
public static LinearLayout V;
public static final String W = "com.android.example.USB_PERMISSION";
public static final int X = 516;
public static final int Y = 515;
public static final int Z = 514;
public g a;
public UsbManager b;
Код: Выделить всё
private static final String TAG = "Main";
protected static boolean log_dbg = true;
protected static boolean loc_srv = true;
protected static int urlConn = 0;
Variables variables;
static LinearLayout ll_history_view;
static LinearLayout ll_reading_view;
private UsbManager usbManager;
private UsbDevice deviceFound;
private UsbDeviceConnection usbDeviceConnection = null;
private UsbInterface usbInterfaceFound = null;
private UsbEndpoint endpointOut = null;
private UsbEndpoint endpointIn = null;
private PendingIntent UsbPermissionPI;
private static final String ACTION_USB_PERMISSION = "com.android.example.USB_PERMISSION";
Код: Выделить всё
-keepparameternames
-dontshrink
-dontoptimize
Код: Выделить всё
plugins {
id 'com.android.library'
}
android {
namespace 'com.example.application'
compileSdk 34
defaultConfig {
minSdk 30
multiDexEnabled true
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
consumerProguardFiles "consumer-rules.pro"
}
buildTypes {
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
consumerProguardFiles 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_11
targetCompatibility JavaVersion.VERSION_11
}
}
dependencies {
implementation 'androidx.appcompat:appcompat:1.6.1'
implementation 'com.google.android.material:material:1.10.0'
implementation libs.core
implementation 'com.android.support:multidex:1.0.3'
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.2.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.6.1'
}

Примечание: я не уверен, что он официально называется декомпилятором Java, для того, чтобы использовать его в первый раз, появилось сообщение, с которым мне пришлось согласиться.
Подробнее здесь: https://stackoverflow.com/questions/793 ... decompiler