UnityAndroidIl2cppPatchDemo icon indicating copy to clipboard operation
UnityAndroidIl2cppPatchDemo copied to clipboard

怎么解决谷歌.aab方式导致streamingAssetsPath不正确的问题呢?

Open linkongchen opened this issue 3 years ago • 3 comments

//!!!! wrong streamingAssetsPath in Google aab

linkongchen avatar Oct 28 '21 09:10 linkongchen

遍历所有打开的apk, 找到包含需要的文件夹那个,然后自己拼个路径

noodle1983 avatar Oct 30 '21 01:10 noodle1983

测试多台手机,发现有一些手机有效,有一些手机无效。vivo oppo可以,华为,小米,gspace都不可以。

打开日志看了下:

成功的日志

2021-10-30 16:44:49.760 2826-3101/? E/il2cpp: [76b67024f0]m_logcat_________________:get_arch_abi 2021-10-30 16:44:53.231 2826-3101/? E/il2cpp: [76b67024f0]m_logcat_________________:use_data_dir 2021-10-30 16:44:53.231 2826-3101/? E/il2cpp: [76b67024f0]m_logcat_________________:use_data_dir__1 2021-10-30 16:44:53.231 2826-3101/? E/il2cpp: [76b67024f0]m_logcat_________________:get_bundle_id 2021-10-30 16:44:53.231 2826-3101/? E/il2cpp: [76b67024f0]m_logcat_________________:get_bundle_id_end 2021-10-30 16:44:53.231 2826-3101/? E/il2cpp: [76b67024f0]m_logcat_________________:prepare_so_lib 2021-10-30 16:44:53.231 2826-3101/? E/il2cpp: [76b67024f0]m_logcat_________________:copy_file 2021-10-30 16:44:53.474 2826-3101/? E/il2cpp: [76b67024f0]m_logcat_________________:copy_file_end 2021-10-30 16:44:53.654 2826-3101/? E/il2cpp: [76b67024f0]m_logcat_________________:prepare_so_lib_end 2021-10-30 16:44:53.654 2826-3101/? E/il2cpp: [76b67024f0]m_logcat_________________:use_data_dir__2 2021-10-30 16:44:53.654 2826-3101/? E/il2cpp: [76b67024f0]m_logcat_________________:get_apk_path 2021-10-30 16:44:54.064 2826-3101/? E/il2cpp: [76b67024f0]m_logcat_________________:get_apk_path___end 2021-10-30 16:44:54.155 2826-3101/? E/il2cpp: [76b67024f0]m_logcat_________________:use_data_dir__3 2021-10-30 16:44:54.155 2826-3101/? E/il2cpp: [76b67024f0]m_logcat_________________:use_data_dir__4 2021-10-30 16:44:54.156 2826-3101/? E/il2cpp: [76b67024f0]m_logcat_________________:use_data_dir__end

失败的日志

2021-10-30 16:56:54.508 16682-16789/? E/il2cpp: [7a6ccff4f0]m_logcat_________________:get_arch_abi 2021-10-30 16:56:58.754 16682-16789/? E/il2cpp: [7a6ccff4f0]m_logcat_________________:use_data_dir 2021-10-30 16:56:58.754 16682-16789/? E/il2cpp: [7a6ccff4f0]m_logcat_________________:use_data_dir__1 2021-10-30 16:56:58.754 16682-16789/? E/il2cpp: [7a6ccff4f0]m_logcat_________________:get_bundle_id 2021-10-30 16:56:58.754 16682-16789/? E/il2cpp: [7a6ccff4f0]m_logcat_________________:get_bundle_id_end 2021-10-30 16:56:58.754 16682-16789/? E/il2cpp: [7a6ccff4f0]m_logcat_________________:prepare_so_lib 2021-10-30 16:56:58.754 16682-16789/? E/il2cpp: [7a6ccff4f0]m_logcat_________________:copy_file 2021-10-30 16:56:58.938 16682-16789/? E/il2cpp: [7a6ccff4f0]m_logcat_________________:copy_file_end 2021-10-30 16:56:58.939 16682-16789/? E/il2cpp: [7a6ccff4f0]m_logcat_________________:prepare_so_lib_end 2021-10-30 16:56:58.939 16682-16789/? E/il2cpp: [7a6ccff4f0]m_logcat_________________:use_data_dir__2 2021-10-30 16:56:58.939 16682-16789/? E/il2cpp: [7a6ccff4f0]m_logcat_________________:get_apk_path 2021-10-30 16:56:59.128 16682-16789/? E/il2cpp: [7a6ccff4f0]m_logcat_________________:get_apk_path___end 2021-10-30 16:56:59.235 16682-16789/? E/il2cpp: [7a6ccff4f0]m_logcat_________________:use_data_dir__3 2021-10-30 16:56:59.235 16682-16789/? E/il2cpp: [7a6ccff4f0]m_logcat_________________:use_data_dir__4 2021-10-30 16:56:59.236 16682-16789/? E/il2cpp: [7a6ccff4f0]m_logcat_________________:use_data_dir__end 2021-10-30 16:57:05.055 17614-17614/? E/il2cpp: [7b0f6e8548]m_logcat_________________:Java_io_github_noodle1983_Boostrap_init 2021-10-30 16:57:05.055 17614-17614/? E/il2cpp: [7b0f6e8548]m_logcat_________________:bootstrap 2021-10-30 16:57:05.055 17614-17614/? E/il2cpp: [7b0f6e8548]m_logcat_________________:bootstrap 2021-10-30 16:57:05.055 17614-17614/? E/il2cpp: [7b0f6e8548]m_logcat_________________:extract_patch_info 2021-10-30 16:57:05.056 17614-17614/? E/il2cpp: [7b0f6e8548]m_logcat_________________:extract_patch_info__1 2021-10-30 16:57:05.057 17614-17614/? E/il2cpp: [7b0f6e8548]m_logcat_________________:extract_patch_info__2 2021-10-30 16:57:05.057 17614-17614/? E/il2cpp: [7b0f6e8548]m_logcat_________________:extract_patch_info__3 2021-10-30 16:57:05.057 17614-17614/? E/il2cpp: [7b0f6e8548]m_logcat_________________:pre_process_all_so_lib 2021-10-30 16:57:05.081 17614-17614/? E/il2cpp: [7b0f6e8548]m_logcat_________________:pre_process_all_so_lib_end 2021-10-30 16:57:05.081 17614-17614/? E/il2cpp: [7b0f6e8548]m_logcat_________________:extract_patch_info__4 2021-10-30 16:57:05.081 17614-17614/? E/il2cpp: [7b0f6e8548]m_logcat_________________:extract_patch_info__5 2021-10-30 16:57:05.081 17614-17614/? E/il2cpp: [7b0f6e8548]m_logcat_________________:init_hook 2021-10-30 16:57:05.081 17614-17614/? E/il2cpp: [7b0f6e8548]m_logcat_________________:bootstrap_end 2021-10-30 16:57:05.081 17614-17614/? E/il2cpp: [7b0f6e8548]m_logcat_________________:Java_io_github_noodle1983_Boostrap_init_end

失败的日志会多执行Java_io_github_noodle1983_Boostrap_init

linkongchen avatar Oct 30 '21 09:10 linkongchen

库的代码是这个函数,我没测试环境,你试试打多点日志看看 https://github.com/noodle1983/UnityAndroidIl2cppPatchDemo-libboostrap/blob/master/bootstrap.cpp#L437

noodle1983 avatar Nov 05 '21 01:11 noodle1983