HYDK v3.0.0版本的 MD5 值为:36b96e4c5561390bc72ab66c2f29a92f
以下内容为反编译后的 b21.java 源代码,内容仅作参考
package p.a.y.e.a.s.e.net;
import android.content.Context;
import android.content.Intent;
import android.media.MediaScannerConnection;
import android.net.Uri;
import android.text.TextUtils;
import android.util.Log;
import java.io.File;
public class b21 implements MediaScannerConnection.MediaScannerConnectionClient {
private static final String lite_int = "UpdatePicLirUtil";
private MediaScannerConnection lite_do;
private a lite_for;
private String lite_if;
public interface a {
void lite_do(String str, Uri uri);
}
public b21(a aVar) {
this.lite_for = aVar;
}
public static void lite_for(Context context, File file, a aVar) {
new b21(aVar).lite_do(context, file);
}
public static void lite_new(Context context, String str) {
Intent intent = new Intent("android.intent.action.MEDIA_SCANNER_SCAN_FILE");
intent.setData(Uri.fromFile(new File(str)));
context.sendBroadcast(intent);
}
public void lite_do(Context context, File file) {
this.lite_if = file.getAbsolutePath();
MediaScannerConnection mediaScannerConnection = new MediaScannerConnection(context, this);
this.lite_do = mediaScannerConnection;
mediaScannerConnection.connect();
}
public void lite_if(String str) {
Log.i(lite_int, "scanFile fileName=" + str);
if (TextUtils.isEmpty(str)) {
Log.w(lite_int, "scanFile fileName empty!!!");
return;
}
File file = new File(str);
if (!file.exists()) {
Log.w(lite_int, "scanFile this file does not exist!!!");
return;
}
MediaScannerConnection mediaScannerConnection = this.lite_do;
if (mediaScannerConnection == null || !mediaScannerConnection.isConnected()) {
return;
}
if (!file.isDirectory()) {
this.lite_do.scanFile(str, null);
Log.i(lite_int, "scanFile the file done");
return;
}
File[] listFiles = file.listFiles();
if (listFiles != null && listFiles.length > 0) {
for (File file2 : listFiles) {
Log.i(lite_int, "scanFile directory file:getAbsolutePath=" + file2.getAbsolutePath());
lite_if(file2.getAbsolutePath());
}
}
Log.i(lite_int, "scanFile it's a directory,now scan its files done");
}
public void lite_int(a aVar) {
this.lite_for = aVar;
}
@Override
public void onMediaScannerConnected() {
lite_if(this.lite_if);
}
@Override
public void onScanCompleted(String str, Uri uri) {
Log.i(lite_int, "onScanCompleted scan path=" + str + " uri= " + uri);
this.lite_do.disconnect();
a aVar = this.lite_for;
if (aVar != null) {
aVar.lite_do(str, uri);
}
}
}