Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
e624ac8
ADFA-40: add :security module with Instant Hide gesture detectors
davidschachterADFA Oct 13, 2026
22b5632
ADFA-40: add Instant Hide preference flag and Security settings toggle
davidschachterADFA Oct 13, 2026
5f7b030
ADFA-40: add the Code Breaker cryptogram disguise, aliases, and redirect
davidschachterADFA Oct 13, 2026
20c10c6
ADFA-40: spotless reformat EdgeToEdgeIDEActivity.kt (no functional ch…
davidschachterADFA Oct 13, 2026
0832393
ADFA-40: wire the Instant Hide triggers into the IDE
davidschachterADFA Oct 13, 2026
9cad0b4
ADFA-40: move Instant Hide strings to :resources; add module docs
davidschachterADFA Oct 13, 2026
3ebbdb1
ADFA-40: trigger face-down hide on orientation alone
davidschachterADFA Oct 13, 2026
24dcf99
ADFA-40: fix README face-down description (orientation only)
davidschachterADFA Oct 13, 2026
6629b99
ADFA-40: close the deep-link concealment bypass
davidschachterADFA Oct 13, 2026
8bc97c6
ADFA-40: apply FLAG_SECURE immediately when Instant Hide is toggled
davidschachterADFA Oct 13, 2026
70072c7
style: spotless reformat CrashHandlerActivity, no functional change
davidschachterADFA Oct 29, 2026
fceec1c
ADFA-40: keep the launcher component name so pinned icons survive
davidschachterADFA Oct 29, 2026
5d0c1a6
ADFA-40: show the stealth icon on the disguise's Recents card
davidschachterADFA Oct 29, 2026
60cf53e
ADFA-40: mount Instant Hide on every activity
davidschachterADFA Oct 29, 2026
d4eaa93
ADFA-40: hide once per screen-off broadcast
davidschachterADFA Oct 30, 2026
6f582b6
ADFA-40: keep the disguise up after a hide; restart the idle minute o…
davidschachterADFA Oct 30, 2026
50ca34c
ADFA-40: document that the app's own name still shows while hidden
davidschachterADFA Oct 30, 2026
c6f780c
Merge branch 'stage' into feature/ADFA-40-instant-hide
davidschachterADFA Oct 31, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions ARCHITECTURE.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ Strategy: **layer-and-subsystem based**, not feature-by-feature. The Gradle buil
| Shell | `termux:{termux-app,termux-shared,termux-view,termux-emulator}` | Embedded Termux shell and terminal. |
| Plugin system | `plugin-api`, `plugin-api:plugin-builder`, `plugin-manager` | In-app plugin SDK + manager — `AndroidManifest.xml` `<meta-data>` contract, permissions, extensions. See [plugin-api.md](docs/plugin-api.md) for the API surface & compatibility policy. |
| On-device AI | `llama-api`, `llama-impl` | llama.cpp integration, shipped as a per-flavor native AAR. |
| Security | `security` | Instant Hide emergency disguise (ADFA-40): gesture/sensor triggers mounted on the IDE base activity swap the app to a "Code Breaker" cryptogram game and mask it in Recents. Renders in Views, not Compose — a documented [ADR 0009](docs/adr/0009-jetpack-compose-for-new-ui.md) exception (see `security/README.md`). |
| Cross-cutting | `eventbus`, `eventbus-android`, `eventbus-events`, `common`, `common-ui`, `common-compose`, `logger`, `resources`, `preferences`, `shared` | Shared infra and the event bus. `common-compose` holds the Compose theming any module can opt into (see [ADR 0009](docs/adr/0009-jetpack-compose-for-new-ui.md)); it is a leaf so modules that aren't Compose pay nothing. |
| Testing | `testing:{android,unit,lsp,tooling,common}` | Shared test harnesses, split by what's under test. |

Expand Down
1 change: 1 addition & 0 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -451,6 +451,7 @@ dependencies {
implementation(projects.lookup)
implementation(projects.preferences)
implementation(projects.resources)
implementation(projects.security)
implementation(projects.treeview)
implementation(projects.templatesApi)
implementation(projects.templatesImpl)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import androidx.test.core.app.ActivityScenario
import androidx.test.espresso.matcher.ViewMatchers.isNotEnabled
import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.platform.app.InstrumentationRegistry
import com.itsaky.androidide.activities.SplashActivity
import com.itsaky.androidide.activities.LauncherActivity
import com.itsaky.androidide.helper.advancePastWelcomeScreen
import com.itsaky.androidide.helper.clickFirstAccessibilityNodeByText
import com.itsaky.androidide.helper.configureAutomationBuildPreferences
Expand Down Expand Up @@ -49,7 +49,7 @@ class AutomationEndToEndTest : TestCase() {
// ── Launch ──

step("Launch app") {
ActivityScenario.launch(SplashActivity::class.java)
ActivityScenario.launch(LauncherActivity::class.java)
Thread.sleep(LAUNCH_SETTLE_DELAY_MS)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import androidx.test.core.app.ActivityScenario
import androidx.test.espresso.matcher.ViewMatchers.isNotEnabled
import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.platform.app.InstrumentationRegistry
import com.itsaky.androidide.activities.SplashActivity
import com.itsaky.androidide.activities.LauncherActivity
import com.itsaky.androidide.helper.advancePastWelcomeScreen
import com.itsaky.androidide.helper.clickFirstAccessibilityNodeByText
import com.itsaky.androidide.helper.configureAutomationBuildPreferences
Expand Down Expand Up @@ -44,7 +44,7 @@ class EndToEndTest : TestCase() {
// ── Launch ──

step("Launch app") {
ActivityScenario.launch(SplashActivity::class.java)
ActivityScenario.launch(LauncherActivity::class.java)
Thread.sleep(1000)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package com.itsaky.androidide
import androidx.test.core.app.ActivityScenario
import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.platform.app.InstrumentationRegistry
import com.itsaky.androidide.activities.SplashActivity
import com.itsaky.androidide.activities.LauncherActivity
import com.itsaky.androidide.activities.editor.EditorHandlerActivity
import com.itsaky.androidide.app.configuration.IJdkDistributionProvider
import com.itsaky.androidide.helper.isExperimentsFlagSet
Expand Down Expand Up @@ -55,7 +55,7 @@ class QuickBuildFlagOffTest : TestCase() {
runCatching { rebuildEditorToolbar() }
}.run {
step("Launch app") {
ActivityScenario.launch(SplashActivity::class.java)
ActivityScenario.launch(LauncherActivity::class.java)
waitForMainHomeOrEditorUi(device.uiDevice)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import androidx.test.core.app.ActivityScenario
import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.platform.app.InstrumentationRegistry
import androidx.test.uiautomator.UiSelector
import com.itsaky.androidide.activities.SplashActivity
import com.itsaky.androidide.activities.LauncherActivity
import com.itsaky.androidide.app.configuration.IJdkDistributionProvider
import com.itsaky.androidide.helper.FakeInstalledPackages
import com.itsaky.androidide.helper.ensureOnHomeScreenBeforeCreateProject
Expand Down Expand Up @@ -366,7 +366,7 @@ class QuickBuildPipelineTest : TestCase() {
packageSuffix: String,
) {
step("Launch app") {
ActivityScenario.launch(SplashActivity::class.java)
ActivityScenario.launch(LauncherActivity::class.java)
waitForMainHomeOrEditorUi(device.uiDevice)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import androidx.test.core.app.ActivityScenario
import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.platform.app.InstrumentationRegistry
import androidx.test.uiautomator.UiSelector
import com.itsaky.androidide.activities.SplashActivity
import com.itsaky.androidide.activities.LauncherActivity
import com.itsaky.androidide.activities.editor.EditorHandlerActivity
import com.itsaky.androidide.app.configuration.IJdkDistributionProvider
import com.itsaky.androidide.helper.FakeInstalledPackages
Expand Down Expand Up @@ -136,7 +136,7 @@ class QuickBuildSmokeTest : TestCase() {
}
}.run {
step("Launch app") {
ActivityScenario.launch(SplashActivity::class.java)
ActivityScenario.launch(LauncherActivity::class.java)
waitForMainHomeOrEditorUi(device.uiDevice)
}

Expand Down
93 changes: 90 additions & 3 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -78,15 +78,102 @@
</intent-filter>
</activity>

<!--
LauncherActivity has no launcher intent-filter of its own: the launcher identity is carried
by the activity-aliases below so Instant Hide (ADFA-40) can swap the app name/icon to the
"Code Breaker" disguise by toggling which alias is enabled. All aliases target LauncherActivity.
The default alias keeps the launcher activity's name from before Instant Hide,
.activities.SplashActivity, so a home-screen icon pinned to that component survives the
update on every launcher.
-->
<activity
android:name=".activities.SplashActivity"
android:name=".activities.LauncherActivity"
android:exported="true"
android:theme="@style/AppTheme.Splash">
android:theme="@style/AppTheme.Splash" />

<activity-alias
android:name=".activities.SplashActivity"
android:targetActivity=".activities.LauncherActivity"
android:label="@string/app_name"
android:icon="@drawable/ic_launcher"
android:roundIcon="@drawable/ic_launcher"
android:enabled="true"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</activity-alias>

<activity-alias
android:name=".StealthAliasActivity1"
android:targetActivity=".activities.LauncherActivity"
android:label="@string/stealth_app_name"
android:icon="@drawable/ic_launcher_stealth_1"
android:roundIcon="@drawable/ic_launcher_stealth_1"
android:enabled="false"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity-alias>

<activity-alias
android:name=".StealthAliasActivity2"
android:targetActivity=".activities.LauncherActivity"
android:label="@string/stealth_app_name"
android:icon="@drawable/ic_launcher_stealth_2"
android:roundIcon="@drawable/ic_launcher_stealth_2"
android:enabled="false"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity-alias>

<activity-alias
android:name=".StealthAliasActivity3"
android:targetActivity=".activities.LauncherActivity"
android:label="@string/stealth_app_name"
android:icon="@drawable/ic_launcher_stealth_3"
android:roundIcon="@drawable/ic_launcher_stealth_3"
android:enabled="false"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity-alias>

<activity-alias
android:name=".StealthAliasActivity4"
android:targetActivity=".activities.LauncherActivity"
android:label="@string/stealth_app_name"
android:icon="@drawable/ic_launcher_stealth_4"
android:roundIcon="@drawable/ic_launcher_stealth_4"
android:enabled="false"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity-alias>

<activity-alias
android:name=".StealthAliasActivity5"
android:targetActivity=".activities.LauncherActivity"
android:label="@string/stealth_app_name"
android:icon="@drawable/ic_launcher_stealth_5"
android:roundIcon="@drawable/ic_launcher_stealth_5"
android:enabled="false"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity-alias>
<activity
android:name=".activities.OnboardingActivity"
android:configChanges="orientation|screenSize|screenLayout|smallestScreenSize"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,42 +25,47 @@
import com.itsaky.androidide.app.IDEActivity;
import com.itsaky.androidide.databinding.ActivityCrashHandlerBinding;
import com.itsaky.androidide.fragments.CrashReportFragment;
import com.itsaky.androidide.security.InstantHide;

public class CrashHandlerActivity extends IDEActivity {

public static final String REPORT_ACTION = "com.itsaky.androidide.REPORT_CRASH";
public static final String TRACE_KEY = "crash_trace";
private ActivityCrashHandlerBinding binding;
public static final String REPORT_ACTION = "com.itsaky.androidide.REPORT_CRASH";
public static final String TRACE_KEY = "crash_trace";
private ActivityCrashHandlerBinding binding;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
@Override
@NonNull
protected View bindLayout() {
binding = ActivityCrashHandlerBinding.inflate(getLayoutInflater());
return binding.getRoot();
}

final var extra = getIntent().getExtras();
if (extra == null) {
finishAffinity();
return;
}
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// Instant Hide (ADFA-40): a crash report names the IDE, so it must not show while disguised.
if (InstantHide.INSTANCE.redirectIfHidden(this)) {
return;
}

final var fragment = CrashReportFragment.newInstance();
final var extra = getIntent().getExtras();
if (extra == null) {
finishAffinity();
return;
}

getSupportFragmentManager()
.beginTransaction()
.replace(binding.getRoot().getId(), fragment, "crash_report_fragment")
.addToBackStack(null)
.commit();
}
final var fragment = CrashReportFragment.newInstance();

@Override
@NonNull
protected View bindLayout() {
binding = ActivityCrashHandlerBinding.inflate(getLayoutInflater());
return binding.getRoot();
}
getSupportFragmentManager()
.beginTransaction()
.replace(binding.getRoot().getId(), fragment, "crash_report_fragment")
.addToBackStack(null)
.commit();
}

@Override
protected void onDestroy() {
super.onDestroy();
binding = null;
}
@Override
protected void onDestroy() {
super.onDestroy();
binding = null;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ import com.itsaky.androidide.analytics.selector
import com.itsaky.androidide.api.ActionContextProvider
import com.itsaky.androidide.models.DeepLinkRequest
import com.itsaky.androidide.resources.R.string
import com.itsaky.androidide.security.InstantHide
import org.koin.android.ext.android.inject

/**
Expand All @@ -41,7 +42,7 @@ import org.koin.android.ext.android.inject
* [MainActivity] if nothing is open yet, or the already-running [EditorActivityKt] (via its
* `singleTask` `onNewIntent`) if one is.
*
* Kept as a plain [Activity] (like [SplashActivity]), not [com.itsaky.androidide.app.BaseIDEActivity],
* Kept as a plain [Activity] (like [LauncherActivity]), not [com.itsaky.androidide.app.BaseIDEActivity],
* since it never calls `setContentView` and has no theming needs of its own.
*/
class DeepLinkActivity : Activity() {
Expand All @@ -50,16 +51,22 @@ class DeepLinkActivity : Activity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)

// Instant Hide (ADFA-40): this activity is exported and routes straight into IDE content,
// bypassing LauncherActivity's hidden-state guard. While the disguise is engaged, show it instead
// and drop the link silently -- even acknowledging that a link arrived would leak the IDE's
// presence. Mirrors LauncherActivity; the state persists until the user performs the exit gesture.
if (InstantHide.redirectIfHidden(this)) return

// A link can arrive before the IDE is usable -- a fresh install, or a Clear Data. Both targets
// below sit *past* SplashActivity and OnboardingActivity, which are the only things enforcing
// below sit *past* LauncherActivity and OnboardingActivity, which are the only things enforcing
// the terms, the permissions, the JDK and SDK install, the low-storage check and the x86
// exit, so following the link now would land the user in an editor that cannot build, on a
// device the app is supposed to refuse to run on at all (ADFA-5067 review).
//
// The link is dropped rather than deferred: carrying a request through an onboarding that can
// take several minutes, and may not finish at all, is a lot of machinery for a rare case. The
// user is told, and sent to the normal entry point, which decides what they actually need --
// storage, ABI and onboarding are SplashActivity's to enforce, not this activity's to repeat.
// storage, ABI and onboarding are LauncherActivity's to enforce, not this activity's to repeat.
if (!isIdeSetupComplete()) {
// Depth is UNKNOWN rather than parsed: the readiness gate deliberately runs before the
// URI is looked at, and reordering it just to enrich a metric would put parsing ahead of
Expand All @@ -72,7 +79,7 @@ class DeepLinkActivity : Activity() {
// whole terms/permissions/JDK-install onboarding inside that app's back stack, where
// back-press returns to them rather than exiting CoGo.
startActivity(
Intent(this, SplashActivity::class.java).apply {
Intent(this, LauncherActivity::class.java).apply {
addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
},
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import android.os.Bundle
import android.view.View
import androidx.compose.ui.platform.ComposeView
import com.itsaky.androidide.app.IDEActivity
import com.itsaky.androidide.security.InstantHide
import com.itsaky.androidide.viewmodels.ExternalFileInstallViewModel
import org.koin.androidx.viewmodel.ext.android.viewModel

Expand All @@ -29,11 +30,14 @@ class ExternalFileInstallActivity : IDEActivity() {

override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
// Instant Hide (ADFA-40): a file opened while disguised must not start an install.
if (InstantHide.redirectIfHidden(this)) return
handleIntent()
}

override fun onNewIntent(intent: Intent) {
super.onNewIntent(intent)
if (InstantHide.redirectIfHidden(this)) return
setIntent(intent)
handleIntent()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import android.os.Build
import android.os.Bundle
import com.itsaky.androidide.app.configuration.CpuArch
import com.itsaky.androidide.app.configuration.IDEBuildConfigProvider
import com.itsaky.androidide.security.InstantHide
import com.itsaky.androidide.ui.showLowStorageDialog
import com.itsaky.androidide.utils.FeatureFlags
import com.itsaky.androidide.utils.hasEnoughStorageAvailable
Expand All @@ -31,10 +32,14 @@ import kotlin.system.exitProcess
/**
* @author Akash Yadav
*/
class SplashActivity : Activity() {
class LauncherActivity : Activity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)

// Instant Hide (ADFA-40): if the disguise is engaged, go straight to it before any IDE UI
// is shown. The state persists across restarts/reboots until the user performs the exit gesture.
if (InstantHide.redirectIfHidden(this)) return

if (!hasEnoughStorageAvailable()) {
showLowStorageDialog()
return
Expand Down
Loading