@@ -267,7 +267,7 @@ typedef struct {
267267 FunPtr (SymbolAddress * , soinfo_get_import_symbol_address , SoinfoPtr soinfo_ptr , const char * name , int * out_error );
268268
269269 /**
270- * @briefSpecify the soinfo pointer to get the export symbol address of the
270+ * @brief Specify the soinfo pointer to get the export symbol address of the
271271 * specified name
272272 *
273273 * @param soinfo_ptr Specify the soinfo pointer
@@ -414,11 +414,22 @@ typedef struct {
414414 */
415415 FunPtr (bool , call_manual_relocation_by_names , SoinfoPtr global_lib , int len , const char * target_names []);
416416
417+ /**
418+ * @brief Specify the soinfo pointer to get the first export symbol address of the
419+ * specified name prefix
420+ *
421+ * @param soinfo_ptr Specify the soinfo pointer
422+ * @param name Export symbol name
423+ * @param[out] out_error Write error code on error exists
424+ * @return Symbolic address or nullptr
425+ */
426+ FunPtr (SymbolAddress , soinfo_get_export_symbol_address_by_prefix , SoinfoPtr soinfo_ptr , const char * name ,
427+ int * out_error );
428+
417429 /**
418430 * @brief New version expansion reserved slot
419431 *
420432 */
421- FunPtr (void , unused0 );
422433 FunPtr (void , unused1 );
423434 FunPtr (void , unused2 );
424435 FunPtr (void , unused3 );
@@ -816,10 +827,21 @@ typedef struct {
816827 * LINKER_VERBOSITY_TRACE 1
817828 * LINKER_VERBOSITY_DEBUG 2
818829 *
830+ * Android 15+ new debug config
831+ * calls : 1 << 0
832+ * cfi : 1 << 1
833+ * dynamic : 1 << 2
834+ * lookup : 1 << 3
835+ * reloc : 1 << 4
836+ * props : 1 << 5
837+ *
819838 * @param level log level, the larger the value, the more logs
820839 */
821840 FunPtr (bool , set_ld_debug_verbosity , int level );
822841
842+ FunPtr (uint64_t , find_library_symbol_by_prefix , const char * library_name , const char * symbol_name ,
843+ const FindSymbolType symbol_type );
844+
823845} FakeLinker ;
824846
825847#undef FunPtr
@@ -836,23 +858,50 @@ extern void fakelinker_module_init(JNIEnv *env, SoinfoPtr fake_soinfo, const Fak
836858
837859enum FakeLinkerMode {
838860 /**
839- * Initialize soinfo, namespace feature
861+ * Initialize soinfo, initialize all linker functions by default,
862+ * if only some functions are needed, please add kInitLinkerXXXX flag
840863 */
841864 kFMSoinfo = 1 ,
842865 /**
843866 * Initialize android native hook feature
844867 */
845- kFMNativeHook = 2 ,
868+ kFMNativeHook = 1 << 1 ,
846869
847870 /**
848871 * Register the Java functions, by default, the FakeLinker class will return success even if the registration fails,
849872 * whereas non-default classes will only return success if the registration is successful.
850873 */
851- kFMJavaRegister = 4 ,
874+ kFMJavaRegister = 1 << 2 ,
852875 /**
853876 * The default FakeLinker class or non-default classes must return success only if the registration is successful.
854877 */
855- kFMForceJavaRegister = 8 ,
878+ kFMForceJavaRegister = 1 << 3 ,
879+ /**
880+ * Initialize only linker debug symbols
881+ *
882+ */
883+ kInitLinkerDebug = 1 << 4 ,
884+ /**
885+ * Initialize only linker dlopen/dlsym to use symbols
886+ *
887+ */
888+ kInitLinkerDlopenDlSym = 1 << 5 ,
889+ /**
890+ * Initialize only linker namespace symbols
891+ *
892+ */
893+ kInitLinkerNamespace = 1 << 6 ,
894+ /**
895+ * Initialize only linker handler symbols
896+ *
897+ */
898+ kInitLinkerHandler = 1 << 7 ,
899+ /**
900+ * Initialize only linker memory symbols
901+ *
902+ */
903+ kInitLinkerMemory = 1 << 8 ,
904+
856905};
857906
858907/**
0 commit comments