1
0
mirror of https://github.com/NekoX-Dev/NekoX.git synced 2024-12-04 07:10:17 +01:00

Remove call permissions

This commit is contained in:
Riko Sakurauchi 2019-12-11 00:17:36 +08:00
parent e1205b57c8
commit a915cd8013
No known key found for this signature in database
GPG Key ID: 25AC0345B92902AF
3 changed files with 14 additions and 19 deletions

View File

@ -14,9 +14,7 @@
<uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES"/>
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.CALL_PHONE" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
<uses-permission android:name="android.permission.READ_CALL_LOG" />
<permission android:name="tw.nekomimi.nekogram.permission.MAPS_RECEIVE" android:protectionLevel="signature"/>

View File

@ -14,9 +14,7 @@
<uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES"/>
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.CALL_PHONE" />
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
<uses-permission android:name="android.permission.READ_CALL_LOG" />
<permission android:name="tw.nekomimi.nekogram.permission.MAPS_RECEIVE" android:protectionLevel="signature"/>

View File

@ -181,7 +181,7 @@ public class LoginActivity extends BaseFragment {
@Override
public View createView(Context context) {
actionBar.setTitle(LocaleController.getString("AppName", R.string.AppName));
actionBar.setTitle("\uD83D\uDE36 Nekogram");
actionBar.setActionBarMenuOnItemClick(new ActionBar.ActionBarMenuOnItemClick() {
@Override
public void onItemClick(int id) {
@ -191,7 +191,7 @@ public class LoginActivity extends BaseFragment {
return;
}
AlertDialog.Builder builder = new AlertDialog.Builder(getParentActivity());
builder.setTitle(LocaleController.getString("AppName", R.string.AppName));
builder.setTitle("\uD83D\uDE36 Nekogram");
builder.setMessage(LocaleController.getString("StopLoading", R.string.StopLoading));
builder.setPositiveButton(LocaleController.getString("WaitMore", R.string.WaitMore), null);
builder.setNegativeButton(LocaleController.getString("Stop", R.string.Stop), (dialogInterface, i) -> {
@ -517,7 +517,7 @@ public class LoginActivity extends BaseFragment {
@Override
protected void onDialogDismiss(Dialog dialog) {
if (Build.VERSION.SDK_INT >= 23) {
/*if (Build.VERSION.SDK_INT >= 23) {
if (dialog == permissionsDialog && !permissionsItems.isEmpty() && getParentActivity() != null) {
try {
getParentActivity().requestPermissions(permissionsItems.toArray(new String[0]), 6);
@ -531,7 +531,7 @@ public class LoginActivity extends BaseFragment {
}
}
}
}*/
}
@Override
@ -1264,7 +1264,7 @@ public class LoginActivity extends BaseFragment {
allowCall = getParentActivity().checkSelfPermission(Manifest.permission.READ_PHONE_STATE) == PackageManager.PERMISSION_GRANTED;
allowCancelCall = getParentActivity().checkSelfPermission(Manifest.permission.CALL_PHONE) == PackageManager.PERMISSION_GRANTED;
allowReadCallLog = Build.VERSION.SDK_INT < 28 || getParentActivity().checkSelfPermission(Manifest.permission.READ_CALL_LOG) == PackageManager.PERMISSION_GRANTED;
if (checkPermissions) {
/*if (checkPermissions) {
permissionsItems.clear();
if (!allowCall) {
permissionsItems.add(Manifest.permission.READ_PHONE_STATE);
@ -1302,18 +1302,17 @@ public class LoginActivity extends BaseFragment {
return;
}
}
}
}*/
}
if (countryState == 1) {
needShowAlert(LocaleController.getString("AppName", R.string.AppName), LocaleController.getString("ChooseCountry", R.string.ChooseCountry));
needShowAlert("\uD83D\uDE36 Nekogram", LocaleController.getString("ChooseCountry", R.string.ChooseCountry));
return;
} else if (countryState == 2 && !BuildVars.DEBUG_VERSION) {
needShowAlert(LocaleController.getString("AppName", R.string.AppName), LocaleController.getString("WrongCountry", R.string.WrongCountry));
needShowAlert("\uD83D\uDE36 Nekogram", LocaleController.getString("WrongCountry", R.string.WrongCountry));
return;
}
if (codeField.length() == 0) {
needShowAlert(LocaleController.getString("AppName", R.string.AppName), LocaleController.getString("InvalidPhoneNumber", R.string.InvalidPhoneNumber));
needShowAlert("\uD83D\uDE36 Nekogram", LocaleController.getString("InvalidPhoneNumber", R.string.InvalidPhoneNumber));
return;
}
String phone = PhoneFormat.stripExceptNumbers("" + codeField.getText() + phoneField.getText());
@ -1327,7 +1326,7 @@ public class LoginActivity extends BaseFragment {
if (PhoneNumberUtils.compare(phone, userPhone)) {
final int num = a;
AlertDialog.Builder builder = new AlertDialog.Builder(getParentActivity());
builder.setTitle(LocaleController.getString("AppName", R.string.AppName));
builder.setTitle("\uD83D\uDE36 Nekogram");
builder.setMessage(LocaleController.getString("AccountAlreadyLoggedIn", R.string.AccountAlreadyLoggedIn));
builder.setPositiveButton(LocaleController.getString("AccountSwitch", R.string.AccountSwitch), (dialog, which) -> {
if (UserConfig.selectedAccount != num) {
@ -1423,7 +1422,7 @@ public class LoginActivity extends BaseFragment {
boolean allowCall = true;
if (Build.VERSION.SDK_INT >= 23) {
allowCall = getParentActivity().checkSelfPermission(Manifest.permission.READ_PHONE_STATE) == PackageManager.PERMISSION_GRANTED;
if (checkShowPermissions && !allowCall) {
/*if (checkShowPermissions && !allowCall) {
permissionsShowItems.clear();
if (!allowCall) {
permissionsShowItems.add(Manifest.permission.READ_PHONE_STATE);
@ -1442,7 +1441,7 @@ public class LoginActivity extends BaseFragment {
}
}
return;
}
}*/
}
if (!newAccount && allowCall) {
String number = PhoneFormat.stripExceptNumbers(tm.getLine1Number());
@ -2277,7 +2276,7 @@ public class LoginActivity extends BaseFragment {
public boolean onBackPressed(boolean force) {
if (!force) {
AlertDialog.Builder builder = new AlertDialog.Builder(getParentActivity());
builder.setTitle(LocaleController.getString("AppName", R.string.AppName));
builder.setTitle("\uD83D\uDE36 Nekogram");
builder.setMessage(LocaleController.getString("StopVerification", R.string.StopVerification));
builder.setPositiveButton(LocaleController.getString("Continue", R.string.Continue), null);
builder.setNegativeButton(LocaleController.getString("Stop", R.string.Stop), (dialogInterface, i) -> {
@ -3492,7 +3491,7 @@ public class LoginActivity extends BaseFragment {
public boolean onBackPressed(boolean force) {
if (!force) {
AlertDialog.Builder builder = new AlertDialog.Builder(getParentActivity());
builder.setTitle(LocaleController.getString("AppName", R.string.AppName));
builder.setTitle("\uD83D\uDE36 Nekogram");
builder.setMessage(LocaleController.getString("AreYouSureRegistration", R.string.AreYouSureRegistration));
builder.setNegativeButton(LocaleController.getString("Stop", R.string.Stop), (dialogInterface, i) -> {
onBackPressed(true);