a406010503 / Miui_Camera

一個基於 MIUI 13-14(Android 12-13)適配的 Magisk 相機模組。
GNU General Public License v3.0
769 stars 30 forks source link

发现了bug,点击人像-电影光效里面的最后一个闪退 #27

Closed iyutong closed 1 year ago

iyutong commented 1 year ago

java.lang.IndexOutOfBoundsException: Index: 10, Size: 10 at java.util.ArrayList.get(ArrayList.java:437) at java.util.Collections$UnmodifiableList.get(Collections.java:1356) at com.android.camera.fragment.lighting.FragmentLighting.onItemSelected(Unknown Source:78) at com.android.camera.fragment.lighting.FragmentLighting.onClick(Unknown Source:25) at android.view.View.performClick(View.java:7782) at android.view.View.performClickInternal(View.java:7759) at android.view.View.access$3700(View.java:858) at android.view.View$PerformClick.run(View.java:29188) at android.os.Handler.handleCallback(Handler.java:938) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loopOnce(Looper.java:211) at android.os.Looper.loop(Looper.java:300) at android.app.ActivityThread.main(ActivityThread.java:8298) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:556) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1049)

红米k40 miui13 开发版 22.10.26

a406010503 commented 1 year ago

這是已知問題... 每次都有寫的 順便提一下,關閉徠卡訂製相機的開關就不會錯位了

iyutong commented 1 year ago

为什么不修复?这个bug原因很简单

