Skip to content

Commit

Permalink
Fixed Advance Security fix for Android 10
Browse files Browse the repository at this point in the history
  • Loading branch information
mayankmetha committed Jan 4, 2020
1 parent a301a36 commit 7b94f14
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
14 changes: 10 additions & 4 deletions app/src/main/java/com/mayank/rucky/RootSettingsFragment.java
Original file line number Diff line number Diff line change
Expand Up @@ -151,10 +151,16 @@ public void onCreatePreferences(Bundle savedInstanceState, String rootKey) {
}
editor.putBoolean(PREF_GEN_KEY,true).apply();
editor.putBoolean(PREF_SETTING_ADV_SECURITY,switched).apply();
Intent intent = new Intent(getActivity(), SplashActivity.class);
intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP|Intent.FLAG_ACTIVITY_NEW_TASK);
getActivity().finishAffinity();
startActivity(intent);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
Intent i = new Intent(getActivity(), TransparentActivity.class);
i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK);
startActivity(i);
} else {
Intent i = new Intent(getActivity(), SplashActivity.class);
i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK);
startActivity(i);
}
getActivity().finish();
return true;
});

Expand Down
2 changes: 1 addition & 1 deletion app/src/main/java/com/mayank/rucky/SplashActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ public class SplashActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
requestWindowFeature(Window.FEATURE_NO_TITLE);
final SharedPreferences settings = getSharedPreferences(SettingsActivity.PREF_SETTINGS, MODE_PRIVATE);
SettingsActivity.darkTheme = settings.getBoolean(SettingsActivity.PREF_SETTINGS_DARK_THEME, true);
init = settings.getBoolean(PREF_SETTINGS_INIT,true);
Expand Down Expand Up @@ -164,7 +165,6 @@ private void splash() {
| View.SYSTEM_UI_FLAG_HIDE_NAVIGATION
| View.SYSTEM_UI_FLAG_FULLSCREEN
| View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY;
requestWindowFeature(Window.FEATURE_NO_TITLE);
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
View view = getWindow().getDecorView();
view.setSystemUiVisibility(flags);
Expand Down

0 comments on commit 7b94f14

Please sign in to comment.