1./vendor/mediatek/proprietary/packages/apps/Browser/src/com/android/browser/DownloadHandler.java
替换包名实现:
/*/replace package name
import android.webkit.URLUtil;
//*/
import com.android.browser.util.URLUtil;
//*/
2.vendor/mediatek/proprietary/packages/apps/Browser/src/com/android/browser/util/MimeTypeMap.java
替换安装规则:
public static String getFileExtensionFromUrl(String url) {
if (!TextUtils.isEmpty(url)) {
int fragment = url.lastIndexOf('#');
if (fragment > 0) {
url = url.substring(0, fragment);
}
int query = url.lastIndexOf('?');
if (query > 0) {
url = url.substring(0, query);
}
int filenamePos = url.lastIndexOf('/');
String filename =
0 <= filenamePos ? url.substring(filenamePos + 1) : url;
// if the filename contains special characters, we don't
// consider it valid for our matching purposes:
if (!filename.isEmpty() &&
/*/add download show bin cant install
Pattern.matches("[a-zA-Z_0-9\\.\\-\\(\\)\\%]+", filename)) {
//*/
Pattern.matches("[\u4e00-\u9fa5_a-zA-Z_0-9\\.\\-\\(\\)\\%]+", filename)) {
//*/int dotPos = filename.lastIndexOf('.');
if (0 <= dotPos) {
return filename.substring(dotPos + 1);
}
}
}
return "";
}