mirror of
https://github.com/topjohnwu/Magisk.git
synced 2025-02-17 18:58:29 +00:00
More fixes, more breaks...
This commit is contained in:
parent
41a5639711
commit
8a8aaf3297
@ -32,9 +32,9 @@ repositories {
|
|||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
compile fileTree(include: ['*.jar'], dir: 'libs')
|
compile fileTree(include: ['*.jar'], dir: 'libs')
|
||||||
compile 'com.android.support:recyclerview-v7:24.2.1'
|
compile 'com.android.support:recyclerview-v7:24.2.0'
|
||||||
compile 'com.android.support:cardview-v7:24.2.1'
|
compile 'com.android.support:cardview-v7:24.2.0'
|
||||||
compile 'com.android.support:design:24.2.1'
|
compile 'com.android.support:design:24.2.0'
|
||||||
compile 'com.github.d8ahazard:BroadcastTileSupportUpdate:master'
|
compile 'com.github.d8ahazard:BroadcastTileSupportUpdate:master'
|
||||||
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'
|
||||||
|
@ -32,7 +32,7 @@
|
|||||||
android:resource="@xml/accessibilityservice"/>
|
android:resource="@xml/accessibilityservice"/>
|
||||||
</service>
|
</service>
|
||||||
<service
|
<service
|
||||||
android:name=".services.QuickSettingTileService"
|
android:name=".services.TileServiceNewApi"
|
||||||
android:icon="@drawable/ic_autoroot"
|
android:icon="@drawable/ic_autoroot"
|
||||||
android:label="@string/app_name"
|
android:label="@string/app_name"
|
||||||
android:permission="android.permission.BIND_QUICK_SETTINGS_TILE">
|
android:permission="android.permission.BIND_QUICK_SETTINGS_TILE">
|
||||||
|
@ -10,12 +10,15 @@ import android.os.Bundle;
|
|||||||
import android.preference.PreferenceManager;
|
import android.preference.PreferenceManager;
|
||||||
import android.support.annotation.Nullable;
|
import android.support.annotation.Nullable;
|
||||||
|
|
||||||
|
import android.util.Log;
|
||||||
|
import android.util.TypedValue;
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
import android.widget.ListView;
|
import android.widget.ListView;
|
||||||
|
|
||||||
import com.topjohnwu.magisk.utils.ApplicationAdapter;
|
import com.topjohnwu.magisk.utils.ApplicationAdapter;
|
||||||
|
import com.topjohnwu.magisk.utils.Logger;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
@ -34,7 +37,17 @@ 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) {
|
||||||
return 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 verticalMargin = (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, 2, getResources().getDisplayMetrics());
|
||||||
|
TypedValue tv = new TypedValue();
|
||||||
|
int actionBarHeight = 130;
|
||||||
|
if (getActivity().getTheme().resolveAttribute(android.R.attr.actionBarSize, tv, true)) {
|
||||||
|
actionBarHeight = TypedValue.complexToDimensionPixelSize(tv.data, getResources().getDisplayMetrics());
|
||||||
|
}
|
||||||
|
|
||||||
|
view.setPadding(horizontalMargin, actionBarHeight, horizontalMargin, verticalMargin);
|
||||||
|
return view;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -44,6 +57,7 @@ public class AutoRootFragment extends ListFragment {
|
|||||||
packageManager = getActivity().getPackageManager();
|
packageManager = getActivity().getPackageManager();
|
||||||
prefs = PreferenceManager.getDefaultSharedPreferences(getActivity());
|
prefs = PreferenceManager.getDefaultSharedPreferences(getActivity());
|
||||||
if (!prefs.contains("auto_blacklist")) {
|
if (!prefs.contains("auto_blacklist")) {
|
||||||
|
Logger.dh("AutoRootFragment: Setting default preferences for application");
|
||||||
SharedPreferences.Editor editor = prefs.edit();
|
SharedPreferences.Editor editor = prefs.edit();
|
||||||
Set<String> set = new HashSet<>();
|
Set<String> set = new HashSet<>();
|
||||||
set.add("com.google.android.apps.walletnfcrel");
|
set.add("com.google.android.apps.walletnfcrel");
|
||||||
@ -63,6 +77,7 @@ public class AutoRootFragment extends ListFragment {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onListItemClick(ListView l, View v, int position, long id) {
|
public void onListItemClick(ListView l, View v, int position, long id) {
|
||||||
|
Logger.dh("Click");
|
||||||
super.onListItemClick(l, v, position, id);
|
super.onListItemClick(l, v, position, id);
|
||||||
ApplicationInfo app = applist.get(position);
|
ApplicationInfo app = applist.get(position);
|
||||||
ToggleApp(app.packageName, position, v);
|
ToggleApp(app.packageName, position, v);
|
||||||
@ -70,10 +85,8 @@ public class AutoRootFragment extends ListFragment {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void ToggleApp(String appToCheck, int position, View v) {
|
private void ToggleApp(String appToCheck, int position, View v) {
|
||||||
|
Logger.dh("Magisk","AutoRootFragment: ToggleApp called for " + appToCheck);
|
||||||
Set<String> blackListSet = prefs.getStringSet("auto_blacklist", null);
|
Set<String> blackListSet = prefs.getStringSet("auto_blacklist", null);
|
||||||
|
|
||||||
|
|
||||||
assert blackListSet != null;
|
assert blackListSet != null;
|
||||||
arrayBlackList = new ArrayList<>(blackListSet);
|
arrayBlackList = new ArrayList<>(blackListSet);
|
||||||
|
|
||||||
@ -88,7 +101,10 @@ public class AutoRootFragment extends ListFragment {
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
prefs.edit().putStringSet("auto_blacklist", new HashSet<>(arrayBlackList)).apply();
|
Logger.dh("Committing set, value is: " + arrayBlackList.toString());
|
||||||
|
SharedPreferences.Editor editor = prefs.edit();
|
||||||
|
editor.putStringSet("auto_blacklist", new HashSet<>(arrayBlackList));
|
||||||
|
editor.apply();
|
||||||
listadaptor.UpdateRootStatusView(position, v);
|
listadaptor.UpdateRootStatusView(position, v);
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -113,7 +129,7 @@ public class AutoRootFragment extends ListFragment {
|
|||||||
@Override
|
@Override
|
||||||
public int compare(ApplicationInfo o1, ApplicationInfo o2) {
|
public int compare(ApplicationInfo o1, ApplicationInfo o2) {
|
||||||
packageManager = getActivity().getPackageManager();
|
packageManager = getActivity().getPackageManager();
|
||||||
return o1.loadLabel(packageManager).toString().compareTo(o2.loadLabel(packageManager).toString());
|
return o1.loadLabel(packageManager).toString().compareToIgnoreCase(o2.loadLabel(packageManager).toString());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,10 +1,7 @@
|
|||||||
package com.topjohnwu.magisk;
|
package com.topjohnwu.magisk;
|
||||||
|
|
||||||
import android.app.Activity;
|
import android.app.Fragment;
|
||||||
import android.content.BroadcastReceiver;
|
|
||||||
import android.content.Context;
|
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.content.IntentFilter;
|
|
||||||
import android.content.SharedPreferences;
|
import android.content.SharedPreferences;
|
||||||
import android.graphics.Color;
|
import android.graphics.Color;
|
||||||
import android.graphics.PorterDuff;
|
import android.graphics.PorterDuff;
|
||||||
@ -12,8 +9,7 @@ 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.app.Fragment;
|
import android.support.design.widget.Snackbar;
|
||||||
import android.support.v4.content.LocalBroadcastManager;
|
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
@ -23,11 +19,10 @@ import android.widget.ImageView;
|
|||||||
import android.widget.ProgressBar;
|
import android.widget.ProgressBar;
|
||||||
import android.widget.Switch;
|
import android.widget.Switch;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
import android.widget.Toast;
|
|
||||||
|
|
||||||
import com.topjohnwu.magisk.receivers.Receiver;
|
import com.topjohnwu.magisk.receivers.Receiver;
|
||||||
import com.topjohnwu.magisk.receivers.RootFragmentReceiver;
|
|
||||||
import com.topjohnwu.magisk.services.MonitorService;
|
import com.topjohnwu.magisk.services.MonitorService;
|
||||||
|
import com.topjohnwu.magisk.utils.PrefHelper;
|
||||||
import com.topjohnwu.magisk.utils.Shell;
|
import com.topjohnwu.magisk.utils.Shell;
|
||||||
import com.topjohnwu.magisk.utils.Utils;
|
import com.topjohnwu.magisk.utils.Utils;
|
||||||
|
|
||||||
@ -91,21 +86,22 @@ public class RootFragment extends Fragment implements Receiver{
|
|||||||
int statusUnknown = R.drawable.ic_help;
|
int statusUnknown = R.drawable.ic_help;
|
||||||
|
|
||||||
private boolean autoRootStatus;
|
private boolean autoRootStatus;
|
||||||
|
private View view;
|
||||||
|
|
||||||
@Nullable
|
@Nullable
|
||||||
@Override
|
@Override
|
||||||
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
|
public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
|
||||||
View view = inflater.inflate(R.layout.root_fragment, container, false);
|
view = inflater.inflate(R.layout.root_fragment, container, false);
|
||||||
ButterKnife.bind(this, view);
|
ButterKnife.bind(this, view);
|
||||||
prefs = PreferenceManager.getDefaultSharedPreferences(getActivity());
|
prefs = PreferenceManager.getDefaultSharedPreferences(getActivity());
|
||||||
|
|
||||||
if (prefs.contains("autoRootEnable")) {
|
|
||||||
autoRootStatus = prefs.getBoolean("autoRootEnable", false);
|
autoRootStatus = prefs.getBoolean("autoRootEnable", false);
|
||||||
rootToggle.setEnabled(false);
|
|
||||||
} else {
|
if (autoRootStatus) {
|
||||||
|
if (!Utils.hasServicePermission(getActivity())) {
|
||||||
autoRootStatus = false;
|
autoRootStatus = false;
|
||||||
rootToggle.setEnabled(true);
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
rootToggle.setEnabled(!autoRootStatus);
|
||||||
autoRootToggle.setChecked(autoRootStatus);
|
autoRootToggle.setChecked(autoRootStatus);
|
||||||
new updateUI().execute();
|
new updateUI().execute();
|
||||||
|
|
||||||
@ -115,10 +111,15 @@ public class RootFragment extends Fragment implements Receiver{
|
|||||||
});
|
});
|
||||||
|
|
||||||
autoRootToggle.setOnClickListener(toggle -> {
|
autoRootToggle.setOnClickListener(toggle -> {
|
||||||
|
if (!Utils.hasServicePermission(getActivity())) {
|
||||||
|
Intent intent = new Intent(android.provider.Settings.ACTION_ACCESSIBILITY_SETTINGS);
|
||||||
|
startActivityForResult(intent, 100);
|
||||||
|
} else {
|
||||||
ToggleAutoRoot(autoRootToggle.isChecked());
|
ToggleAutoRoot(autoRootToggle.isChecked());
|
||||||
new updateUI().execute();
|
|
||||||
|
|
||||||
});
|
}
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
selinuxToggle.setOnClickListener(toggle -> {
|
selinuxToggle.setOnClickListener(toggle -> {
|
||||||
Shell.su(((CompoundButton) toggle).isChecked() ? "setenforce 1" : "setenforce 0");
|
Shell.su(((CompoundButton) toggle).isChecked() ? "setenforce 1" : "setenforce 0");
|
||||||
@ -147,14 +148,12 @@ public class RootFragment extends Fragment implements Receiver{
|
|||||||
// Check which request we're responding to
|
// Check which request we're responding to
|
||||||
Log.d("Magisk", "Got result: " + requestCode + " and " + resultCode);
|
Log.d("Magisk", "Got result: " + requestCode + " and " + resultCode);
|
||||||
if (requestCode == 100) {
|
if (requestCode == 100) {
|
||||||
// Make sure the request was successful
|
if (Utils.hasServicePermission(getActivity())) {
|
||||||
if (resultCode == Activity.RESULT_OK) {
|
|
||||||
Log.d("Magisk", "Got result code OK for permissions");
|
Log.d("Magisk", "Got result code OK for permissions");
|
||||||
|
ToggleAutoRoot(true);
|
||||||
} else {
|
} else {
|
||||||
autoRootToggle.setEnabled(false);
|
autoRootToggle.setChecked(false);
|
||||||
Toast.makeText(getActivity(), "Auto-root disabled, permissions required.", Toast.LENGTH_LONG).show();
|
Snackbar.make(view, "Auto-root disabled, permissions required.", Snackbar.LENGTH_LONG).show();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
} else if (requestCode == 420) {
|
} else if (requestCode == 420) {
|
||||||
@ -169,10 +168,6 @@ public class RootFragment extends Fragment implements Receiver{
|
|||||||
editor.putBoolean("autoRootEnable", (toggleState));
|
editor.putBoolean("autoRootEnable", (toggleState));
|
||||||
editor.apply();
|
editor.apply();
|
||||||
if (toggleState) {
|
if (toggleState) {
|
||||||
if (!Utils.hasServicePermission(getActivity())) {
|
|
||||||
Intent intent = new Intent(android.provider.Settings.ACTION_ACCESSIBILITY_SETTINGS);
|
|
||||||
startActivityForResult(intent, 100);
|
|
||||||
}
|
|
||||||
Intent myIntent = new Intent(getActivity(), MonitorService.class);
|
Intent myIntent = new Intent(getActivity(), MonitorService.class);
|
||||||
getActivity().startService(myIntent);
|
getActivity().startService(myIntent);
|
||||||
rootToggle.setEnabled(false);
|
rootToggle.setEnabled(false);
|
||||||
@ -187,6 +182,8 @@ public class RootFragment extends Fragment implements Receiver{
|
|||||||
rootToggle.setEnabled(true);
|
rootToggle.setEnabled(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
new updateUI().execute();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -206,6 +203,10 @@ public class RootFragment extends Fragment implements Receiver{
|
|||||||
protected Void doInBackground(Void... voids) {
|
protected Void doInBackground(Void... voids) {
|
||||||
// Make sure static block invoked
|
// Make sure static block invoked
|
||||||
Shell.rootAccess();
|
Shell.rootAccess();
|
||||||
|
// Set up Tile on UI Refresh
|
||||||
|
if (PrefHelper.CheckBool("enable_quicktile",getActivity())) {
|
||||||
|
Utils.SetupQuickSettingsTile(getActivity());
|
||||||
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -114,6 +114,12 @@ public class WelcomeActivity extends AppCompatActivity implements NavigationView
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void onDestroy() {
|
||||||
|
super.onDestroy();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onSaveInstanceState(Bundle outState) {
|
protected void onSaveInstanceState(Bundle outState) {
|
||||||
super.onSaveInstanceState(outState);
|
super.onSaveInstanceState(outState);
|
||||||
|
@ -15,10 +15,10 @@ public class AutoStartReceiver extends BroadcastReceiver {
|
|||||||
Log.d("Magisk", "Received Boot call, attempting to start service");
|
Log.d("Magisk", "Received Boot call, attempting to start service");
|
||||||
Intent myIntent = new Intent(context, MonitorService.class);
|
Intent myIntent = new Intent(context, MonitorService.class);
|
||||||
context.startService(myIntent);
|
context.startService(myIntent);
|
||||||
if (PrefHelper.CheckBool("keep_root_off")) {
|
if (PrefHelper.CheckBool("keep_root_off",context)) {
|
||||||
Utils.toggleRoot(false);
|
Utils.toggleRoot(false);
|
||||||
}
|
}
|
||||||
if (PrefHelper.CheckBool("enable_quicktile")) {
|
if (PrefHelper.CheckBool("enable_quicktile",context)) {
|
||||||
Utils.SetupQuickSettingsTile(context);
|
Utils.SetupQuickSettingsTile(context);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -5,7 +5,7 @@ import android.content.Context;
|
|||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
|
|
||||||
import com.topjohnwu.magisk.services.TileService;
|
import com.topjohnwu.magisk.services.TileServiceCompat;
|
||||||
|
|
||||||
public class TileReceiver extends BroadcastReceiver {
|
public class TileReceiver extends BroadcastReceiver {
|
||||||
private static final String TAG = "MainReceiver";
|
private static final String TAG = "MainReceiver";
|
||||||
@ -18,7 +18,7 @@ public class TileReceiver extends BroadcastReceiver {
|
|||||||
String action = intent.getAction();
|
String action = intent.getAction();
|
||||||
|
|
||||||
if (action.equals(Intent.ACTION_BOOT_COMPLETED) || action.equals(Intent.ACTION_USER_PRESENT) || action.equals(Intent.ACTION_SCREEN_ON)) {
|
if (action.equals(Intent.ACTION_BOOT_COMPLETED) || action.equals(Intent.ACTION_USER_PRESENT) || action.equals(Intent.ACTION_SCREEN_ON)) {
|
||||||
context.startService(new Intent(context,TileService.class));
|
context.startService(new Intent(context,TileServiceCompat.class));
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -18,6 +18,7 @@ import android.view.accessibility.AccessibilityEvent;
|
|||||||
|
|
||||||
import com.topjohnwu.magisk.R;
|
import com.topjohnwu.magisk.R;
|
||||||
import com.topjohnwu.magisk.WelcomeActivity;
|
import com.topjohnwu.magisk.WelcomeActivity;
|
||||||
|
import com.topjohnwu.magisk.utils.Logger;
|
||||||
import com.topjohnwu.magisk.utils.PrefHelper;
|
import com.topjohnwu.magisk.utils.PrefHelper;
|
||||||
import com.topjohnwu.magisk.utils.Utils;
|
import com.topjohnwu.magisk.utils.Utils;
|
||||||
|
|
||||||
@ -50,6 +51,12 @@ public class MonitorService extends AccessibilityService {
|
|||||||
Log.d("Magisk", "MonitorService: Service created");
|
Log.d("Magisk", "MonitorService: Service created");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onDestroy() {
|
||||||
|
super.onDestroy();
|
||||||
|
Log.d("Magisk", "MonitorService: Service destroyed");
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onAccessibilityEvent(AccessibilityEvent event) {
|
public void onAccessibilityEvent(AccessibilityEvent event) {
|
||||||
if (event.getEventType() == AccessibilityEvent.TYPE_WINDOW_STATE_CHANGED) {
|
if (event.getEventType() == AccessibilityEvent.TYPE_WINDOW_STATE_CHANGED) {
|
||||||
@ -71,11 +78,7 @@ public class MonitorService extends AccessibilityService {
|
|||||||
|
|
||||||
if (setBlackList != null) {
|
if (setBlackList != null) {
|
||||||
disableroot = setBlackList.contains(mPackage);
|
disableroot = setBlackList.contains(mPackage);
|
||||||
if (disableroot) {
|
ForceRoot(!disableroot);
|
||||||
ForceDisableRoot();
|
|
||||||
} else {
|
|
||||||
ForceEnableRoot();
|
|
||||||
}
|
|
||||||
String appFriendly = getAppName(mPackage);
|
String appFriendly = getAppName(mPackage);
|
||||||
ShowNotification(disableroot, appFriendly);
|
ShowNotification(disableroot, appFriendly);
|
||||||
}
|
}
|
||||||
@ -105,14 +108,18 @@ public class MonitorService extends AccessibilityService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void ForceDisableRoot() {
|
private void ForceRoot(Boolean rootToggle) {
|
||||||
Log.d("Magisk", "MonitorService: Forcedisable called.");
|
|
||||||
Utils.toggleRoot(false);
|
String rootString = rootToggle ? "on" : "off";
|
||||||
if (Utils.rootEnabled()) {
|
if (Utils.rootEnabled() != rootToggle) {
|
||||||
Utils.toggleRoot(false);
|
Logger.dh("MonitorService: toggling root " + rootString);
|
||||||
Log.d(TAG, "MonitorService: FORCING.");
|
Utils.toggleRoot(rootToggle);
|
||||||
|
if (Utils.rootEnabled() != rootToggle) {
|
||||||
|
Utils.toggleRoot(rootToggle);
|
||||||
|
Logger.dh("MonitorService: FORCING to " + rootString);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
Log.d("Magisk", "MonitorService: Forcedisable called. " + Utils.rootEnabled());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void ForceEnableRoot() {
|
private void ForceEnableRoot() {
|
||||||
@ -126,7 +133,7 @@ public class MonitorService extends AccessibilityService {
|
|||||||
private void ShowNotification(boolean rootAction, String packageName) {
|
private void ShowNotification(boolean rootAction, String packageName) {
|
||||||
NotificationManager mNotifyMgr = (NotificationManager) getSystemService(NOTIFICATION_SERVICE);
|
NotificationManager mNotifyMgr = (NotificationManager) getSystemService(NOTIFICATION_SERVICE);
|
||||||
NotificationCompat.Builder mBuilder;
|
NotificationCompat.Builder mBuilder;
|
||||||
if (!PrefHelper.CheckBool("hide_root_notification")) {
|
if (!PrefHelper.CheckBool("hide_root_notification", getApplicationContext())) {
|
||||||
if (rootAction) {
|
if (rootAction) {
|
||||||
|
|
||||||
Intent intent = new Intent(getApplication(), WelcomeActivity.class);
|
Intent intent = new Intent(getApplication(), WelcomeActivity.class);
|
||||||
|
@ -16,10 +16,9 @@ import com.topjohnwu.magisk.utils.Utils;
|
|||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
public class TileService extends Service {
|
public class TileServiceCompat extends Service {
|
||||||
private static BroadcastReceiver clickTileReceiver;
|
private static BroadcastReceiver clickTileReceiver;
|
||||||
|
|
||||||
private static boolean running = false;
|
|
||||||
private static boolean root, autoRoot;
|
private static boolean root, autoRoot;
|
||||||
|
|
||||||
public static final String TILE_ID = "com.shovelgrill.magiskmmtile.TILE";
|
public static final String TILE_ID = "com.shovelgrill.magiskmmtile.TILE";
|
||||||
@ -29,7 +28,7 @@ public class TileService extends Service {
|
|||||||
public static final int CLICK_TYPE_SIMPLE = 0;
|
public static final int CLICK_TYPE_SIMPLE = 0;
|
||||||
public static final int CLICK_TYPE_LONG = 1;
|
public static final int CLICK_TYPE_LONG = 1;
|
||||||
|
|
||||||
public TileService() {
|
public TileServiceCompat() {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -40,7 +39,6 @@ public class TileService extends Service {
|
|||||||
@Override
|
@Override
|
||||||
public void onCreate() {
|
public void onCreate() {
|
||||||
super.onCreate();
|
super.onCreate();
|
||||||
running = true;
|
|
||||||
root = true;
|
root = true;
|
||||||
registerClickTileReceiver();
|
registerClickTileReceiver();
|
||||||
}
|
}
|
||||||
@ -82,7 +80,7 @@ public class TileService extends Service {
|
|||||||
private void onLongClick() {
|
private void onLongClick() {
|
||||||
Intent it = new Intent(Intent.ACTION_CLOSE_SYSTEM_DIALOGS);
|
Intent it = new Intent(Intent.ACTION_CLOSE_SYSTEM_DIALOGS);
|
||||||
sendBroadcast(it);
|
sendBroadcast(it);
|
||||||
openApp(this,"com.topjohnwu.magisk");
|
Utils.toggleAutoRoot(!Utils.autoRootEnabled(getApplicationContext()),getApplicationContext());
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean openApp(Context context, String packageName) {
|
public static boolean openApp(Context context, String packageName) {
|
||||||
@ -133,7 +131,6 @@ public class TileService extends Service {
|
|||||||
public void onDestroy() {
|
public void onDestroy() {
|
||||||
super.onDestroy();
|
super.onDestroy();
|
||||||
unregisterReceiver(clickTileReceiver);
|
unregisterReceiver(clickTileReceiver);
|
||||||
running = false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
@ -1,75 +1,92 @@
|
|||||||
package com.topjohnwu.magisk.services;
|
package com.topjohnwu.magisk.services;
|
||||||
|
|
||||||
import android.annotation.SuppressLint;
|
import android.annotation.SuppressLint;
|
||||||
|
import android.content.SharedPreferences;
|
||||||
import android.graphics.drawable.Icon;
|
import android.graphics.drawable.Icon;
|
||||||
|
import android.preference.PreferenceManager;
|
||||||
import android.service.quicksettings.Tile;
|
import android.service.quicksettings.Tile;
|
||||||
import android.service.quicksettings.TileService;
|
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
|
|
||||||
import com.topjohnwu.magisk.R;
|
import com.topjohnwu.magisk.R;
|
||||||
|
import com.topjohnwu.magisk.utils.Logger;
|
||||||
import com.topjohnwu.magisk.utils.Utils;
|
import com.topjohnwu.magisk.utils.Utils;
|
||||||
|
|
||||||
@SuppressLint("NewApi")
|
@SuppressLint("NewApi")
|
||||||
public class QuickSettingTileService extends TileService {
|
public class TileServiceNewApi extends android.service.quicksettings.TileService implements
|
||||||
|
SharedPreferences.OnSharedPreferenceChangeListener {
|
||||||
private int STATE_CURRENT;
|
private int STATE_CURRENT;
|
||||||
|
|
||||||
public QuickSettingTileService() {
|
public TileServiceNewApi() {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onTileAdded() {
|
public void onTileAdded() {
|
||||||
super.onTileAdded();
|
super.onTileAdded();
|
||||||
setupState();
|
setupState();
|
||||||
|
this.getQsTile().updateTile();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onClick() {
|
public void onClick() {
|
||||||
switchState();
|
switchState();
|
||||||
|
this.getQsTile().updateTile();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setupState() {
|
private void setupState() {
|
||||||
|
SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(getApplicationContext());
|
||||||
|
preferences.registerOnSharedPreferenceChangeListener(this);
|
||||||
|
Logger.dh("TileService(New): SetupState");
|
||||||
Icon iconRoot = Icon.createWithResource(getApplicationContext(), R.drawable.root);
|
Icon iconRoot = Icon.createWithResource(getApplicationContext(), R.drawable.root);
|
||||||
Icon iconAuto = Icon.createWithResource(getApplicationContext(), R.drawable.ic_autoroot);
|
Icon iconAuto = Icon.createWithResource(getApplicationContext(), R.drawable.ic_autoroot);
|
||||||
Tile tile = this.getQsTile();
|
Tile tile = this.getQsTile();
|
||||||
boolean autoRootStatus = Utils.autoRootEnabled(getApplicationContext());
|
boolean autoRootStatus = Utils.autoRootEnabled(getApplicationContext());
|
||||||
boolean rootStatus = Utils.rootEnabled();
|
boolean rootStatus = Utils.rootEnabled();
|
||||||
Log.d("Magisk", "QST: Auto and root are " + autoRootStatus + " and " + rootStatus);
|
int rootsStatus = Utils.CheckRootsState(getApplicationContext());
|
||||||
if (autoRootStatus) {
|
Log.d("Magisk", "QST: Auto and root are " + autoRootStatus + " and " + rootStatus + Utils.CheckRootsState(getApplicationContext()));
|
||||||
|
if (rootsStatus == 2) {
|
||||||
tile.setLabel("Auto-root");
|
tile.setLabel("Auto-root");
|
||||||
tile.setIcon(iconAuto);
|
tile.setIcon(iconAuto);
|
||||||
tile.setState(Tile.STATE_ACTIVE);
|
tile.setState(Tile.STATE_ACTIVE);
|
||||||
STATE_CURRENT = 0;
|
|
||||||
} else {
|
} else if (rootsStatus == 1) {
|
||||||
if (rootStatus) {
|
|
||||||
tile.setLabel("Root enabled");
|
tile.setLabel("Root enabled");
|
||||||
tile.setIcon(iconRoot);
|
tile.setIcon(iconRoot);
|
||||||
tile.setState(Tile.STATE_ACTIVE);
|
tile.setState(Tile.STATE_ACTIVE);
|
||||||
STATE_CURRENT = 1;
|
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
tile.setLabel("Root disabled");
|
tile.setLabel("Root disabled");
|
||||||
tile.setIcon(iconRoot);
|
tile.setIcon(iconRoot);
|
||||||
tile.setState(Tile.STATE_INACTIVE);
|
tile.setState(Tile.STATE_INACTIVE);
|
||||||
STATE_CURRENT = 2;
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
tile.updateTile();
|
tile.updateTile();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void onSharedPreferenceChanged(SharedPreferences sharedPreferences,String key)
|
||||||
|
{
|
||||||
|
Logger.dh("TileService: Key Change registered for " + key);
|
||||||
|
if (key.equals("autoRootEnable")) {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private void switchState() {
|
private void switchState() {
|
||||||
Log.d("Magisk", "QST: Switching state to " + STATE_CURRENT);
|
switch (Utils.CheckRootsState(getApplicationContext())) {
|
||||||
switch (STATE_CURRENT) {
|
case 2:
|
||||||
case 0:
|
Utils.toggleRoot(true);
|
||||||
Utils.toggleRoot(false);
|
|
||||||
Utils.toggleAutoRoot(false, getApplicationContext());
|
Utils.toggleAutoRoot(false, getApplicationContext());
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
Utils.toggleAutoRoot(true, getApplicationContext());
|
Utils.toggleRoot(false);
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 0:
|
||||||
Utils.toggleRoot(true);
|
Utils.toggleAutoRoot(true, getApplicationContext());
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
setupState();
|
setupState();
|
@ -15,7 +15,6 @@ import android.widget.TextView;
|
|||||||
|
|
||||||
import com.topjohnwu.magisk.R;
|
import com.topjohnwu.magisk.R;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
@ -23,7 +22,6 @@ public class ApplicationAdapter extends ArrayAdapter<ApplicationInfo> {
|
|||||||
private List<ApplicationInfo> appsList = null;
|
private List<ApplicationInfo> appsList = null;
|
||||||
private Context context;
|
private Context context;
|
||||||
private PackageManager packageManager;
|
private PackageManager packageManager;
|
||||||
public ArrayList arrayList;
|
|
||||||
public SharedPreferences prefs;
|
public SharedPreferences prefs;
|
||||||
|
|
||||||
public ApplicationAdapter(Context context, int textViewResourceId,
|
public ApplicationAdapter(Context context, int textViewResourceId,
|
||||||
@ -101,7 +99,6 @@ public class ApplicationAdapter extends ArrayAdapter<ApplicationInfo> {
|
|||||||
boolean starter = false;
|
boolean starter = false;
|
||||||
Set<String> set = prefs.getStringSet("auto_blacklist", null);
|
Set<String> set = prefs.getStringSet("auto_blacklist", null);
|
||||||
if (set != null) {
|
if (set != null) {
|
||||||
arrayList = new ArrayList<>(set);
|
|
||||||
for (String string : set) {
|
for (String string : set) {
|
||||||
if (string.equals(appToCheck)) {
|
if (string.equals(appToCheck)) {
|
||||||
starter = true;
|
starter = true;
|
||||||
|
@ -1,15 +1,21 @@
|
|||||||
package com.topjohnwu.magisk.utils;
|
package com.topjohnwu.magisk.utils;
|
||||||
|
|
||||||
|
import android.app.Application;
|
||||||
|
import android.content.Context;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public class Logger {
|
public class Logger {
|
||||||
|
|
||||||
private static final String LOG_TAG = "Magisk";
|
private static final String LOG_TAG = "Magisk: DH";
|
||||||
|
|
||||||
public static void dh(String msg, Object... args) {
|
public static void dh(String msg, Object... args) {
|
||||||
if (PrefHelper.CheckBool("developer_logging")) {
|
Context context = null;
|
||||||
|
try {
|
||||||
|
context = getApplicationUsingReflection();
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
if (PrefHelper.CheckBool("developer_logging", context)) {
|
||||||
if (args.length == 1 && args[0] instanceof Throwable) {
|
if (args.length == 1 && args[0] instanceof Throwable) {
|
||||||
Log.d(LOG_TAG, msg, (Throwable) args[0]);
|
Log.d(LOG_TAG, msg, (Throwable) args[0]);
|
||||||
} else {
|
} else {
|
||||||
@ -17,4 +23,9 @@ public class Logger {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static Application getApplicationUsingReflection() throws Exception {
|
||||||
|
return (Application) Class.forName("android.app.AppGlobals")
|
||||||
|
.getMethod("getInitialApplication").invoke(null, (Object[]) null);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -10,19 +10,11 @@ public class PrefHelper {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean CheckBool(String key) {
|
public static boolean CheckBool(String key, Context context) {
|
||||||
Context context = null;
|
|
||||||
try {
|
|
||||||
context = getApplicationUsingReflection();
|
|
||||||
} catch (Exception e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
return PreferenceManager.getDefaultSharedPreferences(context).getBoolean(key, false);
|
return PreferenceManager.getDefaultSharedPreferences(context).getBoolean(key, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static Application getApplicationUsingReflection() throws Exception {
|
|
||||||
return (Application) Class.forName("android.app.AppGlobals")
|
|
||||||
.getMethod("getInitialApplication").invoke(null, (Object[]) null);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -30,8 +30,8 @@ import com.topjohnwu.magisk.RootFragment;
|
|||||||
import com.topjohnwu.magisk.module.BaseModule;
|
import com.topjohnwu.magisk.module.BaseModule;
|
||||||
import com.topjohnwu.magisk.receivers.PrivateBroadcastReceiver;
|
import com.topjohnwu.magisk.receivers.PrivateBroadcastReceiver;
|
||||||
import com.topjohnwu.magisk.services.MonitorService;
|
import com.topjohnwu.magisk.services.MonitorService;
|
||||||
import com.topjohnwu.magisk.services.QuickSettingTileService;
|
import com.topjohnwu.magisk.services.TileServiceNewApi;
|
||||||
import com.topjohnwu.magisk.services.TileService;
|
import com.topjohnwu.magisk.services.TileServiceCompat;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.UnsupportedEncodingException;
|
import java.io.UnsupportedEncodingException;
|
||||||
@ -71,10 +71,10 @@ public class Utils {
|
|||||||
if (!Shell.rootAccess()) {
|
if (!Shell.rootAccess()) {
|
||||||
Snackbar.make(((Activity) context).findViewById(android.R.id.content), R.string.no_root_access, Snackbar.LENGTH_LONG).show();
|
Snackbar.make(((Activity) context).findViewById(android.R.id.content), R.string.no_root_access, Snackbar.LENGTH_LONG).show();
|
||||||
}
|
}
|
||||||
if (PrefHelper.CheckBool("keep_root_off")) {
|
if (PrefHelper.CheckBool("keep_root_off",context)) {
|
||||||
Utils.toggleRoot(false);
|
Utils.toggleRoot(false);
|
||||||
}
|
}
|
||||||
if (PrefHelper.CheckBool("enable_quicktile")) {
|
if (PrefHelper.CheckBool("enable_quicktile",context)) {
|
||||||
Utils.SetupQuickSettingsTile(context);
|
Utils.SetupQuickSettingsTile(context);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -129,6 +129,7 @@ public class Utils {
|
|||||||
} else {
|
} else {
|
||||||
Shell.su("rm -rf /magisk/.core/bin", "setprop magisk.root 0");
|
Shell.su("rm -rf /magisk/.core/bin", "setprop magisk.root 0");
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -212,7 +213,7 @@ public class Utils {
|
|||||||
public static void SetupQuickSettingsTile(Context mContext) {
|
public static void SetupQuickSettingsTile(Context mContext) {
|
||||||
Logger.dh("Utils: SetupQuickSettings called");
|
Logger.dh("Utils: SetupQuickSettings called");
|
||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
|
||||||
Intent serviceIntent = new Intent(mContext, QuickSettingTileService.class);
|
Intent serviceIntent = new Intent(mContext, TileServiceNewApi.class);
|
||||||
mContext.startService(serviceIntent);
|
mContext.startService(serviceIntent);
|
||||||
}
|
}
|
||||||
if (Build.VERSION.SDK_INT == Build.VERSION_CODES.M) {
|
if (Build.VERSION.SDK_INT == Build.VERSION_CODES.M) {
|
||||||
@ -266,7 +267,7 @@ public class Utils {
|
|||||||
|
|
||||||
public static void installTile(Context context) {
|
public static void installTile(Context context) {
|
||||||
|
|
||||||
String qsTileId = "intent(" + TileService.TILE_ID + ")";
|
String qsTileId = "intent(" + TileServiceCompat.TILE_ID + ")";
|
||||||
List<String> lines = Shell.su("settings get secure sysui_qs_tiles");
|
List<String> lines = Shell.su("settings get secure sysui_qs_tiles");
|
||||||
if (lines != null && lines.size() == 1) {
|
if (lines != null && lines.size() == 1) {
|
||||||
List<String> tiles = new LinkedList<String>(Arrays.asList(lines.get(0).split(",")));
|
List<String> tiles = new LinkedList<String>(Arrays.asList(lines.get(0).split(",")));
|
||||||
@ -289,7 +290,7 @@ public class Utils {
|
|||||||
|
|
||||||
public static void uninstallTile(Context context) {
|
public static void uninstallTile(Context context) {
|
||||||
|
|
||||||
String qsTileId = "intent(" + TileService.TILE_ID + ")";
|
String qsTileId = "intent(" + TileServiceCompat.TILE_ID + ")";
|
||||||
List<String> lines = Shell.su("settings get secure sysui_qs_tiles");
|
List<String> lines = Shell.su("settings get secure sysui_qs_tiles");
|
||||||
if (lines != null && lines.size() == 1) {
|
if (lines != null && lines.size() == 1) {
|
||||||
List<String> tiles = new LinkedList<String>(Arrays.asList(lines.get(0).split(",")));
|
List<String> tiles = new LinkedList<String>(Arrays.asList(lines.get(0).split(",")));
|
||||||
@ -318,7 +319,7 @@ public class Utils {
|
|||||||
|
|
||||||
|
|
||||||
private void refreshService(Context context) {
|
private void refreshService(Context context) {
|
||||||
context.startService(new Intent(context, TileService.class));
|
context.startService(new Intent(context, TileServiceCompat.class));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -448,7 +449,7 @@ public class Utils {
|
|||||||
public static class ModuleComparator implements Comparator<BaseModule> {
|
public static class ModuleComparator implements Comparator<BaseModule> {
|
||||||
@Override
|
@Override
|
||||||
public int compare(BaseModule o1, BaseModule o2) {
|
public int compare(BaseModule o1, BaseModule o2) {
|
||||||
return o1.getName().compareTo(o2.getName());
|
return o1.getName().compareToIgnoreCase(o2.getName());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
<android.support.v7.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android"
|
<android.support.v7.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:card_view="http://schemas.android.com/apk/res-auto"
|
xmlns:card_view="http://schemas.android.com/apk/res-auto"
|
||||||
|
style="@style/Base.CardView"
|
||||||
android:layout_width="fill_parent"
|
android:layout_width="fill_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_gravity="center"
|
android:layout_gravity="center"
|
||||||
@ -9,15 +10,14 @@
|
|||||||
android:layout_marginLeft="8dip"
|
android:layout_marginLeft="8dip"
|
||||||
android:layout_marginRight="8dip"
|
android:layout_marginRight="8dip"
|
||||||
android:layout_marginTop="3dip"
|
android:layout_marginTop="3dip"
|
||||||
android:background="?android:attr/selectableItemBackground"
|
|
||||||
|
|
||||||
|
android:background="?android:attr/selectableItemBackground"
|
||||||
card_view:cardCornerRadius="2dp"
|
card_view:cardCornerRadius="2dp"
|
||||||
card_view:cardElevation="2dp"
|
card_view:cardElevation="2dp">
|
||||||
style="@style/Base.CardView">
|
|
||||||
|
|
||||||
<RelativeLayout
|
<RelativeLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="fill_parent"
|
||||||
android:layout_gravity="center_vertical"
|
android:layout_gravity="center_vertical"
|
||||||
android:padding="10dp">
|
android:padding="10dp">
|
||||||
|
|
||||||
@ -29,41 +29,57 @@
|
|||||||
|
|
||||||
android:scaleType="centerCrop"/>
|
android:scaleType="centerCrop"/>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/textLayout"
|
||||||
|
android:layout_width="fill_parent"
|
||||||
|
android:layout_height="fill_parent"
|
||||||
|
android:orientation="vertical"
|
||||||
|
android:paddingEnd="50dp"
|
||||||
|
android:paddingStart="65dp"
|
||||||
|
android:gravity="center_horizontal"
|
||||||
|
android:layout_alignBottom="@+id/app_icon"
|
||||||
|
android:weightSum="1">
|
||||||
|
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/app_name"
|
android:id="@+id/app_name"
|
||||||
android:layout_width="fill_parent"
|
android:layout_width="fill_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_alignParentEnd="true"
|
android:layout_alignParentEnd="false"
|
||||||
android:layout_toEndOf="@+id/app_icon"
|
|
||||||
android:gravity="center_vertical"
|
|
||||||
android:paddingEnd="3dp"
|
android:paddingEnd="3dp"
|
||||||
android:paddingStart="3dp"
|
android:paddingStart="3dp"
|
||||||
android:textStyle="bold" />
|
android:textStyle="bold"
|
||||||
|
android:layout_weight="1"/>
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
android:id="@+id/app_paackage"
|
android:id="@+id/app_paackage"
|
||||||
android:layout_width="fill_parent"
|
android:layout_width="fill_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="25dp"
|
||||||
android:layout_alignParentEnd="true"
|
|
||||||
android:layout_below="@+id/app_name"
|
|
||||||
android:layout_toEndOf="@+id/app_icon"
|
|
||||||
android:gravity="center_vertical"
|
android:gravity="center_vertical"
|
||||||
android:paddingEnd="3dp"
|
android:paddingEnd="3dp"
|
||||||
android:paddingStart="3dp" />
|
android:paddingStart="3dp"
|
||||||
|
android:maxLines="1"
|
||||||
|
android:marqueeRepeatLimit ="marquee_forever"
|
||||||
|
android:ellipsize="marquee"/>
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
|
<LinearLayout
|
||||||
|
android:id="@+id/Linear"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_alignParentEnd="true"
|
||||||
|
android:layout_centerVertical="true">
|
||||||
|
|
||||||
<CheckBox
|
<CheckBox
|
||||||
android:id="@+id/checkbox"
|
android:id="@+id/checkbox"
|
||||||
android:layout_width="68dp"
|
android:layout_width="wrap_content"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_alignParentEnd="true"
|
android:clickable="false"
|
||||||
android:layout_centerVertical="true"
|
|
||||||
android:focusable="false"
|
android:focusable="false"
|
||||||
android:gravity="center"
|
android:gravity="center"
|
||||||
android:src="@drawable/ic_menu_overflow_material"
|
android:src="@drawable/ic_menu_overflow_material"
|
||||||
/>
|
/>
|
||||||
|
</LinearLayout>
|
||||||
|
|
||||||
</RelativeLayout>
|
</RelativeLayout>
|
||||||
|
|
||||||
|
@ -1,13 +1,12 @@
|
|||||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
android:layout_width="fill_parent"
|
android:layout_width="fill_parent"
|
||||||
android:layout_height="fill_parent"
|
android:layout_height="fill_parent"
|
||||||
android:orientation="vertical" >
|
android:orientation="vertical"
|
||||||
|
android:id="@+id/Top">
|
||||||
|
|
||||||
<ListView android:id="@android:id/list"
|
<ListView android:id="@android:id/list"
|
||||||
android:paddingTop="5dip"
|
|
||||||
android:paddingBottom="5dip"
|
|
||||||
android:divider="@android:color/transparent"
|
android:divider="@android:color/transparent"
|
||||||
android:dividerHeight="10.0sp"
|
android:dividerHeight="5.0sp"
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:layout_margin="15dp"/>
|
android:layout_margin="15dp"/>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user