Remove useless codes
This commit is contained in:
parent
c312f93a2e
commit
2d74ea1528
|
|
@ -1,318 +0,0 @@
|
||||||
package io.github.lsposed.manager.adapters;
|
|
||||||
|
|
||||||
import android.annotation.SuppressLint;
|
|
||||||
import android.content.SharedPreferences;
|
|
||||||
import android.content.pm.ApplicationInfo;
|
|
||||||
import android.content.pm.PackageInfo;
|
|
||||||
import android.content.pm.PackageManager;
|
|
||||||
import android.graphics.drawable.Drawable;
|
|
||||||
import android.os.AsyncTask;
|
|
||||||
import android.text.TextUtils;
|
|
||||||
import android.view.LayoutInflater;
|
|
||||||
import android.view.Menu;
|
|
||||||
import android.view.MenuInflater;
|
|
||||||
import android.view.MenuItem;
|
|
||||||
import android.view.View;
|
|
||||||
import android.view.ViewGroup;
|
|
||||||
import android.widget.CompoundButton;
|
|
||||||
import android.widget.Filter;
|
|
||||||
import android.widget.Filterable;
|
|
||||||
import android.widget.ImageView;
|
|
||||||
import android.widget.TextView;
|
|
||||||
|
|
||||||
import androidx.annotation.NonNull;
|
|
||||||
import androidx.annotation.Nullable;
|
|
||||||
import androidx.appcompat.widget.SwitchCompat;
|
|
||||||
import androidx.recyclerview.widget.RecyclerView;
|
|
||||||
|
|
||||||
import com.bumptech.glide.request.target.CustomTarget;
|
|
||||||
import com.bumptech.glide.request.transition.Transition;
|
|
||||||
|
|
||||||
import java.text.DateFormat;
|
|
||||||
import java.text.SimpleDateFormat;
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.Collections;
|
|
||||||
import java.util.Comparator;
|
|
||||||
import java.util.Date;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Locale;
|
|
||||||
|
|
||||||
import io.github.lsposed.manager.App;
|
|
||||||
import io.github.lsposed.manager.R;
|
|
||||||
import io.github.lsposed.manager.ui.activity.AppListActivity;
|
|
||||||
import io.github.lsposed.manager.util.GlideApp;
|
|
||||||
|
|
||||||
public class AppAdapter extends RecyclerView.Adapter<AppAdapter.ViewHolder> implements Filterable {
|
|
||||||
|
|
||||||
protected AppListActivity activity;
|
|
||||||
protected List<PackageInfo> fullList, showList;
|
|
||||||
private final DateFormat dateformat = new SimpleDateFormat("yyyy-MM-dd", Locale.getDefault());
|
|
||||||
private List<String> checkedList;
|
|
||||||
private final PackageManager pm;
|
|
||||||
private final ApplicationFilter filter;
|
|
||||||
private final SharedPreferences preferences;
|
|
||||||
|
|
||||||
AppAdapter(AppListActivity activity) {
|
|
||||||
this.activity = activity;
|
|
||||||
preferences = App.getPreferences();
|
|
||||||
fullList = showList = Collections.emptyList();
|
|
||||||
checkedList = Collections.emptyList();
|
|
||||||
filter = new ApplicationFilter();
|
|
||||||
pm = activity.getPackageManager();
|
|
||||||
refresh();
|
|
||||||
}
|
|
||||||
|
|
||||||
@NonNull
|
|
||||||
@Override
|
|
||||||
public ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
|
||||||
View v = LayoutInflater.from(activity).inflate(R.layout.item_module, parent, false);
|
|
||||||
return new ViewHolder(v);
|
|
||||||
}
|
|
||||||
|
|
||||||
private void loadApps() {
|
|
||||||
checkedList = generateCheckedList();
|
|
||||||
fullList = pm.getInstalledPackages(PackageManager.GET_META_DATA);
|
|
||||||
List<PackageInfo> rmList = new ArrayList<>();
|
|
||||||
for (PackageInfo info : fullList) {
|
|
||||||
if (info.packageName.equals(((ScopeAdapter) this).modulePackageName)) {
|
|
||||||
rmList.add(info);
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
if (checkedList.contains(info.packageName)) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
if (!preferences.getBoolean("show_modules", false)) {
|
|
||||||
if (info.applicationInfo.metaData != null && info.applicationInfo.metaData.containsKey("xposedmodule")) {
|
|
||||||
rmList.add(info);
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (!preferences.getBoolean("show_games", false)) {
|
|
||||||
if (info.applicationInfo.category == ApplicationInfo.CATEGORY_GAME) {
|
|
||||||
rmList.add(info);
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
//noinspection deprecation
|
|
||||||
if ((info.applicationInfo.flags & ApplicationInfo.FLAG_IS_GAME) != 0) {
|
|
||||||
rmList.add(info);
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if ((info.applicationInfo.flags & ApplicationInfo.FLAG_HAS_CODE) == 0 && !info.packageName.equals("android")) {
|
|
||||||
rmList.add(info);
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
if (!preferences.getBoolean("show_system_apps", false) && (info.applicationInfo.flags & ApplicationInfo.FLAG_SYSTEM) != 0) {
|
|
||||||
rmList.add(info);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (rmList.size() > 0) {
|
|
||||||
fullList.removeAll(rmList);
|
|
||||||
}
|
|
||||||
sortApps();
|
|
||||||
showList = fullList;
|
|
||||||
if (activity != null) {
|
|
||||||
activity.onDataReady();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Called during {@link #loadApps()} in non-UI thread.
|
|
||||||
*
|
|
||||||
* @return list of package names which should be checked when shown
|
|
||||||
*/
|
|
||||||
protected List<String> generateCheckedList() {
|
|
||||||
return Collections.emptyList();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void sortApps() {
|
|
||||||
Comparator<PackageInfo> cmp = AppHelper.getAppListComparator(preferences.getInt("list_sort", 0), pm);
|
|
||||||
fullList.sort((a, b) -> {
|
|
||||||
boolean aChecked = checkedList.contains(a.packageName);
|
|
||||||
boolean bChecked = checkedList.contains(b.packageName);
|
|
||||||
if (aChecked == bChecked) {
|
|
||||||
return cmp.compare(a, b);
|
|
||||||
} else if (aChecked) {
|
|
||||||
return -1;
|
|
||||||
} else {
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
@SuppressLint("NonConstantResourceId")
|
|
||||||
public boolean onOptionsItemSelected(MenuItem item) {
|
|
||||||
int itemId = item.getItemId();
|
|
||||||
if (itemId == R.id.item_show_system) {
|
|
||||||
item.setChecked(!item.isChecked());
|
|
||||||
preferences.edit().putBoolean("show_system_apps", item.isChecked()).apply();
|
|
||||||
} else if (itemId == R.id.item_show_games) {
|
|
||||||
item.setChecked(!item.isChecked());
|
|
||||||
preferences.edit().putBoolean("show_games", item.isChecked()).apply();
|
|
||||||
} else if (itemId == R.id.item_show_modules) {
|
|
||||||
item.setChecked(!item.isChecked());
|
|
||||||
preferences.edit().putBoolean("show_modules", item.isChecked()).apply();
|
|
||||||
} else if (!AppHelper.onOptionsItemSelected(item, preferences)) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
refresh();
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void onCreateOptionsMenu(@NonNull Menu menu, @NonNull MenuInflater inflater) {
|
|
||||||
inflater.inflate(R.menu.menu_app_list, menu);
|
|
||||||
menu.findItem(R.id.item_show_system).setChecked(preferences.getBoolean("show_system_apps", false));
|
|
||||||
menu.findItem(R.id.item_show_games).setChecked(preferences.getBoolean("show_games", false));
|
|
||||||
menu.findItem(R.id.item_show_modules).setChecked(preferences.getBoolean("show_modules", false));
|
|
||||||
switch (preferences.getInt("list_sort", 0)) {
|
|
||||||
case 7:
|
|
||||||
menu.findItem(R.id.item_sort_by_update_time_reverse).setChecked(true);
|
|
||||||
break;
|
|
||||||
case 6:
|
|
||||||
menu.findItem(R.id.item_sort_by_update_time).setChecked(true);
|
|
||||||
break;
|
|
||||||
case 5:
|
|
||||||
menu.findItem(R.id.item_sort_by_install_time_reverse).setChecked(true);
|
|
||||||
break;
|
|
||||||
case 4:
|
|
||||||
menu.findItem(R.id.item_sort_by_install_time).setChecked(true);
|
|
||||||
break;
|
|
||||||
case 3:
|
|
||||||
menu.findItem(R.id.item_sort_by_package_name_reverse).setChecked(true);
|
|
||||||
break;
|
|
||||||
case 2:
|
|
||||||
menu.findItem(R.id.item_sort_by_package_name).setChecked(true);
|
|
||||||
break;
|
|
||||||
case 1:
|
|
||||||
menu.findItem(R.id.item_sort_by_name_reverse).setChecked(true);
|
|
||||||
break;
|
|
||||||
case 0:
|
|
||||||
menu.findItem(R.id.item_sort_by_name).setChecked(true);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onBindViewHolder(@NonNull ViewHolder holder, int position) {
|
|
||||||
PackageInfo info = showList.get(position);
|
|
||||||
holder.appName.setText(getAppLabel(info.applicationInfo, pm));
|
|
||||||
try {
|
|
||||||
PackageInfo packageInfo = pm.getPackageInfo(info.packageName, 0);
|
|
||||||
GlideApp.with(holder.appIcon)
|
|
||||||
.load(packageInfo)
|
|
||||||
.into(new CustomTarget<Drawable>() {
|
|
||||||
@Override
|
|
||||||
public void onResourceReady(@NonNull Drawable resource, @Nullable Transition<? super Drawable> transition) {
|
|
||||||
holder.appIcon.setImageDrawable(resource);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onLoadCleared(@Nullable Drawable placeholder) {
|
|
||||||
|
|
||||||
}
|
|
||||||
});
|
|
||||||
holder.appVersion.setText(packageInfo.versionName);
|
|
||||||
holder.appVersion.setSelected(true);
|
|
||||||
String creationDate = dateformat.format(new Date(packageInfo.firstInstallTime));
|
|
||||||
String updateDate = dateformat.format(new Date(packageInfo.lastUpdateTime));
|
|
||||||
holder.timestamps.setText(holder.itemView.getContext().getString(R.string.install_timestamps, creationDate, updateDate));
|
|
||||||
} catch (PackageManager.NameNotFoundException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
holder.appPackage.setText(info.packageName);
|
|
||||||
|
|
||||||
holder.mSwitch.setOnCheckedChangeListener(null);
|
|
||||||
holder.mSwitch.setChecked(checkedList.contains(info.packageName));
|
|
||||||
if (this instanceof ScopeAdapter) {
|
|
||||||
holder.mSwitch.setEnabled(((ScopeAdapter) this).enabled);
|
|
||||||
} else {
|
|
||||||
holder.mSwitch.setEnabled(true);
|
|
||||||
}
|
|
||||||
holder.mSwitch.setOnCheckedChangeListener((v, isChecked) ->
|
|
||||||
onCheckedChange(v, isChecked, info.packageName));
|
|
||||||
holder.itemView.setOnClickListener(v -> AppHelper.showMenu(activity, activity.getSupportFragmentManager(), v, info.applicationInfo));
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public long getItemId(int position) {
|
|
||||||
return showList.get(position).packageName.hashCode();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Filter getFilter() {
|
|
||||||
return new ApplicationFilter();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int getItemCount() {
|
|
||||||
return showList.size();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void filter(String constraint) {
|
|
||||||
filter.filter(constraint);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void refresh() {
|
|
||||||
//noinspection deprecation
|
|
||||||
AsyncTask.THREAD_POOL_EXECUTOR.execute(this::loadApps);
|
|
||||||
}
|
|
||||||
|
|
||||||
protected void onCheckedChange(CompoundButton buttonView, boolean isChecked, String packageName) {
|
|
||||||
// override this to implements your functions
|
|
||||||
}
|
|
||||||
|
|
||||||
static class ViewHolder extends RecyclerView.ViewHolder {
|
|
||||||
|
|
||||||
ImageView appIcon;
|
|
||||||
TextView appName;
|
|
||||||
TextView appPackage;
|
|
||||||
TextView appVersion;
|
|
||||||
TextView timestamps;
|
|
||||||
SwitchCompat mSwitch;
|
|
||||||
|
|
||||||
ViewHolder(View itemView) {
|
|
||||||
super(itemView);
|
|
||||||
appIcon = itemView.findViewById(R.id.app_icon);
|
|
||||||
appName = itemView.findViewById(R.id.app_name);
|
|
||||||
appPackage = itemView.findViewById(R.id.package_name);
|
|
||||||
appVersion = itemView.findViewById(R.id.version_name);
|
|
||||||
timestamps = itemView.findViewById(R.id.timestamps);
|
|
||||||
mSwitch = itemView.findViewById(R.id.checkbox);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private class ApplicationFilter extends Filter {
|
|
||||||
|
|
||||||
private boolean lowercaseContains(String s, CharSequence filter) {
|
|
||||||
return !TextUtils.isEmpty(s) && s.toLowerCase().contains(filter);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected FilterResults performFiltering(CharSequence constraint) {
|
|
||||||
if (constraint.toString().isEmpty()) {
|
|
||||||
showList = fullList;
|
|
||||||
} else {
|
|
||||||
ArrayList<PackageInfo> filtered = new ArrayList<>();
|
|
||||||
String filter = constraint.toString().toLowerCase();
|
|
||||||
for (PackageInfo info : fullList) {
|
|
||||||
if (lowercaseContains(getAppLabel(info.applicationInfo, pm), filter)
|
|
||||||
|| lowercaseContains(info.packageName, filter)) {
|
|
||||||
filtered.add(info);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
showList = filtered;
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void publishResults(CharSequence constraint, FilterResults results) {
|
|
||||||
notifyDataSetChanged();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public static String getAppLabel(ApplicationInfo info, PackageManager pm) {
|
|
||||||
return info.loadLabel(pm).toString();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,27 +1,71 @@
|
||||||
package io.github.lsposed.manager.adapters;
|
package io.github.lsposed.manager.adapters;
|
||||||
|
|
||||||
|
import android.content.SharedPreferences;
|
||||||
|
import android.content.pm.ApplicationInfo;
|
||||||
|
import android.content.pm.PackageInfo;
|
||||||
|
import android.content.pm.PackageManager;
|
||||||
|
import android.graphics.drawable.Drawable;
|
||||||
|
import android.os.AsyncTask;
|
||||||
|
import android.text.TextUtils;
|
||||||
|
import android.view.LayoutInflater;
|
||||||
|
import android.view.Menu;
|
||||||
|
import android.view.MenuInflater;
|
||||||
|
import android.view.MenuItem;
|
||||||
|
import android.view.View;
|
||||||
|
import android.view.ViewGroup;
|
||||||
import android.widget.CompoundButton;
|
import android.widget.CompoundButton;
|
||||||
|
import android.widget.Filter;
|
||||||
|
import android.widget.Filterable;
|
||||||
|
import android.widget.ImageView;
|
||||||
|
import android.widget.TextView;
|
||||||
|
|
||||||
|
import androidx.annotation.NonNull;
|
||||||
|
import androidx.annotation.Nullable;
|
||||||
|
import androidx.appcompat.widget.SwitchCompat;
|
||||||
|
import androidx.recyclerview.widget.RecyclerView;
|
||||||
|
|
||||||
|
import com.bumptech.glide.request.target.CustomTarget;
|
||||||
|
import com.bumptech.glide.request.transition.Transition;
|
||||||
import com.google.android.material.snackbar.Snackbar;
|
import com.google.android.material.snackbar.Snackbar;
|
||||||
|
|
||||||
|
import java.text.DateFormat;
|
||||||
|
import java.text.SimpleDateFormat;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Collections;
|
||||||
|
import java.util.Comparator;
|
||||||
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Locale;
|
||||||
|
|
||||||
|
import io.github.lsposed.manager.App;
|
||||||
import io.github.lsposed.manager.R;
|
import io.github.lsposed.manager.R;
|
||||||
import io.github.lsposed.manager.ui.activity.AppListActivity;
|
import io.github.lsposed.manager.ui.activity.AppListActivity;
|
||||||
import io.github.lsposed.manager.ui.widget.MasterSwitch;
|
import io.github.lsposed.manager.ui.widget.MasterSwitch;
|
||||||
|
import io.github.lsposed.manager.util.GlideApp;
|
||||||
import io.github.lsposed.manager.util.ModuleUtil;
|
import io.github.lsposed.manager.util.ModuleUtil;
|
||||||
|
|
||||||
public class ScopeAdapter extends AppAdapter {
|
public class ScopeAdapter extends RecyclerView.Adapter<ScopeAdapter.ViewHolder> implements Filterable {
|
||||||
|
|
||||||
protected final String modulePackageName;
|
private final AppListActivity activity;
|
||||||
protected boolean enabled = true;
|
private final DateFormat dateformat = new SimpleDateFormat("yyyy-MM-dd", Locale.getDefault());
|
||||||
private List<String> checkedList;
|
private final PackageManager pm;
|
||||||
|
private final ApplicationFilter filter;
|
||||||
|
private final SharedPreferences preferences;
|
||||||
|
private final String modulePackageName;
|
||||||
private final MasterSwitch masterSwitch;
|
private final MasterSwitch masterSwitch;
|
||||||
|
private List<PackageInfo> fullList, showList;
|
||||||
|
private List<String> checkedList;
|
||||||
|
private boolean enabled = true;
|
||||||
|
|
||||||
public ScopeAdapter(AppListActivity activity, String modulePackageName, MasterSwitch masterSwitch) {
|
public ScopeAdapter(AppListActivity activity, String modulePackageName, MasterSwitch masterSwitch) {
|
||||||
super(activity);
|
this.activity = activity;
|
||||||
this.modulePackageName = modulePackageName;
|
this.modulePackageName = modulePackageName;
|
||||||
this.masterSwitch = masterSwitch;
|
this.masterSwitch = masterSwitch;
|
||||||
|
preferences = App.getPreferences();
|
||||||
|
fullList = showList = Collections.emptyList();
|
||||||
|
checkedList = Collections.emptyList();
|
||||||
|
filter = new ApplicationFilter();
|
||||||
|
pm = activity.getPackageManager();
|
||||||
masterSwitch.setOnCheckedChangedListener(new MasterSwitch.OnCheckedChangeListener() {
|
masterSwitch.setOnCheckedChangedListener(new MasterSwitch.OnCheckedChangeListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onCheckedChanged(boolean checked) {
|
public void onCheckedChanged(boolean checked) {
|
||||||
|
|
@ -30,31 +74,258 @@ public class ScopeAdapter extends AppAdapter {
|
||||||
notifyDataSetChanged();
|
notifyDataSetChanged();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
refresh();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@NonNull
|
||||||
@Override
|
@Override
|
||||||
public List<String> generateCheckedList() {
|
public ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||||
checkedList = AppHelper.getScopeList(modulePackageName);
|
View v = LayoutInflater.from(activity).inflate(R.layout.item_module, parent, false);
|
||||||
|
return new ViewHolder(v);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void loadApps() {
|
||||||
enabled = ModuleUtil.getInstance().isModuleEnabled(modulePackageName);
|
enabled = ModuleUtil.getInstance().isModuleEnabled(modulePackageName);
|
||||||
activity.runOnUiThread(() -> masterSwitch.setChecked(enabled));
|
activity.runOnUiThread(() -> masterSwitch.setChecked(enabled));
|
||||||
return checkedList;
|
checkedList = AppHelper.getScopeList(modulePackageName);
|
||||||
|
fullList = pm.getInstalledPackages(PackageManager.GET_META_DATA);
|
||||||
|
List<String> installedList = new ArrayList<>();
|
||||||
|
List<PackageInfo> rmList = new ArrayList<>();
|
||||||
|
for (PackageInfo info : fullList) {
|
||||||
|
installedList.add(info.packageName);
|
||||||
|
if (info.packageName.equals(((ScopeAdapter) this).modulePackageName)) {
|
||||||
|
rmList.add(info);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (checkedList.contains(info.packageName)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (!preferences.getBoolean("show_modules", false)) {
|
||||||
|
if (info.applicationInfo.metaData != null && info.applicationInfo.metaData.containsKey("xposedmodule")) {
|
||||||
|
rmList.add(info);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!preferences.getBoolean("show_games", false)) {
|
||||||
|
if (info.applicationInfo.category == ApplicationInfo.CATEGORY_GAME) {
|
||||||
|
rmList.add(info);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
//noinspection deprecation
|
||||||
|
if ((info.applicationInfo.flags & ApplicationInfo.FLAG_IS_GAME) != 0) {
|
||||||
|
rmList.add(info);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if ((info.applicationInfo.flags & ApplicationInfo.FLAG_HAS_CODE) == 0 && !info.packageName.equals("android")) {
|
||||||
|
rmList.add(info);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (!preferences.getBoolean("show_system_apps", false) && (info.applicationInfo.flags & ApplicationInfo.FLAG_SYSTEM) != 0) {
|
||||||
|
rmList.add(info);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
checkedList.retainAll(installedList);
|
||||||
|
if (rmList.size() > 0) {
|
||||||
|
fullList.removeAll(rmList);
|
||||||
|
}
|
||||||
|
sortApps();
|
||||||
|
showList = fullList;
|
||||||
|
activity.onDataReady();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void sortApps() {
|
||||||
|
Comparator<PackageInfo> cmp = AppHelper.getAppListComparator(preferences.getInt("list_sort", 0), pm);
|
||||||
|
fullList.sort((a, b) -> {
|
||||||
|
boolean aChecked = checkedList.contains(a.packageName);
|
||||||
|
boolean bChecked = checkedList.contains(b.packageName);
|
||||||
|
if (aChecked == bChecked) {
|
||||||
|
return cmp.compare(a, b);
|
||||||
|
} else if (aChecked) {
|
||||||
|
return -1;
|
||||||
|
} else {
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean onOptionsItemSelected(MenuItem item) {
|
||||||
|
int itemId = item.getItemId();
|
||||||
|
if (itemId == R.id.item_show_system) {
|
||||||
|
item.setChecked(!item.isChecked());
|
||||||
|
preferences.edit().putBoolean("show_system_apps", item.isChecked()).apply();
|
||||||
|
} else if (itemId == R.id.item_show_games) {
|
||||||
|
item.setChecked(!item.isChecked());
|
||||||
|
preferences.edit().putBoolean("show_games", item.isChecked()).apply();
|
||||||
|
} else if (itemId == R.id.item_show_modules) {
|
||||||
|
item.setChecked(!item.isChecked());
|
||||||
|
preferences.edit().putBoolean("show_modules", item.isChecked()).apply();
|
||||||
|
} else if (!AppHelper.onOptionsItemSelected(item, preferences)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
refresh();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void onCreateOptionsMenu(@NonNull Menu menu, @NonNull MenuInflater inflater) {
|
||||||
|
inflater.inflate(R.menu.menu_app_list, menu);
|
||||||
|
menu.findItem(R.id.item_show_system).setChecked(preferences.getBoolean("show_system_apps", false));
|
||||||
|
menu.findItem(R.id.item_show_games).setChecked(preferences.getBoolean("show_games", false));
|
||||||
|
menu.findItem(R.id.item_show_modules).setChecked(preferences.getBoolean("show_modules", false));
|
||||||
|
switch (preferences.getInt("list_sort", 0)) {
|
||||||
|
case 7:
|
||||||
|
menu.findItem(R.id.item_sort_by_update_time_reverse).setChecked(true);
|
||||||
|
break;
|
||||||
|
case 6:
|
||||||
|
menu.findItem(R.id.item_sort_by_update_time).setChecked(true);
|
||||||
|
break;
|
||||||
|
case 5:
|
||||||
|
menu.findItem(R.id.item_sort_by_install_time_reverse).setChecked(true);
|
||||||
|
break;
|
||||||
|
case 4:
|
||||||
|
menu.findItem(R.id.item_sort_by_install_time).setChecked(true);
|
||||||
|
break;
|
||||||
|
case 3:
|
||||||
|
menu.findItem(R.id.item_sort_by_package_name_reverse).setChecked(true);
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
menu.findItem(R.id.item_sort_by_package_name).setChecked(true);
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
menu.findItem(R.id.item_sort_by_name_reverse).setChecked(true);
|
||||||
|
break;
|
||||||
|
case 0:
|
||||||
|
menu.findItem(R.id.item_sort_by_name).setChecked(true);
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onCheckedChange(CompoundButton view, boolean isChecked, String packageName) {
|
public void onBindViewHolder(@NonNull ViewHolder holder, int position) {
|
||||||
|
PackageInfo info = showList.get(position);
|
||||||
|
holder.appName.setText(getAppLabel(info.applicationInfo, pm));
|
||||||
|
GlideApp.with(holder.appIcon)
|
||||||
|
.load(info)
|
||||||
|
.into(new CustomTarget<Drawable>() {
|
||||||
|
@Override
|
||||||
|
public void onResourceReady(@NonNull Drawable resource, @Nullable Transition<? super Drawable> transition) {
|
||||||
|
holder.appIcon.setImageDrawable(resource);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onLoadCleared(@Nullable Drawable placeholder) {
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
holder.appVersion.setText(info.versionName);
|
||||||
|
holder.appVersion.setSelected(true);
|
||||||
|
String creationDate = dateformat.format(new Date(info.firstInstallTime));
|
||||||
|
String updateDate = dateformat.format(new Date(info.lastUpdateTime));
|
||||||
|
holder.timestamps.setText(holder.itemView.getContext().getString(R.string.install_timestamps, creationDate, updateDate));
|
||||||
|
holder.appPackage.setText(info.packageName);
|
||||||
|
|
||||||
|
holder.mSwitch.setOnCheckedChangeListener(null);
|
||||||
|
holder.mSwitch.setChecked(checkedList.contains(info.packageName));
|
||||||
|
|
||||||
|
holder.mSwitch.setEnabled(((ScopeAdapter) this).enabled);
|
||||||
|
holder.mSwitch.setOnCheckedChangeListener((v, isChecked) ->
|
||||||
|
onCheckedChange(v, isChecked, info.packageName));
|
||||||
|
holder.itemView.setOnClickListener(v -> AppHelper.showMenu(activity, activity.getSupportFragmentManager(), v, info.applicationInfo));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public long getItemId(int position) {
|
||||||
|
return showList.get(position).packageName.hashCode();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Filter getFilter() {
|
||||||
|
return new ApplicationFilter();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getItemCount() {
|
||||||
|
return showList.size();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void filter(String constraint) {
|
||||||
|
filter.filter(constraint);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void refresh() {
|
||||||
|
//noinspection deprecation
|
||||||
|
AsyncTask.THREAD_POOL_EXECUTOR.execute(this::loadApps);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void onCheckedChange(CompoundButton buttonView, boolean isChecked, String packageName) {
|
||||||
if (isChecked) {
|
if (isChecked) {
|
||||||
checkedList.add(packageName);
|
checkedList.add(packageName);
|
||||||
} else {
|
} else {
|
||||||
checkedList.remove(packageName);
|
checkedList.remove(packageName);
|
||||||
}
|
}
|
||||||
if (!AppHelper.saveScopeList(modulePackageName, checkedList)) {
|
if (!AppHelper.saveScopeList(modulePackageName, checkedList)) {
|
||||||
activity.makeSnackBar(R.string.add_package_failed, Snackbar.LENGTH_SHORT);
|
activity.makeSnackBar(R.string.failed_to_save_scope_list, Snackbar.LENGTH_SHORT);
|
||||||
if (!isChecked) {
|
if (!isChecked) {
|
||||||
checkedList.add(packageName);
|
checkedList.add(packageName);
|
||||||
} else {
|
} else {
|
||||||
checkedList.remove(packageName);
|
checkedList.remove(packageName);
|
||||||
}
|
}
|
||||||
view.setChecked(!isChecked);
|
buttonView.setChecked(!isChecked);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static class ViewHolder extends RecyclerView.ViewHolder {
|
||||||
|
|
||||||
|
ImageView appIcon;
|
||||||
|
TextView appName;
|
||||||
|
TextView appPackage;
|
||||||
|
TextView appVersion;
|
||||||
|
TextView timestamps;
|
||||||
|
SwitchCompat mSwitch;
|
||||||
|
|
||||||
|
ViewHolder(View itemView) {
|
||||||
|
super(itemView);
|
||||||
|
appIcon = itemView.findViewById(R.id.app_icon);
|
||||||
|
appName = itemView.findViewById(R.id.app_name);
|
||||||
|
appPackage = itemView.findViewById(R.id.package_name);
|
||||||
|
appVersion = itemView.findViewById(R.id.version_name);
|
||||||
|
timestamps = itemView.findViewById(R.id.timestamps);
|
||||||
|
mSwitch = itemView.findViewById(R.id.checkbox);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private class ApplicationFilter extends Filter {
|
||||||
|
|
||||||
|
private boolean lowercaseContains(String s, CharSequence filter) {
|
||||||
|
return !TextUtils.isEmpty(s) && s.toLowerCase().contains(filter);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected FilterResults performFiltering(CharSequence constraint) {
|
||||||
|
if (constraint.toString().isEmpty()) {
|
||||||
|
showList = fullList;
|
||||||
|
} else {
|
||||||
|
ArrayList<PackageInfo> filtered = new ArrayList<>();
|
||||||
|
String filter = constraint.toString().toLowerCase();
|
||||||
|
for (PackageInfo info : fullList) {
|
||||||
|
if (lowercaseContains(getAppLabel(info.applicationInfo, pm), filter)
|
||||||
|
|| lowercaseContains(info.packageName, filter)) {
|
||||||
|
filtered.add(info);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
showList = filtered;
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void publishResults(CharSequence constraint, FilterResults results) {
|
||||||
|
notifyDataSetChanged();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String getAppLabel(ApplicationInfo info, PackageManager pm) {
|
||||||
|
return info.loadLabel(pm).toString();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,6 @@ import android.view.View;
|
||||||
import androidx.appcompat.app.ActionBar;
|
import androidx.appcompat.app.ActionBar;
|
||||||
import androidx.appcompat.app.AppCompatDelegate;
|
import androidx.appcompat.app.AppCompatDelegate;
|
||||||
|
|
||||||
import io.github.lsposed.manager.BuildConfig;
|
|
||||||
import io.github.lsposed.manager.R;
|
import io.github.lsposed.manager.R;
|
||||||
import io.github.lsposed.manager.databinding.ActivityAboutBinding;
|
import io.github.lsposed.manager.databinding.ActivityAboutBinding;
|
||||||
import io.github.lsposed.manager.util.NavUtil;
|
import io.github.lsposed.manager.util.NavUtil;
|
||||||
|
|
|
||||||
|
|
@ -3,10 +3,8 @@ package io.github.lsposed.manager.ui.activity;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.os.Handler;
|
import android.os.Handler;
|
||||||
import android.os.Looper;
|
import android.os.Looper;
|
||||||
import android.text.TextUtils;
|
|
||||||
import android.view.Menu;
|
import android.view.Menu;
|
||||||
import android.view.MenuItem;
|
import android.view.MenuItem;
|
||||||
import android.view.View;
|
|
||||||
import android.widget.Toast;
|
import android.widget.Toast;
|
||||||
|
|
||||||
import androidx.annotation.NonNull;
|
import androidx.annotation.NonNull;
|
||||||
|
|
@ -20,7 +18,6 @@ import com.google.android.material.dialog.MaterialAlertDialogBuilder;
|
||||||
import com.google.android.material.snackbar.Snackbar;
|
import com.google.android.material.snackbar.Snackbar;
|
||||||
|
|
||||||
import io.github.lsposed.manager.R;
|
import io.github.lsposed.manager.R;
|
||||||
import io.github.lsposed.manager.adapters.AppAdapter;
|
|
||||||
import io.github.lsposed.manager.adapters.AppHelper;
|
import io.github.lsposed.manager.adapters.AppHelper;
|
||||||
import io.github.lsposed.manager.adapters.ScopeAdapter;
|
import io.github.lsposed.manager.adapters.ScopeAdapter;
|
||||||
import io.github.lsposed.manager.databinding.ActivityAppListBinding;
|
import io.github.lsposed.manager.databinding.ActivityAppListBinding;
|
||||||
|
|
@ -30,7 +27,7 @@ import me.zhanghai.android.fastscroll.FastScrollerBuilder;
|
||||||
|
|
||||||
public class AppListActivity extends BaseActivity {
|
public class AppListActivity extends BaseActivity {
|
||||||
private SearchView searchView;
|
private SearchView searchView;
|
||||||
private AppAdapter appAdapter;
|
private ScopeAdapter scopeAdapter;
|
||||||
|
|
||||||
private SearchView.OnQueryTextListener searchListener;
|
private SearchView.OnQueryTextListener searchListener;
|
||||||
private ActivityAppListBinding binding;
|
private ActivityAppListBinding binding;
|
||||||
|
|
@ -55,13 +52,11 @@ public class AppListActivity extends BaseActivity {
|
||||||
ActionBar bar = getSupportActionBar();
|
ActionBar bar = getSupportActionBar();
|
||||||
assert bar != null;
|
assert bar != null;
|
||||||
bar.setDisplayHomeAsUpEnabled(true);
|
bar.setDisplayHomeAsUpEnabled(true);
|
||||||
if (!TextUtils.isEmpty(modulePackageName)) {
|
bar.setTitle(R.string.menu_scope);
|
||||||
bar.setTitle(R.string.menu_scope);
|
bar.setSubtitle(moduleName);
|
||||||
bar.setSubtitle(moduleName);
|
scopeAdapter = new ScopeAdapter(this, modulePackageName, binding.masterSwitch);
|
||||||
appAdapter = new ScopeAdapter(this, modulePackageName, binding.masterSwitch);
|
scopeAdapter.setHasStableIds(true);
|
||||||
}
|
binding.recyclerView.setAdapter(scopeAdapter);
|
||||||
appAdapter.setHasStableIds(true);
|
|
||||||
binding.recyclerView.setAdapter(appAdapter);
|
|
||||||
binding.recyclerView.setLayoutManager(new LinearLayoutManagerFix(this));
|
binding.recyclerView.setLayoutManager(new LinearLayoutManagerFix(this));
|
||||||
FastScrollerBuilder fastScrollerBuilder = new FastScrollerBuilder(binding.recyclerView);
|
FastScrollerBuilder fastScrollerBuilder = new FastScrollerBuilder(binding.recyclerView);
|
||||||
if (!preferences.getBoolean("md2", true)) {
|
if (!preferences.getBoolean("md2", true)) {
|
||||||
|
|
@ -73,18 +68,18 @@ public class AppListActivity extends BaseActivity {
|
||||||
}
|
}
|
||||||
fastScrollerBuilder.build();
|
fastScrollerBuilder.build();
|
||||||
handler.postDelayed(runnable, 300);
|
handler.postDelayed(runnable, 300);
|
||||||
binding.swipeRefreshLayout.setOnRefreshListener(appAdapter::refresh);
|
binding.swipeRefreshLayout.setOnRefreshListener(scopeAdapter::refresh);
|
||||||
|
|
||||||
searchListener = new SearchView.OnQueryTextListener() {
|
searchListener = new SearchView.OnQueryTextListener() {
|
||||||
@Override
|
@Override
|
||||||
public boolean onQueryTextSubmit(String query) {
|
public boolean onQueryTextSubmit(String query) {
|
||||||
appAdapter.filter(query);
|
scopeAdapter.filter(query);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onQueryTextChange(String newText) {
|
public boolean onQueryTextChange(String newText) {
|
||||||
appAdapter.filter(newText);
|
scopeAdapter.filter(newText);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
@ -92,7 +87,7 @@ public class AppListActivity extends BaseActivity {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onOptionsItemSelected(@NonNull MenuItem item) {
|
public boolean onOptionsItemSelected(@NonNull MenuItem item) {
|
||||||
if (!appAdapter.onOptionsItemSelected(item)) {
|
if (!scopeAdapter.onOptionsItemSelected(item)) {
|
||||||
return super.onOptionsItemSelected(item);
|
return super.onOptionsItemSelected(item);
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
|
@ -100,7 +95,7 @@ public class AppListActivity extends BaseActivity {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onCreateOptionsMenu(@NonNull Menu menu) {
|
public boolean onCreateOptionsMenu(@NonNull Menu menu) {
|
||||||
appAdapter.onCreateOptionsMenu(menu, getMenuInflater());
|
scopeAdapter.onCreateOptionsMenu(menu, getMenuInflater());
|
||||||
searchView = (SearchView) menu.findItem(R.id.menu_search).getActionView();
|
searchView = (SearchView) menu.findItem(R.id.menu_search).getActionView();
|
||||||
searchView.setOnQueryTextListener(searchListener);
|
searchView.setOnQueryTextListener(searchListener);
|
||||||
return super.onCreateOptionsMenu(menu);
|
return super.onCreateOptionsMenu(menu);
|
||||||
|
|
@ -110,7 +105,7 @@ public class AppListActivity extends BaseActivity {
|
||||||
handler.removeCallbacks(runnable);
|
handler.removeCallbacks(runnable);
|
||||||
binding.swipeRefreshLayout.setRefreshing(false);
|
binding.swipeRefreshLayout.setRefreshing(false);
|
||||||
String queryStr = searchView != null ? searchView.getQuery().toString() : "";
|
String queryStr = searchView != null ? searchView.getQuery().toString() : "";
|
||||||
runOnUiThread(() -> appAdapter.getFilter().filter(queryStr));
|
runOnUiThread(() -> scopeAdapter.getFilter().filter(queryStr));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
||||||
|
|
@ -14,10 +14,6 @@ import androidx.appcompat.app.AppCompatActivity;
|
||||||
|
|
||||||
import com.google.android.material.snackbar.Snackbar;
|
import com.google.android.material.snackbar.Snackbar;
|
||||||
|
|
||||||
import io.github.lsposed.manager.BuildConfig;
|
|
||||||
import io.github.lsposed.manager.R;
|
|
||||||
import io.github.lsposed.manager.databinding.ActivityCrashReportBinding;
|
|
||||||
|
|
||||||
import java.text.DateFormat;
|
import java.text.DateFormat;
|
||||||
import java.text.SimpleDateFormat;
|
import java.text.SimpleDateFormat;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
|
@ -25,6 +21,10 @@ import java.util.Locale;
|
||||||
import java.util.zip.ZipEntry;
|
import java.util.zip.ZipEntry;
|
||||||
import java.util.zip.ZipFile;
|
import java.util.zip.ZipFile;
|
||||||
|
|
||||||
|
import io.github.lsposed.manager.BuildConfig;
|
||||||
|
import io.github.lsposed.manager.R;
|
||||||
|
import io.github.lsposed.manager.databinding.ActivityCrashReportBinding;
|
||||||
|
|
||||||
public class CrashReportActivity extends AppCompatActivity {
|
public class CrashReportActivity extends AppCompatActivity {
|
||||||
ActivityCrashReportBinding binding;
|
ActivityCrashReportBinding binding;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -26,14 +26,6 @@ import com.google.android.material.dialog.MaterialAlertDialogBuilder;
|
||||||
import com.google.android.material.snackbar.Snackbar;
|
import com.google.android.material.snackbar.Snackbar;
|
||||||
import com.google.android.material.tabs.TabLayout;
|
import com.google.android.material.tabs.TabLayout;
|
||||||
|
|
||||||
import io.github.lsposed.manager.BuildConfig;
|
|
||||||
import io.github.lsposed.manager.Constants;
|
|
||||||
import io.github.lsposed.manager.R;
|
|
||||||
import io.github.lsposed.manager.databinding.ActivityLogsBinding;
|
|
||||||
import io.github.lsposed.manager.databinding.DialogInstallWarningBinding;
|
|
||||||
import io.github.lsposed.manager.databinding.ItemLogBinding;
|
|
||||||
import io.github.lsposed.manager.util.LinearLayoutManagerFix;
|
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.FileInputStream;
|
import java.io.FileInputStream;
|
||||||
import java.io.FileOutputStream;
|
import java.io.FileOutputStream;
|
||||||
|
|
@ -46,6 +38,14 @@ import java.util.Arrays;
|
||||||
import java.util.Calendar;
|
import java.util.Calendar;
|
||||||
import java.util.Scanner;
|
import java.util.Scanner;
|
||||||
|
|
||||||
|
import io.github.lsposed.manager.BuildConfig;
|
||||||
|
import io.github.lsposed.manager.Constants;
|
||||||
|
import io.github.lsposed.manager.R;
|
||||||
|
import io.github.lsposed.manager.databinding.ActivityLogsBinding;
|
||||||
|
import io.github.lsposed.manager.databinding.DialogInstallWarningBinding;
|
||||||
|
import io.github.lsposed.manager.databinding.ItemLogBinding;
|
||||||
|
import io.github.lsposed.manager.util.LinearLayoutManagerFix;
|
||||||
|
|
||||||
public class LogsActivity extends BaseActivity {
|
public class LogsActivity extends BaseActivity {
|
||||||
private boolean allLog = false;
|
private boolean allLog = false;
|
||||||
private final File fileErrorLog = new File(Constants.getBaseDir() + "log/error.log");
|
private final File fileErrorLog = new File(Constants.getBaseDir() + "log/error.log");
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,6 @@ import java.util.Locale;
|
||||||
|
|
||||||
import io.github.lsposed.manager.Constants;
|
import io.github.lsposed.manager.Constants;
|
||||||
import io.github.lsposed.manager.R;
|
import io.github.lsposed.manager.R;
|
||||||
import io.github.lsposed.manager.adapters.AppHelper;
|
|
||||||
import io.github.lsposed.manager.databinding.ActivityMainBinding;
|
import io.github.lsposed.manager.databinding.ActivityMainBinding;
|
||||||
import io.github.lsposed.manager.ui.fragment.StatusDialogBuilder;
|
import io.github.lsposed.manager.ui.fragment.StatusDialogBuilder;
|
||||||
import io.github.lsposed.manager.util.GlideHelper;
|
import io.github.lsposed.manager.util.GlideHelper;
|
||||||
|
|
|
||||||
|
|
@ -46,8 +46,8 @@ import io.github.lsposed.manager.App;
|
||||||
import io.github.lsposed.manager.BuildConfig;
|
import io.github.lsposed.manager.BuildConfig;
|
||||||
import io.github.lsposed.manager.Constants;
|
import io.github.lsposed.manager.Constants;
|
||||||
import io.github.lsposed.manager.R;
|
import io.github.lsposed.manager.R;
|
||||||
import io.github.lsposed.manager.adapters.AppAdapter;
|
|
||||||
import io.github.lsposed.manager.adapters.AppHelper;
|
import io.github.lsposed.manager.adapters.AppHelper;
|
||||||
|
import io.github.lsposed.manager.adapters.ScopeAdapter;
|
||||||
import io.github.lsposed.manager.databinding.ActivityModulesBinding;
|
import io.github.lsposed.manager.databinding.ActivityModulesBinding;
|
||||||
import io.github.lsposed.manager.util.GlideApp;
|
import io.github.lsposed.manager.util.GlideApp;
|
||||||
import io.github.lsposed.manager.util.LinearLayoutManagerFix;
|
import io.github.lsposed.manager.util.LinearLayoutManagerFix;
|
||||||
|
|
@ -80,7 +80,7 @@ public class ModulesActivity extends BaseActivity implements ModuleUtil.ModuleLi
|
||||||
showList = new ArrayList<>();
|
showList = new ArrayList<>();
|
||||||
String filter = queryStr.toLowerCase();
|
String filter = queryStr.toLowerCase();
|
||||||
for (ModuleUtil.InstalledModule info : fullList) {
|
for (ModuleUtil.InstalledModule info : fullList) {
|
||||||
if (lowercaseContains(AppAdapter.getAppLabel(info.app, pm), filter)
|
if (lowercaseContains(ScopeAdapter.getAppLabel(info.app, pm), filter)
|
||||||
|| lowercaseContains(info.packageName, filter)) {
|
|| lowercaseContains(info.packageName, filter)) {
|
||||||
showList.add(info);
|
showList.add(info);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -98,7 +98,6 @@
|
||||||
<string name="not_logcat">此处仅显示 LSPosed 及模块相关日志信息\n如果您想抓取系统日志, 可以尝试我们的 Log Catcher Magisk 模块</string>
|
<string name="not_logcat">此处仅显示 LSPosed 及模块相关日志信息\n如果您想抓取系统日志, 可以尝试我们的 Log Catcher Magisk 模块</string>
|
||||||
|
|
||||||
<!-- LSPd related -->
|
<!-- LSPd related -->
|
||||||
<string name="add_package_failed">修改失败, 一个或多个设置阻止你继续修改</string>
|
|
||||||
<string name="menu_title_compile_reset">取消优化</string>
|
<string name="menu_title_compile_reset">取消优化</string>
|
||||||
<string name="menu_title_compile_speed">以 Speed 模式优化应用</string>
|
<string name="menu_title_compile_speed">以 Speed 模式优化应用</string>
|
||||||
<string name="menu_title_compile_dexopt">以 Dexopt 模式优化应用</string>
|
<string name="menu_title_compile_dexopt">以 Dexopt 模式优化应用</string>
|
||||||
|
|
@ -119,8 +118,6 @@
|
||||||
<string name="app_stop">停止</string>
|
<string name="app_stop">停止</string>
|
||||||
<string name="compile_failed">优化失败或返回值为空</string>
|
<string name="compile_failed">优化失败或返回值为空</string>
|
||||||
<string name="compile_failed_with_info">优化失败: </string>
|
<string name="compile_failed_with_info">优化失败: </string>
|
||||||
<string name="hook_modules">强制添加模块</string>
|
|
||||||
<string name="hook_modules_summary">强制将模块添加进白名单\n关闭此选项并不会移除已勾选的应用标识</string>
|
|
||||||
<string name="not_installed">未安装</string>
|
<string name="not_installed">未安装</string>
|
||||||
<string name="reboot_system">重启至系统</string>
|
<string name="reboot_system">重启至系统</string>
|
||||||
<string name="pref_title_disable_modules_log">禁用模块日志</string>
|
<string name="pref_title_disable_modules_log">禁用模块日志</string>
|
||||||
|
|
@ -154,4 +151,7 @@
|
||||||
<string name="menu_sort">排序…</string>
|
<string name="menu_sort">排序…</string>
|
||||||
<string name="enable_module">启用模块</string>
|
<string name="enable_module">启用模块</string>
|
||||||
<string name="no_scope_selected">未选择任何应用。继续?</string>
|
<string name="no_scope_selected">未选择任何应用。继续?</string>
|
||||||
|
<string name="menu_show_games">游戏</string>
|
||||||
|
<string name="menu_show_modules">模块</string>
|
||||||
|
<string name="failed_to_save_scope_list">作用域列表保存失败</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
|
|
||||||
|
|
@ -97,7 +97,6 @@
|
||||||
<string name="not_logcat">此處僅顯示 LSPosed 及模塊相關日誌信息\n如果您想抓取系統日誌, 可以嘗試我們的 Log Catcher Magisk 模塊</string>
|
<string name="not_logcat">此處僅顯示 LSPosed 及模塊相關日誌信息\n如果您想抓取系統日誌, 可以嘗試我們的 Log Catcher Magisk 模塊</string>
|
||||||
|
|
||||||
<!-- LSPd related -->
|
<!-- LSPd related -->
|
||||||
<string name="add_package_failed">修改失敗, 一個或多個設置阻止你繼續修改</string>
|
|
||||||
<string name="menu_title_compile_reset">取消優化</string>
|
<string name="menu_title_compile_reset">取消優化</string>
|
||||||
<string name="menu_title_compile_speed">以 Speed 模式優化應用</string>
|
<string name="menu_title_compile_speed">以 Speed 模式優化應用</string>
|
||||||
<string name="menu_title_compile_dexopt">以 Dexopt 模式優化應用</string>
|
<string name="menu_title_compile_dexopt">以 Dexopt 模式優化應用</string>
|
||||||
|
|
@ -117,8 +116,6 @@
|
||||||
<string name="app_launch">運行</string>
|
<string name="app_launch">運行</string>
|
||||||
<string name="app_stop">停止</string>
|
<string name="app_stop">停止</string>
|
||||||
<string name="compile_failed">優化失敗或返回值為空</string>
|
<string name="compile_failed">優化失敗或返回值為空</string>
|
||||||
<string name="hook_modules">強制添加模塊</string>
|
|
||||||
<string name="hook_modules_summary">強制將模塊添加進白名單\n關閉此選項並不會移除已勾選的應用標識</string>
|
|
||||||
<string name="not_installed">未安裝</string>
|
<string name="not_installed">未安裝</string>
|
||||||
<string name="reboot_system">重啟至系統</string>
|
<string name="reboot_system">重啟至系統</string>
|
||||||
<string name="pref_title_disable_modules_log">禁用模塊日誌</string>
|
<string name="pref_title_disable_modules_log">禁用模塊日誌</string>
|
||||||
|
|
|
||||||
|
|
@ -97,7 +97,6 @@
|
||||||
<string name="not_logcat">此處僅顯示 LSPosed 及模組相關日誌資訊\n如果您想抓取系統日誌, 可以嘗試我們的 Log Catcher Magisk 模組</string>
|
<string name="not_logcat">此處僅顯示 LSPosed 及模組相關日誌資訊\n如果您想抓取系統日誌, 可以嘗試我們的 Log Catcher Magisk 模組</string>
|
||||||
|
|
||||||
<!-- LSPd related -->
|
<!-- LSPd related -->
|
||||||
<string name="add_package_failed">修改失敗, 一個或多個設定阻止你繼續修改</string>
|
|
||||||
<string name="menu_title_compile_reset">取消優化</string>
|
<string name="menu_title_compile_reset">取消優化</string>
|
||||||
<string name="menu_title_compile_speed">以 Speed 模式優化 App</string>
|
<string name="menu_title_compile_speed">以 Speed 模式優化 App</string>
|
||||||
<string name="menu_title_compile_dexopt">以 Dexopt 模式優化 App</string>
|
<string name="menu_title_compile_dexopt">以 Dexopt 模式優化 App</string>
|
||||||
|
|
@ -117,8 +116,6 @@
|
||||||
<string name="app_launch">執行</string>
|
<string name="app_launch">執行</string>
|
||||||
<string name="app_stop">停止</string>
|
<string name="app_stop">停止</string>
|
||||||
<string name="compile_failed">優化失敗或返回值為空</string>
|
<string name="compile_failed">優化失敗或返回值為空</string>
|
||||||
<string name="hook_modules">強制新增模組</string>
|
|
||||||
<string name="hook_modules_summary">強制將模組新增進白允許名單\n關閉此選項並不會移除已勾選的 App 標識</string>
|
|
||||||
<string name="not_installed">未安裝</string>
|
<string name="not_installed">未安裝</string>
|
||||||
<string name="reboot_system">重啟至系統</string>
|
<string name="reboot_system">重啟至系統</string>
|
||||||
<string name="pref_title_disable_modules_log">禁用模組日誌</string>
|
<string name="pref_title_disable_modules_log">禁用模組日誌</string>
|
||||||
|
|
|
||||||
|
|
@ -112,7 +112,6 @@
|
||||||
<string name="verified_boot_active">Verified Boot is active</string>
|
<string name="verified_boot_active">Verified Boot is active</string>
|
||||||
|
|
||||||
<!-- LSPd related -->
|
<!-- LSPd related -->
|
||||||
<string name="add_package_failed">Failed to edit, one or more settings prevent you from editing.</string>
|
|
||||||
<string name="menu_title_compile_reset">De-optimize</string>
|
<string name="menu_title_compile_reset">De-optimize</string>
|
||||||
<string name="menu_title_compile_speed">Optimize with Speed mode</string>
|
<string name="menu_title_compile_speed">Optimize with Speed mode</string>
|
||||||
<string name="menu_title_compile_dexopt">Optimize with Dexopt mode</string>
|
<string name="menu_title_compile_dexopt">Optimize with Dexopt mode</string>
|
||||||
|
|
@ -130,8 +129,6 @@
|
||||||
<string name="app_stop">Stop it</string>
|
<string name="app_stop">Stop it</string>
|
||||||
<string name="compile_failed">Optimization failed or return value is empty</string>
|
<string name="compile_failed">Optimization failed or return value is empty</string>
|
||||||
<string name="compile_failed_with_info">Optimization failed: </string>
|
<string name="compile_failed_with_info">Optimization failed: </string>
|
||||||
<string name="hook_modules">Force hook modules</string>
|
|
||||||
<string name="hook_modules_summary">Force add modules to white list\nClosing this option does not remove added modules from white list</string>
|
|
||||||
<string name="not_installed">Not installed</string>
|
<string name="not_installed">Not installed</string>
|
||||||
<string name="reboot_system">Reboot to System</string>
|
<string name="reboot_system">Reboot to System</string>
|
||||||
<string name="pref_title_disable_modules_log">Disable modules logs</string>
|
<string name="pref_title_disable_modules_log">Disable modules logs</string>
|
||||||
|
|
@ -164,4 +161,5 @@
|
||||||
<string name="no_scope_selected">You did not select any app. Continue?</string>
|
<string name="no_scope_selected">You did not select any app. Continue?</string>
|
||||||
<string name="menu_show_games">Games</string>
|
<string name="menu_show_games">Games</string>
|
||||||
<string name="menu_show_modules">Modules</string>
|
<string name="menu_show_modules">Modules</string>
|
||||||
|
<string name="failed_to_save_scope_list">Failed save scope list</string>
|
||||||
</resources>
|
</resources>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue