From 9f2ab4bf3710b7d37b5e9b498f98d02ebc118a68 Mon Sep 17 00:00:00 2001 From: Shatyuka <958182453@qq.com> Date: Thu, 25 Mar 2021 18:47:58 +0800 Subject: [PATCH] Support Zhihu 7.7.0 --- app/src/main/java/com/shatyuka/zhiliao/Helper.java | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/com/shatyuka/zhiliao/Helper.java b/app/src/main/java/com/shatyuka/zhiliao/Helper.java index fdbcb52..e27c183 100644 --- a/app/src/main/java/com/shatyuka/zhiliao/Helper.java +++ b/app/src/main/java/com/shatyuka/zhiliao/Helper.java @@ -219,9 +219,14 @@ static boolean init(ClassLoader classLoader) { try { ContentMixAdapter = classLoader.loadClass("com.zhihu.android.mix.a.a"); getItemCount = ContentMixAdapter.getMethod("getItemCount"); - } catch (NoSuchMethodException e) { - ContentMixAdapter = classLoader.loadClass("com.zhihu.android.mix.b.a"); - getItemCount = ContentMixAdapter.getMethod("getItemCount"); + } catch (Throwable e) { + try { + ContentMixAdapter = classLoader.loadClass("com.zhihu.android.mix.b.a"); + getItemCount = ContentMixAdapter.getMethod("getItemCount"); + } catch (Throwable e2) { + ContentMixAdapter = classLoader.loadClass("com.zhihu.android.mix.adapter.a"); + getItemCount = ContentMixAdapter.getMethod("getItemCount"); + } } ContentMixPagerFragment = classLoader.loadClass("com.zhihu.android.mix.fragment.ContentMixPagerFragment"); ContentMixAdapter_fragment = ContentMixAdapter.getDeclaredField("f");