diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml
index 8eb05e8..abfe3cc 100644
--- a/app/src/main/AndroidManifest.xml
+++ b/app/src/main/AndroidManifest.xml
@@ -12,8 +12,6 @@
-
diff --git a/app/src/main/java/io/github/sankalp/lunox/LauncherActivity.java b/app/src/main/java/io/github/sankalp/lunox/LauncherActivity.java
index fdf8ce1..77c9816 100644
--- a/app/src/main/java/io/github/sankalp/lunox/LauncherActivity.java
+++ b/app/src/main/java/io/github/sankalp/lunox/LauncherActivity.java
@@ -88,7 +88,6 @@ import io.github.sankalp.lunox.dialogs.GlobalColorSizeDialog;
import io.github.sankalp.lunox.dialogs.GlobalSettingsDialog;
import io.github.sankalp.lunox.dialogs.HiddenAppsDialogs;
import io.github.sankalp.lunox.dialogs.PaddingDialog;
-import io.github.sankalp.lunox.dialogs.PermissionDialog;
import io.github.sankalp.lunox.dialogs.RenameInputDialogs;
import io.github.sankalp.lunox.model.Apps;
import io.github.sankalp.lunox.model.Shortcut;
@@ -304,8 +303,7 @@ public class LauncherActivity extends Activity implements View.OnClickListener,
// initGestures();
- // Check permissions before loading apps
- checkAndRequestPermissions();
+ // No permissions needed for basic launcher functionality
// loads the apps
loadApps();
@@ -1326,25 +1324,7 @@ public class LauncherActivity extends Activity implements View.OnClickListener,
}
}
- /**
- * Check and request necessary permissions for app detection
- */
- private void checkAndRequestPermissions() {
- // Check if permissions dialog was already shown
- if (DbUtils.isPermissionDialogShown()) {
- return;
- }
- // Create the new permission dialog with proper theming
- Context ctx;
- if (DbUtils.getTheme() == R.style.Wallpaper)
- ctx = new ContextThemeWrapper(this, R.style.AppTheme);
- else
- ctx = new ContextThemeWrapper(this, DbUtils.getTheme());
-
- PermissionDialog permissionDialog = new PermissionDialog(ctx, this);
- permissionDialog.show();
- }
/**
* Show dialog to enable accessibility service for double tap to lock
diff --git a/app/src/main/java/io/github/sankalp/lunox/dialogs/PermissionDialog.java b/app/src/main/java/io/github/sankalp/lunox/dialogs/PermissionDialog.java
deleted file mode 100644
index fa799d0..0000000
--- a/app/src/main/java/io/github/sankalp/lunox/dialogs/PermissionDialog.java
+++ /dev/null
@@ -1,146 +0,0 @@
-/*
- * Last Launcher
- * Copyright (C) 2019 Shubham Tyagi
- *
- * This program 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.
- *
- * This program 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 this program. If not, see .
- */
-
-package io.github.sankalp.lunox.dialogs;
-
-import android.app.AppOpsManager;
-import android.app.Dialog;
-import android.content.Context;
-import android.content.Intent;
-import android.os.Build;
-import android.os.Bundle;
-import android.provider.Settings;
-import android.view.View;
-import android.view.Window;
-import android.widget.TextView;
-import android.widget.Toast;
-
-import io.github.sankalp.lunox.LauncherActivity;
-import io.github.sankalp.lunox.R;
-import io.github.sankalp.lunox.utils.DbUtils;
-
-
-public class PermissionDialog extends Dialog implements View.OnClickListener {
-
- private final LauncherActivity context;
- private TextView usageAccessButton;
- private TextView continueButton;
-
- public PermissionDialog(Context context, LauncherActivity launcherActivity) {
- super(context);
- this.context = launcherActivity;
- }
-
- @Override
- protected void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
- requestWindowFeature(Window.FEATURE_NO_TITLE);
- setContentView(R.layout.dialog_permission_setup);
- setCancelable(false);
-
- // Initialize views
- usageAccessButton = findViewById(R.id.permission_usage_access);
- continueButton = findViewById(R.id.permission_continue);
-
- // Set click listeners
- usageAccessButton.setOnClickListener(this);
- continueButton.setOnClickListener(this);
-
- // Update button states
- updatePermissionStates();
- }
-
- @Override
- public void onClick(View view) {
- int id = view.getId();
-
- if (id == R.id.permission_usage_access) {
- openUsageAccessSettings();
- } else if (id == R.id.permission_continue) {
- continueToLauncher();
- }
- }
-
- private void openUsageAccessSettings() {
- try {
- Intent intent = new Intent(Settings.ACTION_USAGE_ACCESS_SETTINGS);
- context.startActivity(intent);
- Toast.makeText(context, "Please enable Usage Access for Lunox", Toast.LENGTH_LONG).show();
- } catch (Exception e) {
- // Fallback to general settings if specific intent fails
- Intent intent = new Intent(Settings.ACTION_SETTINGS);
- context.startActivity(intent);
- Toast.makeText(context, "Please find and enable Usage Access for Lunox in Settings", Toast.LENGTH_LONG).show();
- }
- }
-
-
-
- private void continueToLauncher() {
- // Mark permission dialog as shown
- DbUtils.setPermissionDialogShown(true);
-
- // Check if usage access permission is granted
- boolean hasUsageAccess = checkUsageAccessPermission();
-
- if (hasUsageAccess) {
- dismiss();
- context.loadApps(); // Reload apps after permissions are granted
- } else {
- Toast.makeText(context, "Please grant Usage Access permission to continue", Toast.LENGTH_LONG).show();
- }
- }
-
- private boolean checkUsageAccessPermission() {
- if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP_MR1) {
- AppOpsManager appOps = (AppOpsManager) context.getSystemService(Context.APP_OPS_SERVICE);
- int mode = appOps.checkOpNoThrow(AppOpsManager.OPSTR_GET_USAGE_STATS,
- android.os.Process.myUid(), context.getPackageName());
- return mode == AppOpsManager.MODE_ALLOWED;
- }
- return true; // For older versions, assume permission is granted
- }
-
- private void updatePermissionStates() {
- // Update Usage Access button
- boolean hasUsageAccess = checkUsageAccessPermission();
- if (hasUsageAccess) {
- usageAccessButton.setText("Usage Access ✓");
- usageAccessButton.setAlpha(0.7f);
- } else {
- usageAccessButton.setText("Enable Usage Access");
- usageAccessButton.setAlpha(1.0f);
- }
- }
-
- @Override
- protected void onStart() {
- super.onStart();
- // Update permission states when dialog becomes visible
- updatePermissionStates();
- }
-
- @Override
- public void onWindowFocusChanged(boolean hasFocus) {
- super.onWindowFocusChanged(hasFocus);
- if (hasFocus) {
- // Update permission states when user returns to the dialog
- updatePermissionStates();
- }
- }
-}
diff --git a/app/src/main/java/io/github/sankalp/lunox/utils/DbUtils.java b/app/src/main/java/io/github/sankalp/lunox/utils/DbUtils.java
index 33f9b2c..0debfaf 100644
--- a/app/src/main/java/io/github/sankalp/lunox/utils/DbUtils.java
+++ b/app/src/main/java/io/github/sankalp/lunox/utils/DbUtils.java
@@ -1,6 +1,6 @@
/*
- * Last Launcher
- * Copyright (C) 2019 Shubham Tyagi
+ * Lunox
+ * Copyright (C) 2025 Sankalp Tharu
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -61,7 +61,6 @@ public class DbUtils {
private static final String GLOBAL_SIZE_ADDITION_EXTRA = "global_size_addition_extra";
private static final String APPS_COLORS_DEFAULT = "apps_color_default";
private static final String APPS_SORTS_TYPE = "apps_sorts_types";
- private static final String PERMISSION_DIALOG_SHOWN = "permission_dialog_shown";
private static final String DOUBLE_TAP_TO_LOCK = "double_tap_to_lock";
@@ -379,19 +378,7 @@ public class DbUtils {
SpUtils.getInstance().putInt(APPS_SORTS_TYPE, type);
}
- /**
- * Check if permission dialog has been shown
- */
- public static boolean isPermissionDialogShown() {
- return SpUtils.getInstance().getBoolean(PERMISSION_DIALOG_SHOWN, false);
- }
- /**
- * Set permission dialog as shown
- */
- public static void setPermissionDialogShown(boolean shown) {
- SpUtils.getInstance().putBoolean(PERMISSION_DIALOG_SHOWN, shown);
- }
/**
* Check if double tap to lock is enabled
diff --git a/app/src/main/res/layout/dialog_app_settings.xml b/app/src/main/res/layout/dialog_app_settings.xml
index 533b5db..db3f4a5 100644
--- a/app/src/main/res/layout/dialog_app_settings.xml
+++ b/app/src/main/res/layout/dialog_app_settings.xml
@@ -1,6 +1,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml
index 3d74639..9ddcb4e 100644
--- a/app/src/main/res/values/strings.xml
+++ b/app/src/main/res/values/strings.xml
@@ -93,9 +93,6 @@
-
- Welcome to Lunox! 🚀
- To provide the best launcher experience, Lunox needs this permission:\n\nUsage Access - Display all your apps\n\nTap the permission below to enable it.