Dexplore
v1.4.5
用於在運行時查找混淆的類和方法的DEX分析庫。
Dexplore是一個Java庫,旨在分析和查找混淆的類和方法。該庫可以根據特定查詢自動找到混淆的類和方法,使開發人員能夠為任何混淆的代碼庫創建便攜式應用程序(例如Xposed模塊)。
此外,Dexplore提供了一個命令行工具,可提供執行靜態分析和應用DE兼容的功能。該工具還能夠提取特定的類文件和資源,從而產生更快且資源較低的過程。
支持類型: APK,DEX,ODEX,OAT,ZIP。
支持的輸入:文件路徑,字節緩衝區(內存內置DEX)。
請從“發行”頁面中查看最新版本的Dexplore。
庫的依賴性
repositories {
mavenCentral()
}
dependencies {
implementation ' io.github.neonorbit:dexplore:1.4.5 '
}命令行工具用於靜態分析和應用程序DE兼容
java -jar Dexplore.jar --helpXposed模塊的樣本。
請參閱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.