public static String doSearchApk(Context context, String path) {
//LogUtil.d(TAG, "doSearchApk");
File[] fileArray;
File file = new File(path);
if (file.exists()) {
if (file.isDirectory()) {
fileArray = file.listFiles();
if (fileArray != null) {
for (File f : fileArray) {
if (f.isDirectory()) {
doSearchApk(context, f.getPath());
} else {
Log.d(MainActivity.TAG, "file: " + f.getName());
if (f.getName().endsWith(".apk")) {
//LogUtil.d(TAG, "file: "+f.getName());
appName = f.getAbsolutePath();
if (doCheckVersion(context, appName)) {
return appName;
} else {
appName = "";
}
// LogUtil.d(TAG, "list: "+ fileTempList.toString());
} else {
appName = "";
}
}
}
}
}
}
return appName;
}