autojs大文件下载带进度条无需悬浮窗权限

  • Post author:
  • Post category:其他


在这里插入图片描述

function getbigfile(url, filepath) {
   
    importClass(android.app.AlertDialog);
    importClass(android.app.ProgressDialog);
    importClass(android.content.DialogInterface);
    importClass(android.widget.EditText);
    importClass(android.widget.ImageView);
    importClass(android.graphics.drawable.GradientDrawable);
    importClass(android.view.WindowManager);
    importClass(android.view.View);
    importClass(android.view.Gravity);
    importClass(android.widget.Toast);
    importClass(Packages.androidx.recyclerview.widget.LinearSmoothScroller);
    importClass(android.graphics.Color);
    importClass(Packages.androidx.recyclerview.widget.LinearLayoutManager);
    importClass(Packages.androidx.recyclerview.widget.RecyclerView);
	const changeByte = (byte) => {
   
		let size = "";
		if (byte < 0.1 * 1024) {
   
			size = byte.toFixed(2) + 'B';
		} else if (byte < 0.1 * 1024