This commit is contained in:
NekoInverter 2020-03-05 18:01:07 +08:00
parent ed8836ca6d
commit a83fbf11b2
No known key found for this signature in database
GPG Key ID: 280D6CCCF95715F9
11 changed files with 22 additions and 37 deletions

View File

@ -16,6 +16,7 @@ import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.widget.TooltipCompat;
import androidx.fragment.app.Fragment;
import com.google.android.material.dialog.MaterialAlertDialogBuilder;
@ -100,7 +101,8 @@ public class BaseAdvancedInstaller extends Fragment {
TextView author = view.findViewById(R.id.author);
View showOnXda = view.findViewById(R.id.show_on_xda);
View updateDescription = view.findViewById(R.id.updateDescription);
TooltipCompat.setTooltipText(infoInstaller, getString(R.string.info));
TooltipCompat.setTooltipText(infoUninstaller, getString(R.string.info));
try {
chooserInstallers.setAdapter(new XposedZip.MyAdapter(getContext(), installers()));
chooserUninstallers.setAdapter(new XposedZip.MyAdapter(getContext(), uninstallers()));

View File

@ -10,7 +10,6 @@ import android.content.res.Resources;
import android.net.Uri;
import android.os.Bundle;
import android.text.method.LinkMovementMethod;
import android.util.Log;
import android.util.TypedValue;
import android.view.LayoutInflater;
import android.view.View;
@ -109,7 +108,7 @@ public class DownloadDetailsVersionsFragment extends ListFragment {
try {
OutputStream os = mActivity.getContentResolver().openOutputStream(uri);
if (os != null) {
FileInputStream in = new FileInputStream(new File(DownloadView.mInfo.localFilename));
FileInputStream in = new FileInputStream(new File(DownloadView.lastInfo.localFilename));
byte[] buffer = new byte[1024];
int len;
while ((len = in.read(buffer)) > 0) {

View File

@ -1,7 +1,6 @@
package org.meowcat.edxposed.manager;
import android.annotation.SuppressLint;
import android.app.ProgressDialog;
import android.content.Intent;
import android.net.Uri;
import android.os.AsyncTask;
@ -18,6 +17,7 @@ import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.appcompat.app.ActionBar;
import androidx.appcompat.app.AlertDialog;
import androidx.appcompat.widget.Toolbar;
import androidx.core.content.FileProvider;
import androidx.recyclerview.widget.LinearLayoutManager;
@ -228,7 +228,7 @@ public class LogsActivity extends BaseActivity {
@SuppressLint("StaticFieldLeak")
private class LogsReader extends AsyncTask<File, Integer, ArrayList<String>> {
private ProgressDialog mProgressDialog;
private AlertDialog mProgressDialog;
private Runnable mRunnable = new Runnable() {
@Override
public void run() {
@ -238,9 +238,9 @@ public class LogsActivity extends BaseActivity {
@Override
protected void onPreExecute() {
mProgressDialog = new ProgressDialog(LogsActivity.this);
mProgressDialog = new MaterialAlertDialogBuilder(LogsActivity.this).create();
mProgressDialog.setMessage(getString(R.string.loading));
mProgressDialog.setProgress(0);
mProgressDialog.setCancelable(false);
handler.postDelayed(mRunnable, 500);
}

View File

@ -10,6 +10,7 @@ import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.appcompat.widget.PopupMenu;
import androidx.appcompat.widget.TooltipCompat;
import com.google.android.material.card.MaterialCardView;
@ -20,6 +21,7 @@ public class MainActivity extends BaseActivity implements RepoLoader.RepoListene
private RepoLoader mRepoLoader;
@SuppressLint("PrivateResource")
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
@ -64,6 +66,7 @@ public class MainActivity extends BaseActivity implements RepoLoader.RepoListene
startActivity(intent);
});
ImageView menu = findViewById(R.id.menu_more);
TooltipCompat.setTooltipText(menu, getString(androidx.appcompat.R.string.abc_action_menu_overflow_description));
menu.setOnClickListener(v -> {
PopupMenu appMenu = new PopupMenu(MainActivity.this, menu);
appMenu.inflate(R.menu.menu_installer);

View File

@ -9,6 +9,7 @@ import android.content.SharedPreferences;
import android.database.Cursor;
import android.net.Uri;
import android.provider.MediaStore;
import android.util.Log;
import android.widget.Toast;
import androidx.annotation.NonNull;
@ -58,6 +59,7 @@ public class DownloadsUtil {
}
} else */
File destination = new File(context.getExternalCacheDir(), "/downloads/" + b.mTitle + b.mMimeType.getExtension());
removeAllForLocalFile(context, destination);
request.setDestinationUri(Uri.fromFile(destination));
request.setNotificationVisibility(Request.VISIBILITY_VISIBLE);
DownloadManager dm = (DownloadManager) context.getSystemService(Context.DOWNLOAD_SERVICE);
@ -211,7 +213,7 @@ public class DownloadsUtil {
dm.remove(ids);
}
/*
private static void removeAllForLocalFile(Context context, File file) {
//noinspection ResultOfMethodCallIgnored
file.delete();
@ -261,7 +263,7 @@ public class DownloadsUtil {
ids[i] = idsList.get(i);
dm.remove(ids);
}*/
}
// public static void removeOutdated(Context context, long cutoff) {
// DownloadManager dm = (DownloadManager) context.getSystemService(Context.DOWNLOAD_SERVICE);

View File

@ -20,7 +20,7 @@ import org.meowcat.edxposed.manager.util.DownloadsUtil.DownloadFinishedCallback;
import java.util.Objects;
public class DownloadView extends LinearLayout {
public static DownloadsUtil.DownloadInfo mInfo = null;
public static DownloadsUtil.DownloadInfo lastInfo = null;
private final Button btnDownload;
private final Button btnDownloadCancel;
private final Button btnInstall;
@ -28,6 +28,7 @@ public class DownloadView extends LinearLayout {
private final ProgressBar progressBar;
private final TextView txtInfo;
public Fragment fragment;
private DownloadsUtil.DownloadInfo mInfo = null;
private String mUrl = null;
private final Runnable refreshViewRunnable = new Runnable() {
@Override
@ -120,6 +121,7 @@ public class DownloadView extends LinearLayout {
});
btnSave.setOnClickListener(v -> {
lastInfo = mInfo;
mInfo = DownloadsUtil.addModule(getContext(), mTitle, mUrl, (context1, info) -> {
Intent exportIntent = new Intent(Intent.ACTION_CREATE_DOCUMENT);
exportIntent.addCategory(Intent.CATEGORY_OPENABLE);

View File

@ -32,6 +32,7 @@
android:layout_centerVertical="true"
android:layout_marginStart="25dp"
android:layout_toEndOf="@id/app_icon"
android:contentDescription="@string/app_name"
android:text="@string/app_name"
android:textAppearance="@style/TextAppearance.AppCompat.Title"
android:textSize="20sp" />
@ -44,9 +45,11 @@
android:layout_centerVertical="true"
android:background="?selectableItemBackgroundBorderless"
android:clickable="true"
android:contentDescription="@string/abc_action_menu_overflow_description"
android:focusable="true"
android:padding="5dp"
app:srcCompat="@drawable/ic_more" />
app:srcCompat="@drawable/ic_more"
tools:ignore="PrivateResource" />
</RelativeLayout>
<com.google.android.material.card.MaterialCardView

View File

@ -142,7 +142,6 @@
<!-- DownloadView -->
<string name="download_view_download">下载并安装</string>
<string name="download_view_install">安装</string>
<string name="download_view_remove">删除</string>
<string name="download_view_cancel">取消</string>
<string name="download_view_no_url">无可用的下载链接</string>
<string name="download_view_running">正在下载(%1$,d / %2$,d kB)</string>
@ -183,7 +182,6 @@
名称: %1$s
\n日期: %2$s
</string>
<string name="permissionNotGranted">当未允许写入外部存储空间权限时, 该功能无法正常工作</string>
<string name="warningArchitecture">你将会下载一个 ZIP 格式文件, 请手动在 Magisk Manager 或 Recovery 中刷入</string>
<string name="newVersion">EdXposed Manager 有新版本可用!现在更新!</string>
<string name="update">更新</string>
@ -194,7 +192,6 @@
<string name="scroll_top">滚动到顶部</string>
<string name="install_with_su">静默安装(root)</string>
<string name="install_with_su_summ">勾选后在 EdXposed Manager 内安装模块时将不再显示安装提示</string>
<string name="module_saved">模块已保存至 %1$s</string>
<string name="ignore_updates">忽略更新</string>
<string name="ignore_updates_summ">忽略指定模块的更新</string>
<string name="reboot_recovery">重启至恢复模式</string>
@ -254,8 +251,6 @@
<string name="unofficial_build">这是一个非官方的构建\n安装风险由您自行承担</string>
<string name="alt_download_method">备用下载方法</string>
<string name="alt_download_method_summ">如果下载模块时出现问题, 请开启此选项</string>
<string name="known_issue_wrong_base_directory">错误的配置文件夹: %1$s</string>
<string name="known_issue_missing_base_directory">未知配置文件夹</string>
<string name="dexopt_now">以 Dexopt 模式优化全部应用</string>
<string name="speed_now">以 Speed 模式优化全部应用</string>
<string name="this_may_take_a_while">请稍后, 这将需要一段时间…</string>
@ -268,7 +263,6 @@
<string name="app_launch">运行</string>
<string name="app_stop">停止</string>
<string name="update_description">更新日志</string>
<string name="edxp_installer_installed">你必须先卸载 EdXposed Installer 才能继续使用 EdXposed Manager</string>
<string name="show_modules">显示模块和管理器</string>
<string name="show_modules_summary">在应用列表内显示模块和管理器\n此选项并不会移除已勾选的应用标识</string>
<string name="compile_failed">优化失败或返回值为空</string>

View File

@ -142,7 +142,6 @@
<!-- DownloadView -->
<string name="download_view_download">下載並安裝</string>
<string name="download_view_install">安裝</string>
<string name="download_view_remove">刪除</string>
<string name="download_view_cancel">取消</string>
<string name="download_view_no_url">無可用的下載鏈接</string>
<string name="download_view_running">正在下載(%1$,d / %2$,d kB)</string>
@ -183,7 +182,6 @@
名稱: %1$s
\n日期: %2$s
</string>
<string name="permissionNotGranted">當未允許寫入外部存儲空間權限時, 該功能無法正常工作</string>
<string name="warningArchitecture">你將會下載一個 ZIP 格式文件, 請手動在 Magisk Manager 或 Recovery 中刷入</string>
<string name="newVersion">EdXposed Manager 有新版本可用!現在更新!</string>
<string name="update">更新</string>
@ -194,7 +192,6 @@
<string name="scroll_top">滾動到頂部</string>
<string name="install_with_su">靜默安裝(root)</string>
<string name="install_with_su_summ">勾選後在 EdXposed Manager 內安裝模塊時將不再顯示安裝提示</string>
<string name="module_saved">模塊已保存至 %1$s</string>
<string name="ignore_updates">忽略更新</string>
<string name="ignore_updates_summ">忽略指定模塊的更新</string>
<string name="reboot_recovery">重啟至恢復模式</string>
@ -254,8 +251,6 @@
<string name="unofficial_build">這是一個非官方的構建\n安裝風險由您自行承擔</string>
<string name="alt_download_method">備用下載方法</string>
<string name="alt_download_method_summ">如果下載模塊時出現問題, 請開啟此選項</string>
<string name="known_issue_wrong_base_directory">錯誤的配置文件夾: %1$s</string>
<string name="known_issue_missing_base_directory">未知配置文件夾</string>
<string name="dexopt_now">以 Dexopt 模式優化全部應用</string>
<string name="speed_now">以 Speed 模式優化全部應用</string>
<string name="this_may_take_a_while">請稍後, 這將需要一段時間…</string>
@ -268,7 +263,6 @@
<string name="app_launch">運行</string>
<string name="app_stop">停止</string>
<string name="update_description">更新日誌</string>
<string name="edxp_installer_installed">你必須先卸載 EdXposed Installer 才能繼續使用 EdXposed Manager</string>
<string name="show_modules">顯示模塊和管理器</string>
<string name="show_modules_summary">在應用列表內顯示模塊和管理器\n此選項並不會移除已勾選的應用標識</string>
<string name="compile_failed">優化失敗或返回值為空</string>

View File

@ -142,7 +142,6 @@
<!-- DownloadView -->
<string name="download_view_download">下載並安裝</string>
<string name="download_view_install">安裝</string>
<string name="download_view_remove">刪除</string>
<string name="download_view_cancel">取消</string>
<string name="download_view_no_url">無可用的下載連結</string>
<string name="download_view_running">正在下載(%1$,d / %2$,d kB)</string>
@ -183,7 +182,6 @@
名稱: %1$s
\n日期: %2$s
</string>
<string name="permissionNotGranted">當未允許寫入外部儲存空間許可權時, 該功能無法正常工作</string>
<string name="warningArchitecture">你將會下載一個 ZIP 格式檔案, 請手動在 Magisk Manager 或 Recovery 中刷入</string>
<string name="newVersion">EdXposed Manager 有新版本可用!現在更新!</string>
<string name="update">更新</string>
@ -194,7 +192,6 @@
<string name="scroll_top">滾動到頂部</string>
<string name="install_with_su">靜默安裝(root)</string>
<string name="install_with_su_summ">勾選後在 EdXposed Manager 內安裝模組時將不再顯示安裝提示</string>
<string name="module_saved">模組已儲存至 %1$s</string>
<string name="ignore_updates">忽略更新</string>
<string name="ignore_updates_summ">忽略指定模組的更新</string>
<string name="reboot_recovery">重啟至恢復模式</string>
@ -254,8 +251,6 @@
<string name="unofficial_build">這是一個非官方的構建\n安裝風險由您自行承擔</string>
<string name="alt_download_method">備用下載方法</string>
<string name="alt_download_method_summ">如果下載模組時出現問題, 請開啟此選項</string>
<string name="known_issue_wrong_base_directory">錯誤的配置資料夾: %1$s</string>
<string name="known_issue_missing_base_directory">未知配置資料夾</string>
<string name="dexopt_now">以 Dexopt 模式優化全部應用</string>
<string name="speed_now">以 Speed 模式優化全部應用</string>
<string name="this_may_take_a_while">請稍後, 這將需要一段時間…</string>
@ -268,7 +263,6 @@
<string name="app_launch">執行</string>
<string name="app_stop">停止</string>
<string name="update_description">更新日誌</string>
<string name="edxp_installer_installed">你必須先解除安裝 EdXposed Installer 才能繼續使用 EdXposed Manager</string>
<string name="show_modules">顯示模組和管理器</string>
<string name="show_modules_summary">在應用列表內顯示模組和管理器\n此選項並不會移除已勾選的應用標識</string>
<string name="compile_failed">優化失敗或返回值為空</string>

View File

@ -144,7 +144,6 @@
<!-- DownloadView -->
<string name="download_view_download">Download and Install</string>
<string name="download_view_install">Install</string>
<string name="download_view_remove">Remove</string>
<string name="download_view_cancel">Cancel</string>
<string name="download_view_no_url">No download URL available</string>
<string name="download_view_running">Download is running (%1$,d of %2$,d kB)</string>
@ -185,7 +184,6 @@
Name: %1$s
\nDate: %2$s
</string>
<string name="permissionNotGranted">This feature will not work without permission to write external storage</string>
<string name="warningArchitecture">You will download a ZIP file, flash in Magisk Manager or Recovery manually</string>
<string name="newVersion">New version of EdXposed Manager is available! Update it!</string>
<string name="update">Update</string>
@ -196,7 +194,6 @@
<string name="scroll_top">Scroll to top</string>
<string name="install_with_su">Silent installation (root)</string>
<string name="install_with_su_summ">If checked EdXposed Manager will install modules without a prompt</string>
<string name="module_saved">Module saved at %1$s</string>
<string name="ignore_updates">Ignore update</string>
<string name="ignore_updates_summ">Ignore updates for a specific module</string>
<string name="reboot_recovery">Reboot to Recovery</string>
@ -229,9 +226,6 @@
<string name="custom_list">Use mirrored modules list</string>
<string name="custom_list_summ">Mirrored modules list can help load faster\nBut the newly submitted module display will be delayed (about 24 hours)</string>
<string name="known_issue_wrong_base_directory">Wrong base directory: %1$s</string>
<string name="known_issue_missing_base_directory">Missing base directory</string>
<string name="dexopt_now">Optimize all apps with Dexopt</string>
<string name="speed_now">Optimize all apps with Speed mode</string>
<string name="this_may_take_a_while">Please wait, this may take a while…</string>
@ -266,7 +260,6 @@
<string name="support_faq_url" translatable="false">http://github.com/ElderDrivers/EdXposed/wiki</string>
<string name="support_donate_url" translatable="false">http://edxp.meowcat.org/donate</string>
<string name="about_source" translatable="false">https://github.com/ElderDrivers/EdXposedManager/</string>
<string name="about_support" translatable="false">http://edxp.meowcat.org/faq</string>
<string name="solohsu" translatable="false">givein2u</string>
<string name="mlgmxyysd" translatable="false">MlgmXyysd</string>
@ -304,7 +297,6 @@
<string name="app_launch">Launch it</string>
<string name="app_stop">Stop it</string>
<string name="update_description">Update Changelog</string>
<string name="edxp_installer_installed">You must to uninstall EdXposed Installer to use EdXposed Manager</string>
<string name="show_modules">Show modules and manager</string>
<string name="show_modules_summary">Show modules and manager in application list\nThis option does not remove checked application flag</string>
<string name="compile_failed">Optimization failed or return value is empty</string>