@@ -9,20 +9,28 @@ using namespace xamarin::android::internal;
99force_inline bool
1010MamRemapping::equal (MAMString const & left, const char *right, size_t right_len) noexcept
1111{
12+ log_warn (LOG_DEFAULT, __PRETTY_FUNCTION__);
13+ log_warn (LOG_DEFAULT, " left.str == %s; left.length == %u" , left.str , left.length );
14+ log_warn (LOG_DEFAULT, " right.str == %s; right.length == %zu" , right, right_len);
1215 if (left.length != static_cast <uint32_t >(right_len) || left.str [0 ] != *right) {
16+ log_warn (LOG_DEFAULT, " #0" );
1317 return false ;
1418 }
1519
1620 if (memcmp (left.str , right, right_len) == 0 ) {
21+ log_warn (LOG_DEFAULT, " #1" );
1722 return true ;
1823 }
1924
25+ log_warn (LOG_DEFAULT, " #3" );
2026 return false ;
2127}
2228
2329const char *
2430MamRemapping::lookup_replacement_type (const char *jniSimpleReference) noexcept
2531{
32+ log_warn (LOG_DEFAULT, __PRETTY_FUNCTION__);
33+ log_warn (LOG_DEFAULT, " jniSimpleReference == %s" , jniSimpleReference);
2634 if (application_config.mam_replacement_type_count == 0 || jniSimpleReference == nullptr || *jniSimpleReference == ' \0 ' ) {
2735 return nullptr ;
2836 }
@@ -43,19 +51,26 @@ MamRemapping::lookup_replacement_type (const char *jniSimpleReference) noexcept
4351const MAMReplacementMethod*
4452MamRemapping::lookup_replacement_method_info (const char *jniSourceType, const char *jniMethodName, const char *jniMethodSignature) noexcept
4553{
54+ log_warn (LOG_DEFAULT, __PRETTY_FUNCTION__);
55+ log_warn (LOG_DEFAULT, " jniSourceType == %s; jniMethodName == %s; jniMethodSignature == %s" , jniSourceType, jniMethodName, jniMethodSignature);
4656 if (application_config.mam_replacement_method_index_entry_count == 0 ||
4757 jniSourceType == nullptr || *jniSourceType == ' \0 ' ||
4858 jniMethodName == nullptr || *jniMethodName == ' \0 ' ) {
59+ log_warn (LOG_DEFAULT, " #0" );
4960 return nullptr ;
5061 }
5162
5263 size_t source_type_len = strlen (jniSourceType);
5364
65+ log_warn (LOG_DEFAULT, " application_config.mam_replacement_method_index_entry_count == %u" , application_config.mam_replacement_method_index_entry_count );
5466 const MAMIndexTypeEntry *type = nullptr ;
5567 for (size_t i = 0 ; i < application_config.mam_replacement_method_index_entry_count ; i++) {
68+ log_warn (LOG_DEFAULT, " i == %zu" , i);
5669 MAMIndexTypeEntry const & entry = mam_method_replacement_index[i];
70+ log_warn (LOG_DEFAULT, " mam_method_replacement_index[%zu].name.str == %s" , i, mam_method_replacement_index[i].name .str );
5771
58- if (!equal (entry.name , jniSourceType, source_type_len) != 0 ) {
72+ if (!equal (entry.name , jniSourceType, source_type_len)) {
73+ log_warn (LOG_DEFAULT, " -> cont" );
5974 continue ;
6075 }
6176
@@ -64,6 +79,7 @@ MamRemapping::lookup_replacement_method_info (const char *jniSourceType, const c
6479 }
6580
6681 if (type == nullptr || type->method_count == 0 || type->methods == nullptr ) {
82+ log_warn (LOG_DEFAULT, " #1" );
6783 return nullptr ;
6884 }
6985
@@ -78,9 +94,11 @@ MamRemapping::lookup_replacement_method_info (const char *jniSourceType, const c
7894 }
7995
8096 if (entry.signature .length == 0 || equal (entry.signature , jniMethodSignature, signature_len)) {
97+ log_warn (LOG_DEFAULT, " #2" );
8198 return &type->methods [i].replacement ;
8299 }
83100 }
84101
102+ log_warn (LOG_DEFAULT, " #3" );
85103 return nullptr ;
86104}
0 commit comments