weibo_android_sdk icon indicating copy to clipboard operation
weibo_android_sdk copied to clipboard

【严重】不在ExternalFilesDir内的图片不能通过Uri分享!

Open OstAlex opened this issue 4 years ago • 1 comments

com.sina.weibo.sdk.utils.FileUtil#getRealFilePath 的实现有问题。 一般分享图不会放在file里面,放在cache文件夹里面的情况比较多。

这样会导致com.sina.weibo.sdk.utils.FileUtil#isImageFile出问题。

建议通过ContentResolver获取uri的DisplayName或者ParcelFileDescriptor。来判断该Uri是否是图片。

OstAlex avatar Dec 03 '20 09:12 OstAlex

看起来是这段代码的问题,com.sina.weibo.sdk.c.b public static String d(Context context, Uri uri) { String uri2 = uri.toString(); return new File(context.getExternalFilesDir((String) null), uri2.substring(uri2.lastIndexOf("/"))).getAbsolutePath(); }

kongxiaojun avatar Dec 24 '20 03:12 kongxiaojun