mirror of
https://github.com/topjohnwu/Magisk.git
synced 2025-01-04 22:37:49 +00:00
Fix some thangs
This commit is contained in:
parent
8df6af62d7
commit
cf69dd644a
@ -36,6 +36,7 @@ dependencies {
|
|||||||
compile 'com.android.support:cardview-v7:24.2.0'
|
compile 'com.android.support:cardview-v7:24.2.0'
|
||||||
compile 'com.android.support:design:24.2.0'
|
compile 'com.android.support:design:24.2.0'
|
||||||
compile 'com.github.d8ahazard:BroadcastTileSupportUpdate:master'
|
compile 'com.github.d8ahazard:BroadcastTileSupportUpdate:master'
|
||||||
|
compile 'com.getkeepsafe.taptargetview:taptargetview:1.2.0'
|
||||||
compile 'com.jakewharton:butterknife:8.4.0'
|
compile 'com.jakewharton:butterknife:8.4.0'
|
||||||
compile 'com.github.michalis-vitos:aFileChooser:master'
|
compile 'com.github.michalis-vitos:aFileChooser:master'
|
||||||
compile 'com.google.code.gson:gson:2.7'
|
compile 'com.google.code.gson:gson:2.7'
|
||||||
|
@ -36,6 +36,7 @@ public class AutoRootFragment extends ListFragment {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
|
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
|
||||||
|
prefs = PreferenceManager.getDefaultSharedPreferences(getActivity());
|
||||||
View view = inflater.inflate(R.layout.auto_root_fragment, container, false);
|
View view = inflater.inflate(R.layout.auto_root_fragment, container, false);
|
||||||
int horizontalMargin = (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 2, getResources().getDisplayMetrics());
|
int horizontalMargin = (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 2, getResources().getDisplayMetrics());
|
||||||
int verticalMargin = (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 2, getResources().getDisplayMetrics());
|
int verticalMargin = (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 2, getResources().getDisplayMetrics());
|
||||||
|
@ -5,6 +5,7 @@ import android.app.Fragment;
|
|||||||
import android.app.FragmentTransaction;
|
import android.app.FragmentTransaction;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.content.pm.PackageManager;
|
import android.content.pm.PackageManager;
|
||||||
|
import android.graphics.Color;
|
||||||
import android.os.Build;
|
import android.os.Build;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.os.Handler;
|
import android.os.Handler;
|
||||||
@ -19,10 +20,12 @@ import android.support.v7.app.AppCompatActivity;
|
|||||||
import android.support.v7.widget.Toolbar;
|
import android.support.v7.widget.Toolbar;
|
||||||
import android.view.MenuItem;
|
import android.view.MenuItem;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
|
import android.widget.ImageButton;
|
||||||
|
|
||||||
import com.topjohnwu.magisk.utils.Logger;
|
import com.topjohnwu.magisk.utils.Logger;
|
||||||
import com.topjohnwu.magisk.utils.Utils;
|
import com.topjohnwu.magisk.utils.Utils;
|
||||||
|
|
||||||
|
|
||||||
import butterknife.BindView;
|
import butterknife.BindView;
|
||||||
import butterknife.ButterKnife;
|
import butterknife.ButterKnife;
|
||||||
|
|
||||||
@ -32,6 +35,7 @@ public class MainActivity extends AppCompatActivity implements NavigationView.On
|
|||||||
|
|
||||||
private final Handler mDrawerHandler = new Handler();
|
private final Handler mDrawerHandler = new Handler();
|
||||||
private String currentTitle;
|
private String currentTitle;
|
||||||
|
private View mView;
|
||||||
|
|
||||||
@BindView(R.id.toolbar)
|
@BindView(R.id.toolbar)
|
||||||
Toolbar toolbar;
|
Toolbar toolbar;
|
||||||
@ -100,7 +104,9 @@ public class MainActivity extends AppCompatActivity implements NavigationView.On
|
|||||||
navigationView.setCheckedItem(R.id.settings);
|
navigationView.setCheckedItem(R.id.settings);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
}
|
||||||
|
|
||||||
|
);
|
||||||
|
|
||||||
setSupportActionBar(toolbar);
|
setSupportActionBar(toolbar);
|
||||||
|
|
||||||
@ -130,9 +136,25 @@ public class MainActivity extends AppCompatActivity implements NavigationView.On
|
|||||||
}
|
}
|
||||||
|
|
||||||
navigationView.setNavigationItemSelectedListener(this);
|
navigationView.setNavigationItemSelectedListener(this);
|
||||||
|
mView = getToolbarNavigationButton();
|
||||||
if (getIntent().hasExtra("relaunch")) {
|
if (getIntent().hasExtra("relaunch")) {
|
||||||
navigate(R.id.root);
|
navigate(R.id.root);
|
||||||
}
|
}
|
||||||
|
startTour();
|
||||||
|
}
|
||||||
|
|
||||||
|
public ImageButton getToolbarNavigationButton() {
|
||||||
|
int size = toolbar.getChildCount();
|
||||||
|
for (int i = 0; i < size; i++) {
|
||||||
|
View child = toolbar.getChildAt(i);
|
||||||
|
if (child instanceof ImageButton) {
|
||||||
|
ImageButton btn = (ImageButton) child;
|
||||||
|
if (btn.getDrawable() == toolbar.getNavigationIcon()) {
|
||||||
|
return btn;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -141,6 +163,11 @@ public class MainActivity extends AppCompatActivity implements NavigationView.On
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void startTour() {
|
||||||
|
navigate(R.id.root);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onSaveInstanceState(Bundle outState) {
|
protected void onSaveInstanceState(Bundle outState) {
|
||||||
super.onSaveInstanceState(outState);
|
super.onSaveInstanceState(outState);
|
||||||
|
@ -3,6 +3,7 @@ package com.topjohnwu.magisk;
|
|||||||
import android.app.Fragment;
|
import android.app.Fragment;
|
||||||
import android.content.DialogInterface;
|
import android.content.DialogInterface;
|
||||||
import android.content.SharedPreferences;
|
import android.content.SharedPreferences;
|
||||||
|
import android.graphics.Color;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.preference.PreferenceManager;
|
import android.preference.PreferenceManager;
|
||||||
import android.support.annotation.Nullable;
|
import android.support.annotation.Nullable;
|
||||||
@ -20,6 +21,7 @@ import com.topjohnwu.magisk.module.Repo;
|
|||||||
import com.topjohnwu.magisk.module.RepoHelper;
|
import com.topjohnwu.magisk.module.RepoHelper;
|
||||||
import com.topjohnwu.magisk.utils.Async;
|
import com.topjohnwu.magisk.utils.Async;
|
||||||
import com.topjohnwu.magisk.utils.Utils;
|
import com.topjohnwu.magisk.utils.Utils;
|
||||||
|
import com.wooplr.spotlight.SpotlightView;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
@ -29,6 +31,8 @@ import java.util.List;
|
|||||||
import butterknife.BindView;
|
import butterknife.BindView;
|
||||||
import butterknife.ButterKnife;
|
import butterknife.ButterKnife;
|
||||||
|
|
||||||
|
import static com.topjohnwu.magisk.R.menu.drawer;
|
||||||
|
|
||||||
public class ReposFragment extends Fragment {
|
public class ReposFragment extends Fragment {
|
||||||
|
|
||||||
public static List<Repo> mListRepos = new ArrayList<>();
|
public static List<Repo> mListRepos = new ArrayList<>();
|
||||||
@ -74,6 +78,7 @@ public class ReposFragment extends Fragment {
|
|||||||
CheckForUpdates();
|
CheckForUpdates();
|
||||||
Log.d("Magisk", "ReposFragment: ListRepos size is " + listRepos().size());
|
Log.d("Magisk", "ReposFragment: ListRepos size is " + listRepos().size());
|
||||||
recyclerView.setAdapter(new ReposAdapter(this, mListRepos));
|
recyclerView.setAdapter(new ReposAdapter(this, mListRepos));
|
||||||
|
|
||||||
return view;
|
return view;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,15 +1,19 @@
|
|||||||
package com.topjohnwu.magisk;
|
package com.topjohnwu.magisk;
|
||||||
|
|
||||||
import android.app.Fragment;
|
import android.app.Fragment;
|
||||||
|
import android.content.Context;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.content.SharedPreferences;
|
import android.content.SharedPreferences;
|
||||||
import android.graphics.Color;
|
import android.graphics.Color;
|
||||||
import android.graphics.PorterDuff;
|
import android.graphics.PorterDuff;
|
||||||
|
import android.graphics.Typeface;
|
||||||
import android.os.AsyncTask;
|
import android.os.AsyncTask;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.preference.PreferenceManager;
|
import android.preference.PreferenceManager;
|
||||||
import android.support.annotation.Nullable;
|
import android.support.annotation.Nullable;
|
||||||
import android.support.design.widget.Snackbar;
|
import android.support.design.widget.Snackbar;
|
||||||
|
import android.text.SpannableString;
|
||||||
|
import android.text.style.StyleSpan;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
@ -21,6 +25,8 @@ import android.widget.Switch;
|
|||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
import android.widget.Toast;
|
import android.widget.Toast;
|
||||||
|
|
||||||
|
import com.getkeepsafe.taptargetview.TapTarget;
|
||||||
|
import com.getkeepsafe.taptargetview.TapTargetSequence;
|
||||||
import com.topjohnwu.magisk.services.MonitorService;
|
import com.topjohnwu.magisk.services.MonitorService;
|
||||||
import com.topjohnwu.magisk.utils.Logger;
|
import com.topjohnwu.magisk.utils.Logger;
|
||||||
import com.topjohnwu.magisk.utils.PrefHelper;
|
import com.topjohnwu.magisk.utils.PrefHelper;
|
||||||
@ -138,6 +144,7 @@ public class RootFragment extends Fragment {
|
|||||||
new updateUI().execute();
|
new updateUI().execute();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
return view;
|
return view;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -147,6 +154,8 @@ public class RootFragment extends Fragment {
|
|||||||
prefs.unregisterOnSharedPreferenceChangeListener(listener);
|
prefs.unregisterOnSharedPreferenceChangeListener(listener);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onActivityResult(int requestCode, int resultCode, Intent data) {
|
public void onActivityResult(int requestCode, int resultCode, Intent data) {
|
||||||
// Check which request we're responding to
|
// Check which request we're responding to
|
||||||
@ -188,6 +197,7 @@ public class RootFragment extends Fragment {
|
|||||||
super.onResume();
|
super.onResume();
|
||||||
getActivity().setTitle("Root");
|
getActivity().setTitle("Root");
|
||||||
new updateUI().execute();
|
new updateUI().execute();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public class updateUI extends AsyncTask<Void, Void, Void> {
|
public class updateUI extends AsyncTask<Void, Void, Void> {
|
||||||
|
@ -20,6 +20,7 @@ public class SplashActivity extends AppCompatActivity {
|
|||||||
@Override
|
@Override
|
||||||
protected void onCreate(Bundle savedInstanceState) {
|
protected void onCreate(Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
|
|
||||||
//setups go here
|
//setups go here
|
||||||
|
|
||||||
// Set up default preferences,make sure we add "extra" blacklist entries.
|
// Set up default preferences,make sure we add "extra" blacklist entries.
|
||||||
@ -63,7 +64,7 @@ public class SplashActivity extends AppCompatActivity {
|
|||||||
// Start main activity
|
// Start main activity
|
||||||
Intent intent = new Intent(this, MainActivity.class);
|
Intent intent = new Intent(this, MainActivity.class);
|
||||||
startActivity(intent);
|
startActivity(intent);
|
||||||
|
|
||||||
finish();
|
finish();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -74,7 +74,9 @@ public class TileServiceCompat extends Service {
|
|||||||
private void onSimpleClick() {
|
private void onSimpleClick() {
|
||||||
updateRoots();
|
updateRoots();
|
||||||
updateTile();
|
updateTile();
|
||||||
|
Utils.toggleAutoRoot(false,getApplicationContext());
|
||||||
Utils.toggleRoot(!root,getApplicationContext());
|
Utils.toggleRoot(!root,getApplicationContext());
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void onLongClick() {
|
private void onLongClick() {
|
||||||
|
@ -145,6 +145,7 @@ public class Utils {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static void toggleAutoRoot(Boolean b, Context context) {
|
public static void toggleAutoRoot(Boolean b, Context context) {
|
||||||
|
Logger.dh("Utils: toggleAutocalled for " + b );
|
||||||
if (Utils.magiskVersion != -1) {
|
if (Utils.magiskVersion != -1) {
|
||||||
if (!Utils.hasServicePermission(context)) {
|
if (!Utils.hasServicePermission(context)) {
|
||||||
Intent intent = new Intent(android.provider.Settings.ACTION_ACCESSIBILITY_SETTINGS);
|
Intent intent = new Intent(android.provider.Settings.ACTION_ACCESSIBILITY_SETTINGS);
|
||||||
@ -152,6 +153,7 @@ public class Utils {
|
|||||||
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||||
context.startActivity(intent);
|
context.startActivity(intent);
|
||||||
} else {
|
} else {
|
||||||
|
Logger.dh("Utils: toggleAuto checks passed, setting" + b );
|
||||||
PreferenceManager.getDefaultSharedPreferences(context).edit().putBoolean("autoRootEnable", b).apply();
|
PreferenceManager.getDefaultSharedPreferences(context).edit().putBoolean("autoRootEnable", b).apply();
|
||||||
Intent myServiceIntent = new Intent(context, MonitorService.class);
|
Intent myServiceIntent = new Intent(context, MonitorService.class);
|
||||||
if (b) {
|
if (b) {
|
||||||
|
@ -28,27 +28,29 @@
|
|||||||
android:layout_alignParentStart="true"
|
android:layout_alignParentStart="true"
|
||||||
android:layout_alignParentTop="true"
|
android:layout_alignParentTop="true"
|
||||||
android:layout_marginTop="0dp"
|
android:layout_marginTop="0dp"
|
||||||
android:singleLine="false"
|
android:maxLines="1"
|
||||||
android:textAppearance="?android:attr/textAppearanceMedium"
|
android:textAppearance="?android:attr/textAppearanceMedium"
|
||||||
android:textIsSelectable="false" />
|
android:textIsSelectable="false" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/version_name"
|
android:id="@+id/version_name"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="@dimen/card_textview_width"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_alignParentStart="true"
|
|
||||||
android:layout_below="@id/title"
|
android:layout_below="@id/title"
|
||||||
android:textAppearance="?android:attr/textAppearanceSmall"
|
android:textAppearance="?android:attr/textAppearanceSmall"
|
||||||
android:textColor="@android:color/tertiary_text_dark"
|
android:textColor="@android:color/tertiary_text_dark"
|
||||||
android:textIsSelectable="false"
|
android:textIsSelectable="false"
|
||||||
android:textStyle="bold|italic" />
|
android:textStyle="bold|italic"
|
||||||
|
android:layout_alignParentStart="true"/>
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_alignBaseline="@id/title"
|
|
||||||
android:layout_alignParentEnd="true"
|
android:layout_alignParentEnd="true"
|
||||||
android:orientation="horizontal">
|
android:orientation="horizontal"
|
||||||
|
android:layout_alignParentTop="true"
|
||||||
|
android:layout_above="@+id/expand_layout"
|
||||||
|
android:paddingTop="15dp">
|
||||||
|
|
||||||
|
|
||||||
<CheckBox
|
<CheckBox
|
||||||
@ -62,15 +64,15 @@
|
|||||||
tools:ignore="ContentDescription" />
|
tools:ignore="ContentDescription" />
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
android:id="@+id/delete"
|
android:id="@+id/delete"
|
||||||
android:layout_width="wrap_content"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginBottom="0dp"
|
android:layout_marginBottom="0dp"
|
||||||
android:focusable="false"
|
android:focusable="false"
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:padding="@dimen/checkbox_padding"
|
android:padding="@dimen/checkbox_padding"
|
||||||
android:src="@drawable/ic_delete"
|
android:src="@drawable/ic_delete"
|
||||||
tools:ignore="ContentDescription" />
|
tools:ignore="ContentDescription" />
|
||||||
|
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
<!--TODO - Work in an auto-update notifier, make this fly around like magic -->
|
<!--TODO - Work in an auto-update notifier, make this fly around like magic -->
|
||||||
|
@ -113,14 +113,14 @@
|
|||||||
<string name="settings_quicksettings_category">Quick Settings</string>
|
<string name="settings_quicksettings_category">Quick Settings</string>
|
||||||
<string name="settings_enable_quicktile_title">Enable Quicksettings Tile</string>
|
<string name="settings_enable_quicktile_title">Enable Quicksettings Tile</string>
|
||||||
<string name="settings_enable_quicktile_summary">Click here to enable or disable the quick settings tile.</string>
|
<string name="settings_enable_quicktile_summary">Click here to enable or disable the quick settings tile.</string>
|
||||||
<string name="settings_keep_root_off_summary">Disable root unless otherwise enabled by Auto-root or toggle.</string>
|
<string name="settings_keep_root_off_summary">Disable root unless otherwise enabled by auto-toggle or toggle.</string>
|
||||||
<string name="settings_keep_root_off_title">Keep root turned off</string>
|
<string name="settings_keep_root_off_title">Keep root turned off</string>
|
||||||
<string name="settings_developer_logging_title">Enable advanced debug logging</string>
|
<string name="settings_developer_logging_title">Enable advanced debug logging</string>
|
||||||
<string name="settings_developer_logging_summary">Check this to enable more verbose logging.</string>
|
<string name="settings_developer_logging_summary">Check this to enable more verbose logging.</string>
|
||||||
<string name="settings_root_category">Root</string>
|
<string name="settings_root_category">Root</string>
|
||||||
<string name="settings_development_category">Development</string>
|
<string name="settings_development_category">Development</string>
|
||||||
<string name="settings_hide_root_notification_summary">When checked, auto-root notifications will not be displayed.</string>
|
<string name="settings_hide_root_notification_summary">When checked, auto-toggle notifications will not be displayed.</string>
|
||||||
<string name="settings_hide_root_notification_title">Hide auto-root notifications</string>
|
<string name="settings_hide_root_notification_title">Hide auto-toggle notifications</string>
|
||||||
|
|
||||||
<!--General Use -->
|
<!--General Use -->
|
||||||
<string name="auto_toggle">Auto-toggle</string>
|
<string name="auto_toggle">Auto-toggle</string>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user