Clean up (#2718)
This commit is contained in:
parent
8d7e0bb4d8
commit
e637d47fbe
|
|
@ -226,10 +226,7 @@ public class App extends Application {
|
||||||
var intent = (Intent) inIntent.getParcelableExtra(Intent.EXTRA_INTENT);
|
var intent = (Intent) inIntent.getParcelableExtra(Intent.EXTRA_INTENT);
|
||||||
Log.d(TAG, "onReceive: " + intent);
|
Log.d(TAG, "onReceive: " + intent);
|
||||||
switch (intent.getAction()) {
|
switch (intent.getAction()) {
|
||||||
case Intent.ACTION_PACKAGE_ADDED:
|
case Intent.ACTION_PACKAGE_ADDED, Intent.ACTION_PACKAGE_CHANGED, Intent.ACTION_PACKAGE_FULLY_REMOVED, Intent.ACTION_UID_REMOVED -> {
|
||||||
case Intent.ACTION_PACKAGE_CHANGED:
|
|
||||||
case Intent.ACTION_PACKAGE_FULLY_REMOVED:
|
|
||||||
case Intent.ACTION_UID_REMOVED: {
|
|
||||||
var userId = intent.getIntExtra(Intent.EXTRA_USER, 0);
|
var userId = intent.getIntExtra(Intent.EXTRA_USER, 0);
|
||||||
var packageName = intent.getStringExtra("android.intent.extra.PACKAGES");
|
var packageName = intent.getStringExtra("android.intent.extra.PACKAGES");
|
||||||
var packageRemovedForAllUsers = intent.getBooleanExtra(EXTRA_REMOVED_FOR_ALL_USERS, false);
|
var packageRemovedForAllUsers = intent.getBooleanExtra(EXTRA_REMOVED_FOR_ALL_USERS, false);
|
||||||
|
|
@ -240,14 +237,8 @@ public class App extends Application {
|
||||||
else
|
else
|
||||||
App.getExecutorService().submit(() -> AppHelper.getAppList(true));
|
App.getExecutorService().submit(() -> AppHelper.getAppList(true));
|
||||||
}
|
}
|
||||||
break;
|
|
||||||
}
|
|
||||||
case ACTION_USER_ADDED:
|
|
||||||
case ACTION_USER_REMOVED:
|
|
||||||
case ACTION_USER_INFO_CHANGED: {
|
|
||||||
App.getExecutorService().submit(() -> ModuleUtil.getInstance().reloadInstalledModules());
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
case ACTION_USER_ADDED, ACTION_USER_REMOVED, ACTION_USER_INFO_CHANGED -> App.getExecutorService().submit(() -> ModuleUtil.getInstance().reloadInstalledModules());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}, intentFilter, Context.RECEIVER_NOT_EXPORTED);
|
}, intentFilter, Context.RECEIVER_NOT_EXPORTED);
|
||||||
|
|
|
||||||
|
|
@ -594,7 +594,7 @@ public class ScopeAdapter extends EmptyStateRecyclerView.EmptyStateAdapter<Scope
|
||||||
return isLoaded;
|
return isLoaded;
|
||||||
}
|
}
|
||||||
|
|
||||||
static class ViewHolder extends RecyclerView.ViewHolder {
|
public static class ViewHolder extends RecyclerView.ViewHolder {
|
||||||
ConstraintLayout root;
|
ConstraintLayout root;
|
||||||
ImageView appIcon;
|
ImageView appIcon;
|
||||||
TextView appName;
|
TextView appName;
|
||||||
|
|
@ -674,11 +674,11 @@ public class ScopeAdapter extends EmptyStateRecyclerView.EmptyStateAdapter<Scope
|
||||||
builder.setNegativeButton(!recommendedList.isEmpty() ? android.R.string.cancel : android.R.string.ok, (dialog, which) -> {
|
builder.setNegativeButton(!recommendedList.isEmpty() ? android.R.string.cancel : android.R.string.ok, (dialog, which) -> {
|
||||||
moduleUtil.setModuleEnabled(module.packageName, false);
|
moduleUtil.setModuleEnabled(module.packageName, false);
|
||||||
Toast.makeText(activity, activity.getString(R.string.module_disabled_no_selection, module.getAppName()), Toast.LENGTH_LONG).show();
|
Toast.makeText(activity, activity.getString(R.string.module_disabled_no_selection, module.getAppName()), Toast.LENGTH_LONG).show();
|
||||||
fragment.getNavController().navigateUp();
|
fragment.navigateUp();
|
||||||
});
|
});
|
||||||
builder.show();
|
builder.show();
|
||||||
} else {
|
} else {
|
||||||
fragment.getNavController().navigateUp();
|
fragment.navigateUp();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -99,7 +99,7 @@ public class RepoLoader {
|
||||||
synchronized public void loadRemoteData() {
|
synchronized public void loadRemoteData() {
|
||||||
repoLoaded = false;
|
repoLoaded = false;
|
||||||
try {
|
try {
|
||||||
var response = App.getOkHttpClient().newCall(new Request.Builder().url(repoUrl + "modules.json").build()).execute();
|
try (var response = App.getOkHttpClient().newCall(new Request.Builder().url(repoUrl + "modules.json").build()).execute()) {
|
||||||
|
|
||||||
if (response.isSuccessful()) {
|
if (response.isSuccessful()) {
|
||||||
ResponseBody body = response.body();
|
ResponseBody body = response.body();
|
||||||
|
|
@ -116,6 +116,7 @@ public class RepoLoader {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
} catch (Throwable e) {
|
} catch (Throwable e) {
|
||||||
Log.e(App.TAG, "load remote data", e);
|
Log.e(App.TAG, "load remote data", e);
|
||||||
for (RepoListener listener : listeners) {
|
for (RepoListener listener : listeners) {
|
||||||
|
|
|
||||||
|
|
@ -50,6 +50,7 @@ import org.lsposed.manager.util.ShortcutUtil;
|
||||||
import org.lsposed.manager.util.UpdateUtil;
|
import org.lsposed.manager.util.UpdateUtil;
|
||||||
|
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
|
import java.util.Objects;
|
||||||
|
|
||||||
import rikka.core.util.ResourceUtils;
|
import rikka.core.util.ResourceUtils;
|
||||||
|
|
||||||
|
|
@ -122,23 +123,17 @@ public class MainActivity extends BaseActivity implements RepoLoader.RepoListene
|
||||||
} else if (ConfigManager.isBinderAlive()) {
|
} else if (ConfigManager.isBinderAlive()) {
|
||||||
if (!TextUtils.isEmpty(intent.getDataString())) {
|
if (!TextUtils.isEmpty(intent.getDataString())) {
|
||||||
switch (intent.getDataString()) {
|
switch (intent.getDataString()) {
|
||||||
case "modules":
|
case "modules" -> nav.setSelectedItemId(R.id.modules_nav);
|
||||||
nav.setSelectedItemId(R.id.modules_nav);
|
case "logs" -> nav.setSelectedItemId(R.id.logs_fragment);
|
||||||
break;
|
case "repo" -> {
|
||||||
case "logs":
|
|
||||||
nav.setSelectedItemId(R.id.logs_fragment);
|
|
||||||
break;
|
|
||||||
case "repo":
|
|
||||||
if (ConfigManager.isMagiskInstalled()) {
|
if (ConfigManager.isMagiskInstalled()) {
|
||||||
nav.setSelectedItemId(R.id.repo_nav);
|
nav.setSelectedItemId(R.id.repo_nav);
|
||||||
}
|
}
|
||||||
break;
|
}
|
||||||
case "settings":
|
case "settings" -> nav.setSelectedItemId(R.id.settings_fragment);
|
||||||
nav.setSelectedItemId(R.id.settings_fragment);
|
default -> {
|
||||||
break;
|
|
||||||
default:
|
|
||||||
var data = intent.getData();
|
var data = intent.getData();
|
||||||
if (data != null && data.getScheme().equals("module")) {
|
if (data != null && Objects.equals(data.getScheme(), "module")) {
|
||||||
navController.navigate(
|
navController.navigate(
|
||||||
new Uri.Builder().scheme("lsposed").authority("module").appendQueryParameter("modulePackageName", data.getHost()).appendQueryParameter("moduleUserId", String.valueOf(data.getPort())).build(),
|
new Uri.Builder().scheme("lsposed").authority("module").appendQueryParameter("modulePackageName", data.getHost()).appendQueryParameter("moduleUserId", String.valueOf(data.getPort())).build(),
|
||||||
new NavOptions.Builder().setEnterAnim(R.anim.fragment_enter).setExitAnim(R.anim.fragment_exit).setPopEnterAnim(R.anim.fragment_enter_pop).setPopExitAnim(R.anim.fragment_exit_pop).setLaunchSingleTop(true).setPopUpTo(navController.getGraph().getStartDestinationId(), false, true).build());
|
new NavOptions.Builder().setEnterAnim(R.anim.fragment_enter).setExitAnim(R.anim.fragment_exit).setPopEnterAnim(R.anim.fragment_enter_pop).setPopExitAnim(R.anim.fragment_exit_pop).setLaunchSingleTop(true).setPopUpTo(navController.getGraph().getStartDestinationId(), false, true).build());
|
||||||
|
|
@ -147,6 +142,7 @@ public class MainActivity extends BaseActivity implements RepoLoader.RepoListene
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onSupportNavigateUp() {
|
public boolean onSupportNavigateUp() {
|
||||||
|
|
|
||||||
|
|
@ -19,8 +19,6 @@
|
||||||
|
|
||||||
package org.lsposed.manager.ui.fragment;
|
package org.lsposed.manager.ui.fragment;
|
||||||
|
|
||||||
import android.os.Handler;
|
|
||||||
import android.os.Looper;
|
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.widget.Toast;
|
import android.widget.Toast;
|
||||||
|
|
||||||
|
|
@ -33,7 +31,6 @@ import androidx.navigation.NavController;
|
||||||
import androidx.navigation.NavDirections;
|
import androidx.navigation.NavDirections;
|
||||||
import androidx.navigation.fragment.NavHostFragment;
|
import androidx.navigation.fragment.NavHostFragment;
|
||||||
|
|
||||||
import com.google.android.material.bottomnavigation.BottomNavigationView;
|
|
||||||
import com.google.android.material.floatingactionbutton.FloatingActionButton;
|
import com.google.android.material.floatingactionbutton.FloatingActionButton;
|
||||||
import com.google.android.material.snackbar.Snackbar;
|
import com.google.android.material.snackbar.Snackbar;
|
||||||
|
|
||||||
|
|
@ -45,7 +42,6 @@ import java.util.concurrent.Future;
|
||||||
import java.util.concurrent.FutureTask;
|
import java.util.concurrent.FutureTask;
|
||||||
|
|
||||||
public abstract class BaseFragment extends Fragment {
|
public abstract class BaseFragment extends Fragment {
|
||||||
private final Handler uiHandler = new Handler(Looper.getMainLooper());
|
|
||||||
|
|
||||||
public void navigateUp() {
|
public void navigateUp() {
|
||||||
getNavController().navigateUp();
|
getNavController().navigateUp();
|
||||||
|
|
@ -93,8 +89,7 @@ public abstract class BaseFragment extends Fragment {
|
||||||
if (tipsView != null) tipsView.setTooltipText(title);
|
if (tipsView != null) tipsView.setTooltipText(title);
|
||||||
if (menu != -1) {
|
if (menu != -1) {
|
||||||
toolbar.inflateMenu(menu);
|
toolbar.inflateMenu(menu);
|
||||||
if (this instanceof MenuProvider) {
|
if (this instanceof MenuProvider self) {
|
||||||
var self = (MenuProvider) this;
|
|
||||||
toolbar.setOnMenuItemClickListener(self::onMenuItemSelected);
|
toolbar.setOnMenuItemClickListener(self::onMenuItemSelected);
|
||||||
self.onPrepareMenu(toolbar.getMenu());
|
self.onPrepareMenu(toolbar.getMenu());
|
||||||
}
|
}
|
||||||
|
|
@ -110,7 +105,7 @@ public abstract class BaseFragment extends Fragment {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void runOnUiThread(Runnable runnable) {
|
public void runOnUiThread(Runnable runnable) {
|
||||||
uiHandler.post(runnable);
|
App.getMainHandler().post(runnable);
|
||||||
}
|
}
|
||||||
|
|
||||||
public <T> Future<T> runOnUiThread(Callable<T> callable) {
|
public <T> Future<T> runOnUiThread(Callable<T> callable) {
|
||||||
|
|
@ -132,12 +127,9 @@ public abstract class BaseFragment extends Fragment {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void showHint(CharSequence str, boolean lengthShort, CharSequence actionStr, View.OnClickListener action) {
|
public void showHint(CharSequence str, boolean lengthShort, CharSequence actionStr, View.OnClickListener action) {
|
||||||
if (isResumed()) {
|
var container = getView();
|
||||||
var container = requireActivity().findViewById(R.id.container);
|
if (isResumed() && container != null) {
|
||||||
if (container != null) {
|
|
||||||
var snackbar = Snackbar.make(container, str, lengthShort ? Snackbar.LENGTH_SHORT : Snackbar.LENGTH_LONG);
|
var snackbar = Snackbar.make(container, str, lengthShort ? Snackbar.LENGTH_SHORT : Snackbar.LENGTH_LONG);
|
||||||
if (container.findViewById(R.id.nav) instanceof BottomNavigationView)
|
|
||||||
snackbar.setAnchorView(R.id.nav);
|
|
||||||
var fab = container.findViewById(R.id.fab);
|
var fab = container.findViewById(R.id.fab);
|
||||||
if (fab instanceof FloatingActionButton && ((FloatingActionButton) fab).isOrWillBeShown())
|
if (fab instanceof FloatingActionButton && ((FloatingActionButton) fab).isOrWillBeShown())
|
||||||
snackbar.setAnchorView(fab);
|
snackbar.setAnchorView(fab);
|
||||||
|
|
@ -145,7 +137,6 @@ public abstract class BaseFragment extends Fragment {
|
||||||
snackbar.show();
|
snackbar.show();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
runOnUiThread(() -> {
|
runOnUiThread(() -> {
|
||||||
try {
|
try {
|
||||||
Toast.makeText(App.getInstance(), str, lengthShort ? Toast.LENGTH_SHORT : Toast.LENGTH_LONG).show();
|
Toast.makeText(App.getInstance(), str, lengthShort ? Toast.LENGTH_SHORT : Toast.LENGTH_LONG).show();
|
||||||
|
|
|
||||||
|
|
@ -194,19 +194,21 @@ public class ModulesFragment extends BaseFragment implements ModuleUtil.ModuleLi
|
||||||
@Override
|
@Override
|
||||||
public void onPrepareMenu(Menu menu) {
|
public void onPrepareMenu(Menu menu) {
|
||||||
searchView = (SearchView) menu.findItem(R.id.menu_search).getActionView();
|
searchView = (SearchView) menu.findItem(R.id.menu_search).getActionView();
|
||||||
|
if (searchView != null) {
|
||||||
searchView.setOnQueryTextListener(searchListener);
|
searchView.setOnQueryTextListener(searchListener);
|
||||||
searchView.addOnAttachStateChangeListener(new View.OnAttachStateChangeListener() {
|
searchView.addOnAttachStateChangeListener(new View.OnAttachStateChangeListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onViewAttachedToWindow(View arg0) {
|
public void onViewAttachedToWindow(@NonNull View arg0) {
|
||||||
binding.appBar.setExpanded(false, true);
|
binding.appBar.setExpanded(false, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onViewDetachedFromWindow(View v) {
|
public void onViewDetachedFromWindow(@NonNull View v) {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
searchView.findViewById(androidx.appcompat.R.id.search_edit_frame).setLayoutDirection(View.LAYOUT_DIRECTION_INHERIT);
|
searchView.findViewById(androidx.appcompat.R.id.search_edit_frame).setLayoutDirection(View.LAYOUT_DIRECTION_INHERIT);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onCreateMenu(@NonNull Menu menu, @NonNull MenuInflater menuInflater) {
|
public void onCreateMenu(@NonNull Menu menu, @NonNull MenuInflater menuInflater) {
|
||||||
|
|
@ -367,12 +369,12 @@ public class ModulesFragment extends BaseFragment implements ModuleUtil.ModuleLi
|
||||||
|
|
||||||
private final View.OnAttachStateChangeListener searchViewLocker = new View.OnAttachStateChangeListener() {
|
private final View.OnAttachStateChangeListener searchViewLocker = new View.OnAttachStateChangeListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onViewAttachedToWindow(View v) {
|
public void onViewAttachedToWindow(@NonNull View v) {
|
||||||
binding.recyclerView.setNestedScrollingEnabled(false);
|
binding.recyclerView.setNestedScrollingEnabled(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onViewDetachedFromWindow(View v) {
|
public void onViewDetachedFromWindow(@NonNull View v) {
|
||||||
binding.recyclerView.setNestedScrollingEnabled(true);
|
binding.recyclerView.setNestedScrollingEnabled(true);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
@ -399,8 +401,7 @@ public class ModulesFragment extends BaseFragment implements ModuleUtil.ModuleLi
|
||||||
|
|
||||||
void attachListeners() {
|
void attachListeners() {
|
||||||
var parent = getParentFragment();
|
var parent = getParentFragment();
|
||||||
if (parent instanceof ModulesFragment) {
|
if (parent instanceof ModulesFragment moduleFragment) {
|
||||||
var moduleFragment = (ModulesFragment) parent;
|
|
||||||
binding.recyclerView.getBorderViewDelegate().setBorderVisibilityChangedListener((top, oldTop, bottom, oldBottom) -> moduleFragment.binding.appBar.setLifted(!top));
|
binding.recyclerView.getBorderViewDelegate().setBorderVisibilityChangedListener((top, oldTop, bottom, oldBottom) -> moduleFragment.binding.appBar.setLifted(!top));
|
||||||
moduleFragment.binding.appBar.setLifted(!binding.recyclerView.getBorderViewDelegate().isShowingTopBorder());
|
moduleFragment.binding.appBar.setLifted(!binding.recyclerView.getBorderViewDelegate().isShowingTopBorder());
|
||||||
moduleFragment.searchView.addOnAttachStateChangeListener(searchViewLocker);
|
moduleFragment.searchView.addOnAttachStateChangeListener(searchViewLocker);
|
||||||
|
|
@ -419,8 +420,7 @@ public class ModulesFragment extends BaseFragment implements ModuleUtil.ModuleLi
|
||||||
void detachListeners() {
|
void detachListeners() {
|
||||||
binding.recyclerView.getBorderViewDelegate().setBorderVisibilityChangedListener(null);
|
binding.recyclerView.getBorderViewDelegate().setBorderVisibilityChangedListener(null);
|
||||||
var parent = getParentFragment();
|
var parent = getParentFragment();
|
||||||
if (parent instanceof ModulesFragment) {
|
if (parent instanceof ModulesFragment moduleFragment) {
|
||||||
var moduleFragment = (ModulesFragment) parent;
|
|
||||||
moduleFragment.searchView.removeOnAttachStateChangeListener(searchViewLocker);
|
moduleFragment.searchView.removeOnAttachStateChangeListener(searchViewLocker);
|
||||||
binding.recyclerView.setNestedScrollingEnabled(true);
|
binding.recyclerView.setNestedScrollingEnabled(true);
|
||||||
}
|
}
|
||||||
|
|
@ -517,7 +517,7 @@ public class ModulesFragment extends BaseFragment implements ModuleUtil.ModuleLi
|
||||||
@NonNull
|
@NonNull
|
||||||
@Override
|
@Override
|
||||||
public ModuleAdapter.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
public ModuleAdapter.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||||
return new ModuleAdapter.ViewHolder(ItemModuleBinding.inflate(getLayoutInflater(), parent, false));
|
return new ViewHolder(ItemModuleBinding.inflate(getLayoutInflater(), parent, false));
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isPick() {
|
public boolean isPick() {
|
||||||
|
|
@ -746,7 +746,7 @@ public class ModulesFragment extends BaseFragment implements ModuleUtil.ModuleLi
|
||||||
return isLoaded && moduleUtil.isModulesLoaded();
|
return isLoaded && moduleUtil.isModulesLoaded();
|
||||||
}
|
}
|
||||||
|
|
||||||
class ViewHolder extends RecyclerView.ViewHolder {
|
static class ViewHolder extends RecyclerView.ViewHolder {
|
||||||
ConstraintLayout root;
|
ConstraintLayout root;
|
||||||
ImageView appIcon;
|
ImageView appIcon;
|
||||||
TextView appName;
|
TextView appName;
|
||||||
|
|
|
||||||
|
|
@ -177,20 +177,22 @@ public class RepoFragment extends BaseFragment implements RepoLoader.RepoListene
|
||||||
@Override
|
@Override
|
||||||
public void onPrepareMenu(Menu menu) {
|
public void onPrepareMenu(Menu menu) {
|
||||||
searchView = (SearchView) menu.findItem(R.id.menu_search).getActionView();
|
searchView = (SearchView) menu.findItem(R.id.menu_search).getActionView();
|
||||||
|
if (searchView != null) {
|
||||||
searchView.setOnQueryTextListener(mSearchListener);
|
searchView.setOnQueryTextListener(mSearchListener);
|
||||||
searchView.addOnAttachStateChangeListener(new View.OnAttachStateChangeListener() {
|
searchView.addOnAttachStateChangeListener(new View.OnAttachStateChangeListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onViewAttachedToWindow(View arg0) {
|
public void onViewAttachedToWindow(@NonNull View arg0) {
|
||||||
binding.appBar.setExpanded(false, true);
|
binding.appBar.setExpanded(false, true);
|
||||||
binding.recyclerView.setNestedScrollingEnabled(false);
|
binding.recyclerView.setNestedScrollingEnabled(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onViewDetachedFromWindow(View v) {
|
public void onViewDetachedFromWindow(@NonNull View v) {
|
||||||
binding.recyclerView.setNestedScrollingEnabled(true);
|
binding.recyclerView.setNestedScrollingEnabled(true);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
searchView.findViewById(androidx.appcompat.R.id.search_edit_frame).setLayoutDirection(View.LAYOUT_DIRECTION_INHERIT);
|
searchView.findViewById(androidx.appcompat.R.id.search_edit_frame).setLayoutDirection(View.LAYOUT_DIRECTION_INHERIT);
|
||||||
|
}
|
||||||
int sort = App.getPreferences().getInt("repo_sort", 0);
|
int sort = App.getPreferences().getInt("repo_sort", 0);
|
||||||
if (sort == 0) {
|
if (sort == 0) {
|
||||||
menu.findItem(R.id.item_sort_by_name).setChecked(true);
|
menu.findItem(R.id.item_sort_by_name).setChecked(true);
|
||||||
|
|
@ -281,7 +283,7 @@ public class RepoFragment extends BaseFragment implements RepoLoader.RepoListene
|
||||||
@NonNull
|
@NonNull
|
||||||
@Override
|
@Override
|
||||||
public RepoAdapter.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
public RepoAdapter.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
|
||||||
return new RepoAdapter.ViewHolder(ItemOnlinemoduleBinding.inflate(getLayoutInflater(), parent, false));
|
return new ViewHolder(ItemOnlinemoduleBinding.inflate(getLayoutInflater(), parent, false));
|
||||||
}
|
}
|
||||||
|
|
||||||
RepoLoader.ModuleVersion getUpgradableVer(OnlineModule module) {
|
RepoLoader.ModuleVersion getUpgradableVer(OnlineModule module) {
|
||||||
|
|
@ -416,7 +418,7 @@ public class RepoFragment extends BaseFragment implements RepoLoader.RepoListene
|
||||||
return isLoaded && repoLoader.isRepoLoaded();
|
return isLoaded && repoLoader.isRepoLoaded();
|
||||||
}
|
}
|
||||||
|
|
||||||
class ViewHolder extends RecyclerView.ViewHolder {
|
static class ViewHolder extends RecyclerView.ViewHolder {
|
||||||
ConstraintLayout root;
|
ConstraintLayout root;
|
||||||
TextView appName;
|
TextView appName;
|
||||||
TextView appPackageName;
|
TextView appPackageName;
|
||||||
|
|
|
||||||
|
|
@ -1,23 +0,0 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?><!--
|
|
||||||
~ This file is part of LSPosed.
|
|
||||||
~
|
|
||||||
~ LSPosed is free software: you can redistribute it and/or modify
|
|
||||||
~ it under the terms of the GNU General Public License as published by
|
|
||||||
~ the Free Software Foundation, either version 3 of the License, or
|
|
||||||
~ (at your option) any later version.
|
|
||||||
~
|
|
||||||
~ LSPosed is distributed in the hope that it will be useful,
|
|
||||||
~ but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
~ GNU General Public License for more details.
|
|
||||||
~
|
|
||||||
~ You should have received a copy of the GNU General Public License
|
|
||||||
~ along with LSPosed. If not, see <https://www.gnu.org/licenses/>.
|
|
||||||
~
|
|
||||||
~ Copyright (C) 2021 LSPosed Contributors
|
|
||||||
-->
|
|
||||||
|
|
||||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
|
||||||
<item android:color="@color/primary_text_material_inverse" android:state_checked="true" />
|
|
||||||
<item android:color="@color/primary_text_material" />
|
|
||||||
</selector>
|
|
||||||
|
|
@ -1,22 +0,0 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?><!--
|
|
||||||
~ This file is part of LSPosed.
|
|
||||||
~
|
|
||||||
~ LSPosed is free software: you can redistribute it and/or modify
|
|
||||||
~ it under the terms of the GNU General Public License as published by
|
|
||||||
~ the Free Software Foundation, either version 3 of the License, or
|
|
||||||
~ (at your option) any later version.
|
|
||||||
~
|
|
||||||
~ LSPosed is distributed in the hope that it will be useful,
|
|
||||||
~ but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
~ GNU General Public License for more details.
|
|
||||||
~
|
|
||||||
~ You should have received a copy of the GNU General Public License
|
|
||||||
~ along with LSPosed. If not, see <https://www.gnu.org/licenses/>.
|
|
||||||
~
|
|
||||||
~ Copyright (C) 2021 LSPosed Contributors
|
|
||||||
-->
|
|
||||||
|
|
||||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
|
||||||
<item android:color="@color/primary_text_material_inverse" />
|
|
||||||
</selector>
|
|
||||||
|
|
@ -1,30 +0,0 @@
|
||||||
<!--
|
|
||||||
~ This file is part of LSPosed.
|
|
||||||
~
|
|
||||||
~ LSPosed is free software: you can redistribute it and/or modify
|
|
||||||
~ it under the terms of the GNU General Public License as published by
|
|
||||||
~ the Free Software Foundation, either version 3 of the License, or
|
|
||||||
~ (at your option) any later version.
|
|
||||||
~
|
|
||||||
~ LSPosed is distributed in the hope that it will be useful,
|
|
||||||
~ but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
~ GNU General Public License for more details.
|
|
||||||
~
|
|
||||||
~ You should have received a copy of the GNU General Public License
|
|
||||||
~ along with LSPosed. If not, see <https://www.gnu.org/licenses/>.
|
|
||||||
~
|
|
||||||
~ Copyright (C) 2022 LSPosed Contributors
|
|
||||||
-->
|
|
||||||
|
|
||||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
|
||||||
android:width="24dp"
|
|
||||||
android:height="24dp"
|
|
||||||
android:viewportWidth="24"
|
|
||||||
android:viewportHeight="24"
|
|
||||||
android:tint="?attr/colorControlNormal"
|
|
||||||
android:autoMirrored="true">
|
|
||||||
<path
|
|
||||||
android:fillColor="@android:color/white"
|
|
||||||
android:pathData="M18,1.01L8,1c-1.1,0 -2,0.9 -2,2v3h2V5h10v14H8v-1H6v3c0,1.1 0.9,2 2,2h10c1.1,0 2,-0.9 2,-2V3c0,-1.1 -0.9,-1.99 -2,-1.99zM10,15h2V8H5v2h3.59L3,15.59 4.41,17 10,11.41V15z"/>
|
|
||||||
</vector>
|
|
||||||
|
|
@ -1,29 +0,0 @@
|
||||||
<!--
|
|
||||||
~ This file is part of LSPosed.
|
|
||||||
~
|
|
||||||
~ LSPosed is free software: you can redistribute it and/or modify
|
|
||||||
~ it under the terms of the GNU General Public License as published by
|
|
||||||
~ the Free Software Foundation, either version 3 of the License, or
|
|
||||||
~ (at your option) any later version.
|
|
||||||
~
|
|
||||||
~ LSPosed is distributed in the hope that it will be useful,
|
|
||||||
~ but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
~ GNU General Public License for more details.
|
|
||||||
~
|
|
||||||
~ You should have received a copy of the GNU General Public License
|
|
||||||
~ along with LSPosed. If not, see <https://www.gnu.org/licenses/>.
|
|
||||||
~
|
|
||||||
~ Copyright (C) 2021 LSPosed Contributors
|
|
||||||
-->
|
|
||||||
|
|
||||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
|
||||||
android:width="24dp"
|
|
||||||
android:height="24dp"
|
|
||||||
android:viewportWidth="24"
|
|
||||||
android:viewportHeight="24"
|
|
||||||
android:tint="?attr/colorControlNormal">
|
|
||||||
<path
|
|
||||||
android:fillColor="@android:color/white"
|
|
||||||
android:pathData="M13,11.33L18,18H6l5,-6.67V6h2M15.96,4H8.04C7.62,4 7.39,4.48 7.65,4.81L9,6.5v4.17L3.2,18.4C2.71,19.06 3.18,20 4,20h16c0.82,0 1.29,-0.94 0.8,-1.6L15,10.67V6.5l1.35,-1.69C16.61,4.48 16.38,4 15.96,4L15.96,4z" />
|
|
||||||
</vector>
|
|
||||||
|
|
@ -1,30 +0,0 @@
|
||||||
<!--
|
|
||||||
~ This file is part of LSPosed.
|
|
||||||
~
|
|
||||||
~ LSPosed is free software: you can redistribute it and/or modify
|
|
||||||
~ it under the terms of the GNU General Public License as published by
|
|
||||||
~ the Free Software Foundation, either version 3 of the License, or
|
|
||||||
~ (at your option) any later version.
|
|
||||||
~
|
|
||||||
~ LSPosed is distributed in the hope that it will be useful,
|
|
||||||
~ but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
~ GNU General Public License for more details.
|
|
||||||
~
|
|
||||||
~ You should have received a copy of the GNU General Public License
|
|
||||||
~ along with LSPosed. If not, see <https://www.gnu.org/licenses/>.
|
|
||||||
~
|
|
||||||
~ Copyright (C) 2020 EdXposed Contributors
|
|
||||||
~ Copyright (C) 2021 LSPosed Contributors
|
|
||||||
-->
|
|
||||||
|
|
||||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
|
||||||
android:width="24dp"
|
|
||||||
android:height="24dp"
|
|
||||||
android:viewportWidth="24"
|
|
||||||
android:viewportHeight="24"
|
|
||||||
android:tint="?attr/colorControlNormal">
|
|
||||||
<path
|
|
||||||
android:fillColor="@android:color/white"
|
|
||||||
android:pathData="M17.65,6.35C16.2,4.9 14.21,4 12,4c-4.42,0 -7.99,3.58 -7.99,8s3.57,8 7.99,8c3.73,0 6.84,-2.55 7.73,-6h-2.08c-0.82,2.33 -3.04,4 -5.65,4 -3.31,0 -6,-2.69 -6,-6s2.69,-6 6,-6c1.66,0 3.14,0.69 4.22,1.78L13,11h7V4l-2.35,2.35z" />
|
|
||||||
</vector>
|
|
||||||
|
|
@ -1,30 +0,0 @@
|
||||||
<!--
|
|
||||||
~ This file is part of LSPosed.
|
|
||||||
~
|
|
||||||
~ LSPosed is free software: you can redistribute it and/or modify
|
|
||||||
~ it under the terms of the GNU General Public License as published by
|
|
||||||
~ the Free Software Foundation, either version 3 of the License, or
|
|
||||||
~ (at your option) any later version.
|
|
||||||
~
|
|
||||||
~ LSPosed is distributed in the hope that it will be useful,
|
|
||||||
~ but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
~ GNU General Public License for more details.
|
|
||||||
~
|
|
||||||
~ You should have received a copy of the GNU General Public License
|
|
||||||
~ along with LSPosed. If not, see <https://www.gnu.org/licenses/>.
|
|
||||||
~
|
|
||||||
~ Copyright (C) 2021 LSPosed Contributors
|
|
||||||
-->
|
|
||||||
|
|
||||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
|
||||||
android:width="24dp"
|
|
||||||
android:height="24dp"
|
|
||||||
android:viewportWidth="24"
|
|
||||||
android:viewportHeight="24"
|
|
||||||
android:tint="?attr/colorControlNormal"
|
|
||||||
android:autoMirrored="true">
|
|
||||||
<path
|
|
||||||
android:fillColor="@android:color/white"
|
|
||||||
android:pathData="M3.4,20.4l17.45,-7.48c0.81,-0.35 0.81,-1.49 0,-1.84L3.4,3.6c-0.66,-0.29 -1.39,0.2 -1.39,0.91L2,9.12c0,0.5 0.37,0.93 0.87,0.99L17,12 2.87,13.88c-0.5,0.07 -0.87,0.5 -0.87,1l0.01,4.61c0,0.71 0.73,1.2 1.39,0.91z" />
|
|
||||||
</vector>
|
|
||||||
|
|
@ -18,11 +18,10 @@
|
||||||
~ Copyright (C) 2021 LSPosed Contributors
|
~ Copyright (C) 2021 LSPosed Contributors
|
||||||
-->
|
-->
|
||||||
|
|
||||||
<menu xmlns:android="http://schemas.android.com/apk/res/android"
|
<menu xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
|
||||||
<item
|
<item
|
||||||
android:id="@+id/menu_open_in_browser"
|
android:id="@+id/menu_open_in_browser"
|
||||||
android:title="@string/menu_open_in_browser"
|
android:title="@string/menu_open_in_browser"
|
||||||
android:icon="@drawable/ic_open_in_browser"
|
android:icon="@drawable/ic_open_in_browser"
|
||||||
app:showAsAction="ifRoom" />
|
android:showAsAction="ifRoom" />
|
||||||
</menu>
|
</menu>
|
||||||
|
|
@ -18,14 +18,8 @@
|
||||||
-->
|
-->
|
||||||
|
|
||||||
<resources>
|
<resources>
|
||||||
<color name="home_secondary_outline_ambient_shadow_color">@color/material_grey_700</color>
|
|
||||||
<color name="home_secondary_outline_spot_shadow_color">@color/material_grey_600</color>
|
|
||||||
|
|
||||||
<color name="primary_text_material_inverse">@color/abc_primary_text_material_light</color>
|
<color name="primary_text_material_inverse">@color/abc_primary_text_material_light</color>
|
||||||
<color name="secondary_text_material_inverse">@color/abc_secondary_text_material_light</color>
|
|
||||||
|
|
||||||
<color name="primary_text_material">@color/abc_primary_text_material_dark</color>
|
<color name="primary_text_material">@color/abc_primary_text_material_dark</color>
|
||||||
<color name="secondary_text_material">@color/abc_secondary_text_material_dark</color>
|
|
||||||
|
|
||||||
<color name="ic_launcher_foreground">#F06292</color>
|
<color name="ic_launcher_foreground">#F06292</color>
|
||||||
<color name="ic_launcher_background">#E1F5FE</color>
|
<color name="ic_launcher_background">#E1F5FE</color>
|
||||||
|
|
|
||||||
|
|
@ -19,5 +19,4 @@
|
||||||
|
|
||||||
<resources>
|
<resources>
|
||||||
<dimen name="home_primary_elevation">12dp</dimen>
|
<dimen name="home_primary_elevation">12dp</dimen>
|
||||||
<dimen name="home_secondary_elevation">8dp</dimen>
|
|
||||||
</resources>
|
</resources>
|
||||||
|
|
|
||||||
|
|
@ -19,14 +19,9 @@
|
||||||
-->
|
-->
|
||||||
|
|
||||||
<resources>
|
<resources>
|
||||||
<color name="home_secondary_outline_ambient_shadow_color">@color/material_grey_500</color>
|
|
||||||
<color name="home_secondary_outline_spot_shadow_color">@color/material_grey_300</color>
|
|
||||||
|
|
||||||
<color name="primary_text_material_inverse">@color/abc_primary_text_material_dark</color>
|
<color name="primary_text_material_inverse">@color/abc_primary_text_material_dark</color>
|
||||||
<color name="secondary_text_material_inverse">@color/abc_secondary_text_material_dark</color>
|
|
||||||
|
|
||||||
<color name="primary_text_material">@color/abc_primary_text_material_light</color>
|
<color name="primary_text_material">@color/abc_primary_text_material_light</color>
|
||||||
<color name="secondary_text_material">@color/abc_secondary_text_material_light</color>
|
|
||||||
|
|
||||||
<color name="ic_launcher_foreground">#FFFFFF</color>
|
<color name="ic_launcher_foreground">#FFFFFF</color>
|
||||||
<color name="ic_launcher_background">#F48FB1</color>
|
<color name="ic_launcher_background">#F48FB1</color>
|
||||||
|
|
|
||||||
|
|
@ -1,24 +0,0 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?><!--
|
|
||||||
~ This file is part of LSPosed.
|
|
||||||
~
|
|
||||||
~ LSPosed is free software: you can redistribute it and/or modify
|
|
||||||
~ it under the terms of the GNU General Public License as published by
|
|
||||||
~ the Free Software Foundation, either version 3 of the License, or
|
|
||||||
~ (at your option) any later version.
|
|
||||||
~
|
|
||||||
~ LSPosed is distributed in the hope that it will be useful,
|
|
||||||
~ but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
~ GNU General Public License for more details.
|
|
||||||
~
|
|
||||||
~ You should have received a copy of the GNU General Public License
|
|
||||||
~ along with LSPosed. If not, see <https://www.gnu.org/licenses/>.
|
|
||||||
~
|
|
||||||
~ Copyright (C) 2021 LSPosed Contributors
|
|
||||||
-->
|
|
||||||
|
|
||||||
<!-- @see https://chromium.googlesource.com/chromium/src/+/master/ui/webui/resources/cr_elements/shared_vars_css.html -->
|
|
||||||
<resources>
|
|
||||||
<color name="google_blue_600">#1A73E8</color>
|
|
||||||
<color name="google_blue_300">#8AB4F8</color>
|
|
||||||
</resources>
|
|
||||||
|
|
@ -23,5 +23,4 @@
|
||||||
<dimen name="tab_layout_height">48dp</dimen>
|
<dimen name="tab_layout_height">48dp</dimen>
|
||||||
|
|
||||||
<dimen name="home_primary_elevation">6dp</dimen>
|
<dimen name="home_primary_elevation">6dp</dimen>
|
||||||
<dimen name="home_secondary_elevation">2dp</dimen>
|
|
||||||
</resources>
|
</resources>
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,6 @@
|
||||||
|
|
||||||
<resources xmlns:tools="http://schemas.android.com/tools" tools:keep="@string/xposed_module_updated_notification_*,@string/module_is_not_activated_*">
|
<resources xmlns:tools="http://schemas.android.com/tools" tools:keep="@string/xposed_module_updated_notification_*,@string/module_is_not_activated_*">
|
||||||
<!-- MainActivity -->
|
<!-- MainActivity -->
|
||||||
<string name="info">Info</string>
|
|
||||||
<string name="overview">Overview</string>
|
<string name="overview">Overview</string>
|
||||||
<string name="Modules">Modules</string>
|
<string name="Modules">Modules</string>
|
||||||
<plurals name="modules_enabled_count">
|
<plurals name="modules_enabled_count">
|
||||||
|
|
@ -32,7 +31,6 @@
|
||||||
<string name="About">About</string>
|
<string name="About">About</string>
|
||||||
<string name="report_issue">Report issue</string>
|
<string name="report_issue">Report issue</string>
|
||||||
<string name="module_repo">Repository</string>
|
<string name="module_repo">Repository</string>
|
||||||
<string name="module_repo_loading">Loading…</string>
|
|
||||||
<string name="module_repo_up_to_date">All modules up to date</string>
|
<string name="module_repo_up_to_date">All modules up to date</string>
|
||||||
<string name="module_repo_published_time">Published at %s</string>
|
<string name="module_repo_published_time">Published at %s</string>
|
||||||
<string name="module_repo_updated_time">Updated at %s</string>
|
<string name="module_repo_updated_time">Updated at %s</string>
|
||||||
|
|
@ -57,7 +55,6 @@
|
||||||
<string name="system_prop_incorrect"><![CDATA[Some necessary system properties deleted or modified.<br/>Modules may invalidate occasionally.]]></string>
|
<string name="system_prop_incorrect"><![CDATA[Some necessary system properties deleted or modified.<br/>Modules may invalidate occasionally.]]></string>
|
||||||
<string name="need_update">Need to update</string>
|
<string name="need_update">Need to update</string>
|
||||||
<string name="please_update_summary">Please install the latest version of LSPosed</string>
|
<string name="please_update_summary">Please install the latest version of LSPosed</string>
|
||||||
<string name="lsposed_not_active">LSPosed is not currently installed or active.</string>
|
|
||||||
<string name="info_api_version">API version</string>
|
<string name="info_api_version">API version</string>
|
||||||
<string name="info_framework_version">Framework version</string>
|
<string name="info_framework_version">Framework version</string>
|
||||||
<string name="info_manager_version">Manager version</string>
|
<string name="info_manager_version">Manager version</string>
|
||||||
|
|
@ -99,7 +96,6 @@
|
||||||
<string name="scroll_top">Scroll to top</string>
|
<string name="scroll_top">Scroll to top</string>
|
||||||
<string name="loading">Loading…</string>
|
<string name="loading">Loading…</string>
|
||||||
<string name="scroll_bottom">Scroll to bottom</string>
|
<string name="scroll_bottom">Scroll to bottom</string>
|
||||||
<string name="logs_cannot_read">Cannot read log: \n</string>
|
|
||||||
<string name="menuReload">Reload</string>
|
<string name="menuReload">Reload</string>
|
||||||
<string name="logs_clear_failed_2">Failed to clear the log</string>
|
<string name="logs_clear_failed_2">Failed to clear the log</string>
|
||||||
<string name="menu_enable_word_wrap">Word Wrap</string>
|
<string name="menu_enable_word_wrap">Word Wrap</string>
|
||||||
|
|
@ -222,7 +218,6 @@
|
||||||
<string name="module_information_collaborators">Collaborators</string>
|
<string name="module_information_collaborators">Collaborators</string>
|
||||||
<string name="module_release_view_assets">Assets</string>
|
<string name="module_release_view_assets">Assets</string>
|
||||||
<string name="menu_open_in_browser">Open in browser</string>
|
<string name="menu_open_in_browser">Open in browser</string>
|
||||||
<string name="refresh">Refresh</string>
|
|
||||||
<string name="module_release_load_more">Show older versions</string>
|
<string name="module_release_load_more">Show older versions</string>
|
||||||
<string name="module_release_no_more">No more release</string>
|
<string name="module_release_no_more">No more release</string>
|
||||||
<string name="repo_load_failed">Failed to load module repo: %s</string>
|
<string name="repo_load_failed">Failed to load module repo: %s</string>
|
||||||
|
|
|
||||||
|
|
@ -227,7 +227,7 @@ public class ConfigManager {
|
||||||
var pkg = new PackageParser().parsePackage(apkFile, 0, false);
|
var pkg = new PackageParser().parsePackage(apkFile, 0, false);
|
||||||
module.applicationInfo = pkg.applicationInfo;
|
module.applicationInfo = pkg.applicationInfo;
|
||||||
} catch (PackageParser.PackageParserException e) {
|
} catch (PackageParser.PackageParserException e) {
|
||||||
Log.w(TAG, "failed to parse parse " + module.apkPath, e);
|
Log.w(TAG, "failed to parse " + module.apkPath, e);
|
||||||
}
|
}
|
||||||
module.service = new LSPInjectedModuleService(module);
|
module.service = new LSPInjectedModuleService(module);
|
||||||
modules.add(module);
|
modules.add(module);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue