gzu-liyujiang / AndroidPicker

安卓选择器类库,包括日期及时间选择器(可用于出生日期、营业时间等)、单项选择器(可用于性别、民族、职业、学历、星座等)、二三级联动选择器(可用于车牌号、基金定投日期等)、城市地址选择器(分省级、地市级及区县级)、数字选择器(可用于年龄、身高、体重、温度等)、日历选日期择器(可用于酒店及机票预定日期)、颜色选择器、文件及目录选择器、图片选择器等……WheelPicker/DatePicker/TimePicker/OptionPicker/NumberPicker/LinkagePicker/AddressPicker/CarPlatePicker/CalendarPicker/ColorPicker/FilePicker/ImagePicker etc.
Other
6.51k stars 1.47k forks source link

乱码文件名导致应用崩溃 #344

Closed CandyTek closed 1 year ago

CandyTek commented 1 year ago

用户手机根目录里存放有乱码文件名的文件,使用dialog filepicker浏览至根目录,应用崩溃,编译demo,或者是项目里依赖filepicker都会崩溃。Android 9 控制台报错如下: 13:47:05.323 11046-11046 ang.demo.picke com...ng.demo.picker A java_vm_ext.cc:542] JNI DETECTED ERROR IN APPLICATION: input is not valid Modified UTF-8: illegal continuation byte 0xfa 13:47:05.323 11046-11046 ang.demo.picke com...ng.demo.picker A java_vm_ext.cc:542] string: 'ѧ?????˳ɼ??? (2).pdf' 13:47:05.323 11046-11046 ang.demo.picke com...ng.demo.picker A java_vm_ext.cc:542] input: '0xd1 0xa7 0xc9 <0xfa> 0xb8 0xf6 0xc8 0xcb 0xb3 0xc9 0xbc 0xa8 0xb1 0xed 0x20 0x28 0x32 0x29 0x2e 0x70 0x64 0x66' 13:47:05.323 11046-11046 ang.demo.picke com...ng.demo.picker A java_vm_ext.cc:542] in call to NewStringUTF 13:47:05.323 11046-11046 ang.demo.picke com...ng.demo.picker A java_vm_ext.cc:542] from java.lang.String[] java.io.UnixFileSystem.list0(java.io.File) 13:47:05.323 11046-11046 ang.demo.picke com...ng.demo.picker A java_vm_ext.cc:542] "main" prio=5 tid=1 Runnable 13:47:05.323 11046-11046 ang.demo.picke com...ng.demo.picker A java_vm_ext.cc:542] | group="main" sCount=0 dsCount=0 flags=0 obj=0x755ba890 self=0xf2676000 13:47:05.323 11046-11046 ang.demo.picke com...ng.demo.picker A java_vm_ext.cc:542] | sysTid=11046 nice=-10 cgrp=default sched=0/0 handle=0xf673f494 13:47:05.323 11046-11046 ang.demo.picke com...ng.demo.picker A java_vm_ext.cc:542] | state=R schedstat=( 558880268 37058698 269 ) utm=46 stm=9 core=4 HZ=100 13:47:05.323 11046-11046 ang.demo.picke com...ng.demo.picker A java_vm_ext.cc:542] | stack=0xff1c7000-0xff1c9000 stackSize=8MB 13:47:05.323 11046-11046 ang.demo.picke com...ng.demo.picker A java_vm_ext.cc:542] | held mutexes= "mutator lock"(shared held) 13:47:05.323 11046-11046 ang.demo.picke com...ng.demo.picker A java_vm_ext.cc:542] native: #00 pc 002d9d43 /system/lib/libart.so (art::DumpNativeStack(std::1::basic_ostream<char, std::__1::char_traits>&, int, BacktraceMap, char const, art::ArtMethod, void, bool)+134) 13:47:05.323 11046-11046 ang.demo.picke com...ng.demo.picker A java_vm_ext.cc:542] native: #01 pc 0036f03b /system/lib/libart.so (art::Thread::DumpStack(std::1::basic_ostream<char, std::1::char_traits>&, bool, BacktraceMap*, bool) const+210) 13:47:05.323 11046-11046 ang.demo.picke com...ng.demo.picker A java_vm_ext.cc:542] native: #02 pc 0036b7f3 /system/lib/libart.so (art::Thread::Dump(std::__1::basic_ostream<char, std::1::char_traits>&, bool, BacktraceMap, bool) const+34) 13:47:05.323 11046-11046 ang.demo.picke com...ng.demo.picker A java_vm_ext.cc:542] native: #03 pc 002323ff /system/lib/libart.so (art::JavaVMExt::JniAbort(char const, char const)+694) 13:47:05.323 11046-11046 ang.demo.picke com...ng.demo.picker A java_vm_ext.cc:542] native: #04 pc 0023275f /system/lib/libart.so (art::JavaVMExt::JniAbortV(char const, char const, std::__va_list)+58) 13:47:05.323 11046-11046 ang.demo.picke com...ng.demo.picker A java_vm_ext.cc:542] native: #05 pc 000c3f87 /system/lib/libart.so (art::(anonymous namespace)::ScopedCheck::AbortF(char const, ...)+42) 13:47:05.323 11046-11046 ang.demo.picke com...ng.demo.picker A java_vm_ext.cc:542] native: #06 pc 000c3e87 /system/lib/libart.so (art::(anonymous namespace)::ScopedCheck::CheckNonHeapValue(char, art::(anonymous namespace)::JniValueType)+938) 13:47:05.323 11046-11046 ang.demo.picke com...ng.demo.picker A java_vm_ext.cc:542] native: #07 pc 000c2105 /system/lib/libart.so (art::(anonymous namespace)::ScopedCheck::Check(art::ScopedObjectAccess&, bool, char const, art::(anonymous namespace)::JniValueType)+624)

CandyTek commented 1 year ago

找出问题了,是我调试的那台手机里根目录有个乱码pdf文件导致的。我使用了很多文件管理开源储存库,全部都会崩溃。在手机上,只有少数的文件管理app应用不会崩溃。可能这些app是用了某些另类方法来获取文件信息的。