新浪彩票 v0.96.37版本的 MD5 值为:0c7ddce345383506e2959f5d75bdceab
以下内容为反编译后的 C4079.java 源代码,内容仅作参考
package ewUlBWKNoApzb1Mnhgn4.TSYywVi3KnMwOjxS9W6h.tuTnrQl15gwcjciRsKuT.XFg3TYeejZA8ptq2pBNi;
import android.annotation.SuppressLint;
import android.app.Activity;
import android.content.ContentUris;
import android.content.Context;
import android.content.Intent;
import android.database.Cursor;
import android.graphics.Bitmap;
import android.net.Uri;
import android.os.Build;
import android.os.Environment;
import android.provider.DocumentsContract;
import android.provider.MediaStore;
import com.netease.nim.uikit.business.session.constant.Extras;
public class C4079 {
private static final String f14920 = "PhotoUtils";
private static boolean m18195(Uri uri) {
return "com.android.providers.downloads.documents".equals(uri.getAuthority());
}
public static void m18196(Activity activity, Uri uri, Uri uri2, int i, int i2, int i3, int i4, int i5) {
Intent intent = new Intent("com.android.camera.action.CROP");
if (Build.VERSION.SDK_INT >= 24) {
intent.addFlags(1);
}
intent.setDataAndType(uri, "image/*");
intent.putExtra("crop", "true");
intent.putExtra("aspectX", i);
intent.putExtra("aspectY", i2);
intent.putExtra(Extras.EXTRA_OUTPUTX, i3);
intent.putExtra(Extras.EXTRA_OUTPUTY, i4);
intent.putExtra("scale", true);
intent.putExtra("output", uri2);
intent.putExtra(Extras.EXTRA_RETURN_DATA, false);
intent.putExtra("outputFormat", Bitmap.CompressFormat.JPEG.toString());
intent.putExtra("noFaceDetection", true);
activity.startActivityForResult(intent, i5);
}
private static boolean m18197(Uri uri) {
return "com.android.externalstorage.documents".equals(uri.getAuthority());
}
public static Bitmap m18198(Uri uri, Context context) {
try {
return MediaStore.Images.Media.getBitmap(context.getContentResolver(), uri);
} catch (Exception e) {
e.printStackTrace();
return null;
}
}
@SuppressLint({"NewApi"})
public static String m18199(Context context, Uri uri) {
Uri uri2 = null;
if ((Build.VERSION.SDK_INT >= 19) && DocumentsContract.isDocumentUri(context, uri)) {
if (m18197(uri)) {
String[] split = DocumentsContract.getDocumentId(uri).split(":");
if ("primary".equalsIgnoreCase(split[0])) {
return "file:///" + Environment.getExternalStorageDirectory() + "/" + split[1];
}
} else if (m18195(uri)) {
Uri withAppendedId = ContentUris.withAppendedId(Uri.parse("content://downloads/public_downloads"), Long.valueOf(DocumentsContract.getDocumentId(uri)).longValue());
return "file:///" + m18201(context, withAppendedId, null, null);
} else if (m18200(uri)) {
String[] split2 = DocumentsContract.getDocumentId(uri).split(":");
String str = split2[0];
if ("image".equals(str)) {
uri2 = MediaStore.Images.Media.EXTERNAL_CONTENT_URI;
} else if ("video".equals(str)) {
uri2 = MediaStore.Video.Media.EXTERNAL_CONTENT_URI;
} else if ("audio".equals(str)) {
uri2 = MediaStore.Audio.Media.EXTERNAL_CONTENT_URI;
}
String[] strArr = {split2[1]};
return "file:///" + m18201(context, uri2, "_id=?", strArr);
}
} else if ("content".equalsIgnoreCase(uri.getScheme())) {
return "file:///" + m18201(context, uri, null, null);
} else if ("file".equalsIgnoreCase(uri.getScheme())) {
return "file:///" + uri.getPath();
}
return null;
}
private static boolean m18200(Uri uri) {
return "com.android.providers.media.documents".equals(uri.getAuthority());
}
private static String m18201(Context context, Uri uri, String str, String[] strArr) {
Cursor cursor = null;
try {
Cursor query = context.getContentResolver().query(uri, new String[]{"_data"}, str, strArr, null);
if (query != null) {
try {
if (query.moveToFirst()) {
String string = query.getString(query.getColumnIndexOrThrow("_data"));
if (query != null) {
query.close();
}
return string;
}
} catch (Throwable th) {
th = th;
cursor = query;
if (cursor != null) {
cursor.close();
}
throw th;
}
}
if (query != null) {
query.close();
}
return null;
} catch (Throwable th2) {
th = th2;
}
}
public static void m18202(Activity activity, Uri uri, int i) {
Intent intent = new Intent();
if (Build.VERSION.SDK_INT >= 24) {
intent.addFlags(1);
}
intent.setAction("android.media.action.IMAGE_CAPTURE");
intent.putExtra("output", uri);
activity.startActivityForResult(intent, i);
}
public static void m18203(Activity activity, int i) {
Intent intent = new Intent("android.intent.action.GET_CONTENT");
intent.setType("image/*");
activity.startActivityForResult(intent, i);
}
}