DEX, анализирующий библиотеку для поиска запутанных классов и методов во время выполнения.
Dexplore - это библиотека Java, предназначенную для анализа и поиска запутанных классов и методов. Библиотека может автоматически найти запутанные классы и методы на основе конкретных запросов, позволяя разработчикам создавать портативные приложения, такие как модули xposed, для любой запутанной кодовой базы.
Кроме того, DexPlore предлагает инструмент командной строки, который предоставляет возможность выполнять статический анализ и деконпрессиование приложений. Инструмент также способен извлечь конкретные файлы и ресурсы класса, что приводит к более быстрому и менее ресурсованному процессу.
Поддерживаемые типы: APK, DEX, ODEX, OAT, ZIP.
Поддерживаемые входы: путь файла, байтовый буфер (в памяти DEX).
Пожалуйста, проверьте последнюю версию Dexplore со страницы выпуска.
Библиотечная зависимость
repositories {
mavenCentral()
}
dependencies {
implementation ' io.github.neonorbit:dexplore:1.4.5 '
}Инструмент командной строки для статического анализа и детеширования приложений
java -jar Dexplore.jar --help Образец для модуля xposed.
Пожалуйста, обратитесь на страницу Wiki для подробного объяснения.
public class XposedModule implements IXposedHookLoadPackage {
@ Override
public void handleLoadPackage ( XC_LoadPackage . LoadPackageParam lpparam ) {
if (! lpparam . packageName . equals ( "com.example.app" )) return ;
// Create a class filter to find your target class
ClassFilter classFilter = new ClassFilter . Builder ()
. setReferenceTypes ( ReferenceTypes . STRINGS_ONLY )
. setReferenceFilter ( pool ->
pool . contains ( "a unique string inside the class" )
). build ();
// Create a method filter to find your target method from the class
MethodFilter methodFilter = new MethodFilter . Builder ()
. setReferenceTypes ( ReferenceTypes . STRINGS_ONLY )
. setReferenceFilter ( pool ->
pool . contains ( "a unique string inside the method" )
). setParamSize ( 2 ) // suppose it has 3 parameters
. setModifiers ( Modifier . PUBLIC ) // and it's a public method
. build ();
// Load the base apk into Dexplore
Dexplore dexplore = DexFactory . load ( lpparam . appInfo . sourceDir );
// Perform a dex search
MethodData result = dexplore . findMethod ( classFilter , methodFilter );
// Load the actual method
Method method = result . loadMethod ( lpparam . classLoader );
// Hook with Xposed
XposedBridge . hookMethod ( method , XC_MethodReplacement . returnConstant ( true ));
// ------------------ Extra ------------------
// Please don't forget to save the result in Preferences.
preferences . edit ()
. putString ( "targetMethod" , result . serialize ()) // serialize and save the result
. putLong ( "appVersion" , pkgInfo . getLongVersionCode ()) // version code (NOT version name)
. apply ();
// Use the saved result until the app LongVersionCode changes.
String saved = preferences . getString ( "targetMethod" , null );
MethodData retrieved = MethodData . deserialize ( saved ); // Deserialize
// Please refer to the wiki page for a detailed explanation.
}
} Для помощи: XDA-Thread
Образцы проектов можно найти в потоке XDA.
Copyright (C) 2022 NeonOrbit
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.