---原始邮件--- 发件人: @.> 发送时间: 2022年12月5日(周一) 晚上11:21 收件人: @.>; 抄送: @.**@.>; 主题: Re: [a406010503/Miui_Camera] 发现了bug,点击人像-电影光效里面的最后一个闪退 (Issue #27)

這是已知問題... 每次都有寫的

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>

a406010503 commented 1 year ago

這個問題從以前就有,我們不清楚如何修復它 如果您知道他的原理,歡迎您提供給我們...

iyutong commented 1 year ago

这个bug,错误日志中写的非常明显,经过测试,感觉是你们忘记在那个列表哪里-1了,毕竟列表是从0开始的,而你们是从1开始的,造成这个bug

---原始邮件--- 发件人: @.> 发送时间: 2022年12月5日(周一) 晚上11:23 收件人: @.>; 抄送: @.**@.>; 主题: Re: [a406010503/Miui_Camera] 发现了bug,点击人像-电影光效里面的最后一个闪退 (Issue #27)

這個問題從以前就有,我們不清楚如何修復它 如果您知道他的原理,歡迎您提供給我們...

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>

a406010503 commented 1 year ago

我們一直都沒有動過這裡,主要是切換為徠卡相機才會導致這個問題,這是小米自己要修的,而不是我們... 並且在我的小米 10 Pro我使用的是影棚光效而不是電影光效,因此更不可能去修這個問題

iyutong commented 1 year ago

算了算了,我自己修复吧。

---原始邮件--- 发件人: @.> 发送时间: 2022年12月5日(周一) 晚上11:33 收件人: @.>; 抄送: @.**@.>; 主题: Re: [a406010503/Miui_Camera] 发现了bug,点击人像-电影光效里面的最后一个闪退 (Issue #27)

我們一直都沒有動過這裡,主要是切換為徠卡相機才會導致這個問題,這是小米自己要修的,而不是我們... 並且在我的小米 10 Pro我使用的是影棚光效而不是電影光效,因此更不可能去修這個問題

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>

a406010503 commented 1 year ago

如果你知道,你可以將修復後的smali傳送給我,我會在之後的版本合併。

iyutong commented 1 year ago

刚刚解决了在莱卡模式下的那个bug,都是普通模式好像出现了新bug,我需要在调试一会

---原始邮件--- 发件人: @.> 发送时间: 2022年12月5日(周一) 晚上11:37 收件人: @.>; 抄送: @.**@.>; 主题: Re: [a406010503/Miui_Camera] 发现了bug,点击人像-电影光效里面的最后一个闪退 (Issue #27)

如果你知道,你可以將修復後的smali傳送給我,我會在之後的版本合併。

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>

iyutong commented 1 year ago

非常遗憾,因为我并不知道你们修改了什么所以无法直接找到bug根本原因,不过我有解决方案,那就是判断当前是否是莱卡模式,如果是就执行我用来修复莱卡模式下bug的代码,如果不是就不执行,这是目前最简单省事的解决方案,但是我并不知道你们用来判断是不是莱卡模式的代码,所以可否通过一下频道模式的那部分的smali代码?

---原始邮件--- 发件人: @.> 发送时间: 2022年12月5日(周一) 晚上11:37 收件人: @.>; 抄送: @.**@.>; 主题: Re: [a406010503/Miui_Camera] 发现了bug,点击人像-电影光效里面的最后一个闪退 (Issue #27)

如果你知道,你可以將修復後的smali傳送給我,我會在之後的版本合併。

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>

a406010503 commented 1 year ago

其實我們對人像模式並沒有做什麼修改 判斷徠卡主要調用 pref_leica 這個在處理的,你搜尋一下會找到它的混淆所在位置。

iyutong commented 1 year ago

我搜索pref_leica找到了OooO00o.o0Oo00oo().o00OoOOO()这个方法,但是不知道为什么这个返回来的数据永远都是true

---原始邮件--- 发件人: @.> 发送时间: 2022年12月6日(周二) 凌晨1:44 收件人: @.>; 抄送: @.**@.>; 主题: Re: [a406010503/Miui_Camera] 发现了bug,点击人像-电影光效里面的最后一个闪退 (Issue #27)

判斷徠卡主要調用 pref_leica 這個在處理的,你搜尋一下會找到它的混淆所在位置。

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>

iyutong commented 1 year ago

嗯,bug解决了,一会把代码发你

---原始邮件--- 发件人: @.> 发送时间: 2022年12月6日(周二) 凌晨1:44 收件人: @.>; 抄送: @.**@.>; 主题: Re: [a406010503/Miui_Camera] 发现了bug,点击人像-电影光效里面的最后一个闪退 (Issue #27)

判斷徠卡主要調用 pref_leica 這個在處理的,你搜尋一下會找到它的混淆所在位置。

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>

iyutong commented 1 year ago

在com/android/camera/fragment/lighting/FragmentLighting这个文件中的onItemSelecteda方法里面添加这个代码就可以了

invoke-static {}, LOooO0O0/OooO0o/OooO00o/OooO00o;->o0Oo00oo()LOooO0O0/OooO0o/OooO00o/OooO00o;

    move-result-object v0

    invoke-virtual {v0}, LOooO0O0/OooO0o/OooO00o/OooO00o;->o00ooooO()Z

    move-result v0

    if-eqz v0, :cond_c

    add-int/lit8 p1, p1, -0x1

    :cond_c

---原始邮件--- 发件人: @.> 发送时间: 2022年12月6日(周二) 凌晨1:44 收件人: @.>; 抄送: @.**@.>; 主题: Re: [a406010503/Miui_Camera] 发现了bug,点击人像-电影光效里面的最后一个闪退 (Issue #27)

判斷徠卡主要調用 pref_leica 這個在處理的,你搜尋一下會找到它的混淆所在位置。

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>

a406010503 commented 1 year ago

感謝協助,建議匯出為smali檔案給我會比較好,因為我沒有這個功能也不知道有沒有效。

a406010503 commented 1 year ago

我將您提供的程式碼寫進此類,但是卻導致擁有影棚光效的機型發生錯位,對此您有什麼想法嗎?

iyutong commented 1 year ago

那就在加一个判断,判断是否是影棚光效

---原始邮件--- 发件人: @.> 发送时间: 2022年12月6日(周二) 下午5:01 收件人: @.>; 抄送: @.**@.>; 主题: Re: [a406010503/Miui_Camera] 发现了bug,点击人像-电影光效里面的最后一个闪退 (Issue #27)

我將您提供的程式碼寫進此類,但是卻導致擁有影棚光效的機型發生錯位,對此您有什麼想法嗎?

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>

a406010503 commented 1 year ago

我不確定判斷影棚光效的正確位置在哪... 不過大致上能確定 isLightingVersion1 是影棚光效、isLightingVersion2 是電影光效

iyutong commented 1 year ago

其实好用一个方法,那就是出2个版本,一个给有電影光效的人用一个给影棚光效的人用。嗯,我知道了我看看代码。

---原始邮件--- 发件人: @.> 发送时间: 2022年12月6日(周二) 下午5:09 收件人: @.>; 抄送: @.**@.>; 主题: Re: [a406010503/Miui_Camera] 发现了bug,点击人像-电影光效里面的最后一个闪退 (Issue #27)

我不確定判斷影棚光效的正確位置在哪... 不過大致上能確定 isLightingVersion1 是影棚光效、isLightingVersion2 是電影光效

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>

a406010503 commented 1 year ago

我為它加了判斷並與其他人測試了這個問題,現在工作正常,我將在下次更新合併此程式碼。 由於問題已經解決,我將關閉此 issues,如果有任何問題可重新打開此 issues 或另建一個新 issues 反饋。

a406010503 commented 1 year ago

最新版已經發佈,在修復此項目中標註了您的名字,感謝貢獻。