Comments (3)
你贴的堆栈只能说明你用的不是这个项目的原始代码。而你又不愿意分享你修改后的代码。所以这没有开源项目的交流前提。
即便如此。你想知道在你拿了代码修改之后,上游项目改了什么。你可以简单的用git diff看出来多出来哪些提交,那些文件有差异。如果这些提交的提交日志不清晰,如果文件的改动看不懂,都可以直接引用提issue。要求改进也是合理的。直接提PR改进代码可读性也是欢迎的。
dex和oat都属于Android的私有api,shadow从原理上不考虑介入。
from shadow.
你贴的堆栈只能说明你用的不是这个项目的原始代码。而你又不愿意分享你修改后的代码。所以这没有开源项目的交流前提。
即便如此。你想知道在你拿了代码修改之后,上游项目改了什么。你可以简单的用git diff看出来多出来哪些提交,那些文件有差异。如果这些提交的提交日志不清晰,如果文件的改动看不懂,都可以直接引用提issue。要求改进也是合理的。直接提PR改进代码可读性也是欢迎的。
dex和oat都属于Android的私有api,shadow从原理上不考虑介入。
这里并没有对 Shadow 的 loadPlugin 相关流程以及代码做过修改,只是为了解决项目中其他第三方组件也使用了 shadow,导致包名冲突,将 com.tencent.shadow 修改为 com.tencent.estv.shadow;
如果说的是删除 oat 的逻辑,目前只是在 Shadow 提供的示例 FastPluginManager的 loadPlugin()方法中,增加了删除oat 文件的操作,为了避免Android P 内联优化导致的问题, 以下是相关代码;
protected void loadPlugin(InstalledPlugin installedPlugin, String partKey, Boolean multiProcess) throws RemoteException, TimeoutException, FailedException {
loadPluginLoaderAndRuntime(installedPlugin.UUID, partKey, multiProcess);
Map map = mPluginLoader.getLoadedPlugin();
if (!map.containsKey(partKey)) {
delOatDir(installedPlugin);
mPluginLoader.loadPlugin(partKey);
}
}
针对上游项目后续的改动,看到有针对 API 27 去掉 odex 的过程,这里会同步更新下相关改动尝试下。
但该问题是在sdk 升级到 targetSDKVersion = 30 时才出现,不确认是否是否该问题导致,后续如还有发现的话,会将 shadow 上游改动同步到项目中
from shadow.
获取到更详细的崩溃堆栈,目前看起来是崩溃在runtime 中的 vdex_file.cc中的GetNextDexFileData()方法,该方法在 Android12中引入, 在 Android12 版本的源码中,有CHECK_ALIGN(data,4)的检查
estPlugi: vdex_file.cc:195] Check failed: ::art::IsAligned<4>(data) 0x7d4f902246
estPlugi: runtime.cc:689] Runtime aborting...
estPlugi: runtime.cc:689] Dumping all threads without mutator lock held
estPlugi: runtime.cc:689] All threads:
estPlugi: runtime.cc:689] DALVIK THREADS (42):
estPlugi: runtime.cc:689] "pool-7-thread-1" prio=5 tid=33 Runnable
estPlugi: runtime.cc:689] | group="" sCount=0 ucsCount=0 flags=0 obj=0x1329d3a8 self=0xb400007bd05e7000
estPlugi: runtime.cc:689] | sysTid=31136 nice=0 cgrp=foreground sched=0/0 handle=0x7bc2095cb0
estPlugi: runtime.cc:689] | state=R schedstat=( 39925522 1402602 21 ) utm=2 stm=1 core=6 HZ=100
estPlugi: runtime.cc:689] | stack=0x7bc1f92000-0x7bc1f94000 stackSize=1039KB
estPlugi: runtime.cc:689] | held mutexes= "abort lock" "mutator lock"(shared held)
estPlugi: runtime.cc:689] native: #00 pc 00000000005842b4 /apex/com.android.art/lib64/libart.so (art::DumpNativeStack(std::__1::basic_ostream<char, std::__1::char_traits<char> >&, int, BacktraceMap*, char const*, art::ArtMethod*, void*, bool)+140)
estPlugi: runtime.cc:689] native: #01 pc 00000000006b3b58 /apex/com.android.art/lib64/libart.so (art::Thread::DumpStack(std::__1::basic_ostream<char, std::__1::char_traits<char> >&, bool, BacktraceMap*, bool) const+364)
estPlugi: runtime.cc:689] native: #02 pc 00000000006d20d8 /apex/com.android.art/lib64/libart.so (art::DumpCheckpoint::Run(art::Thread*)+944)
estPlugi: runtime.cc:689] native: #03 pc 00000000006cb964 /apex/com.android.art/lib64/libart.so (art::ThreadList::RunCheckpoint(art::Closure*, art::Closure*)+564)
estPlugi: runtime.cc:689] native: #04 pc 00000000006cab10 /apex/com.android.art/lib64/libart.so (art::ThreadList::Dump(std::__1::basic_ostream<char, std::__1::char_traits<char> >&, bool)+1504)
estPlugi: runtime.cc:689] native: #05 pc 000000000065d62c /apex/com.android.art/lib64/libart.so (art::Runtime::Abort(char const*)+2240)
estPlugi: runtime.cc:689] native: #06 pc 00000000000159e0 /system/lib64/libbase.so (android::base::SetAborter(std::__1::function<void (char const*)>&&)::$_3::__invoke(char const*)+76)
estPlugi: runtime.cc:689] native: #07 pc 0000000000015004 /system/lib64/libbase.so (android::base::LogMessage::~LogMessage()+484)
estPlugi: runtime.cc:689] native: #08 pc 00000000006e2550 /apex/com.android.art/lib64/libart.so (art::VdexFile::GetNextTypeLookupTableData(unsigned char const*, unsigned int) const+152)
estPlugi: runtime.cc:689] native: #09 pc 00000000005c5414 /apex/com.android.art/lib64/libart.so (art::OatFileBase::Setup(std::__1::vector<art::DexFile const*, std::__1::allocator<art::DexFile const*> > const&)+148)
estPlugi: runtime.cc:689] native: #10 pc 00000000005c998c /apex/com.android.art/lib64/libart.so (art::OatFile::OpenFromVdex(int, std::__1::unique_ptr<art::VdexFile, std::__1::default_delete<art::VdexFile> >&&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >*)+1204)
estPlugi: runtime.cc:689] native: #11 pc 00000000005cfc3c /apex/com.android.art/lib64/libart.so (art::OatFileAssistant::OatFileInfo::GetFile()+904)
estPlugi: runtime.cc:689] native: #12 pc 00000000005cf14c /apex/com.android.art/lib64/libart.so (art::OatFileAssistant::OatFileInfo::Status()+72)
estPlugi: runtime.cc:689] native: #13 pc 00000000005cef30 /apex/com.android.art/lib64/libart.so (art::OatFileAssistant::GetBestInfo(bool)+116)
estPlugi: runtime.cc:689] native: #14 pc 00000000005d2d14 /apex/com.android.art/lib64/libart.so (art::OatFileAssistant::GetOptimizationStatus(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >*, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >*, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >*, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >*)+64)
estPlugi: runtime.cc:689] native: #15 pc 00000000005d41ac /apex/com.android.art/lib64/libart.so (art::OatFileManager::OpenDexFilesFromOat(char const*, _jobject*, _jobjectArray*, art::OatFile const**, std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > >*)+616)
estPlugi: runtime.cc:689] native: #16 pc 0000000000588658 /apex/com.android.art/lib64/libart.so (art::DexFile_openDexFileNative(_JNIEnv*, _jclass*, _jstring*, _jstring*, int, _jobject*, _jobjectArray*)+144)
estPlugi: runtime.cc:689] at dalvik.system.DexFile.openDexFileNative(Native method)
estPlugi: runtime.cc:689] at dalvik.system.DexFile.openDexFile(DexFile.java:371)
estPlugi: runtime.cc:689] at dalvik.system.DexFile.<init>(DexFile.java:113)
estPlugi: runtime.cc:689] at dalvik.system.DexFile.<init>(DexFile.java:86)
estPlugi: runtime.cc:689] at dalvik.system.DexPathList.loadDexFile(DexPathList.java:438)
estPlugi: runtime.cc:689] at dalvik.system.DexPathList.makeDexElements(DexPathList.java:397)
estPlugi: runtime.cc:689] at dalvik.system.DexPathList.<init>(DexPathList.java:166)
estPlugi: runtime.cc:689] at dalvik.system.BaseDexClassLoader.<init>(BaseDexClassLoader.java:134)
estPlugi: runtime.cc:689] at dalvik.system.BaseDexClassLoader.<init>(BaseDexClassLoader.java:92)
estPlugi: runtime.cc:689] at com.tencent.estv.shadow.core.loader.classloaders.PluginClassLoader.<init>(unavailable:-1)
estPlugi: runtime.cc:689] at com.tencent.estv.shadow.core.loader.blocs.LoadApkBloc.loadPlugin(unavailable:-1)
estPlugi: runtime.cc:689] at com.tencent.estv.shadow.core.loader.blocs.LoadPluginBloc$loadPlugin$buildClassLoader$1.call(unavailable:-1)
estPlugi: runtime.cc:689] at com.tencent.estv.shadow.core.loader.blocs.LoadPluginBloc$loadPlugin$buildClassLoader$1.call(unavailable:-1)
estPlugi: runtime.cc:689] at java.util.concurrent.FutureTask.run(FutureTask.java:266)
estPlugi: runtime.cc:689] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
estPlugi: runtime.cc:689] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
estPlugi: runtime.cc:689] at java.lang.Thread.run(Thread.java:930)
estPlugi: runtime.cc:689]
from shadow.
Related Issues (20)
- 已知问题:IDE中直接Run sample-host会失败
- 请问:如果host有loader和runtime后,插件还支持动态loader和runtime吗? HOT 3
- 最近在研究Shadow,建了个wx群,方便沟通 HOT 2
- 项目里引用了插件化,在应用市场上架的时候需要规避那些问题?有没有大佬指导一下,非常感谢
- ./gradlew packageDebugPlugin HOT 1
- 请教下:运行test-none-dynamic-host模块,启动的插件还是在宿主进程的问题。 HOT 4
- 插件manager中的view如果有ProgressBar,但是宿主不显示ProgressBar HOT 4
- 插件apk没有用到四大组件,有必要弄成多进程吗? HOT 2
- 宿主获取插件Fragment可显示,宿主跳转到插件FragmenActivity报错,请指教 HOT 2
- 执行sample-app报错,要怎么解决? HOT 2
- 插件内可以调用qq分享吗?
- androidx.profileinstaller.ProfileVerifier安全校验失败? HOT 1
- 请问 normalImplementation 是只有Shadow才有的吗? HOT 2
- 宿主启动多插件 HOT 1
- Caused by: java.lang.ClassCastException: androidx.appcompat.widget.ContentFrameLayout cannot be cast to androidx.appcompat.widget.ContentFrameLayout HOT 2
- java.lang.VerifyError: Rejecting class com.demo.pluginmanager.UpPluginManager that attempts to sub-type erroneous class com.demo.pluginmanager.FastPluginManager (declaration of 'com.demo.pluginmanager.UpPluginManager' appears in /data/user/0/com.demo/files/upshadowmanager-release-1.3.4.2023070701.apk) HOT 3
- Caused by: java.lang.UnsupportedOperationException: Can't convert to color state list: type=0x1 at android.content.res.Resources.loadColorStateListForCookie(Resources.java:2718) at android.content.res.Resources.loadColorStateList(Resources.java:2699) at android.content.res.TypedArray.getColorStateList(TypedArray.java:485) at android.widget.TextView.<init>(TextView.java:746) at android.widget.TextView.<init>(TextView.java:671) at androidx.appcompat.widget.AppCompatTextView.<init>(AppCompatTextView.java:102) at androidx.appcompat.widget.AppCompatTextView.<init>(AppCompatTextView.java:97)
- shadow经过线上上亿用户的检验,想咨询下
- 希望添加 jni 调用的演示示例 HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from shadow.