Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,9 @@ public void onViewCreated(@NonNull View view, Bundle savedInstanceState) {
SwitchMaterial autoBanner = view.findViewById(R.id.banner_detect);
SwitchMaterial pixieIfaceDown = view.findViewById(R.id.pixie_iface_down_switch);
LinearLayout pixieIfaceDownRow = view.findViewById(R.id.pixie_iface_down_row);
LinearLayout internalDeauthRow = view.findViewById(R.id.internal_deauth_row);
View internalDeauthDivider = view.findViewById(R.id.internal_deauth_divider);
SwitchMaterial internalDeauth = view.findViewById(R.id.internal_deauth_switch);
LinearLayout autoWifiRow = view.findViewById(R.id.autowifi_row);
LinearLayout saveApsRow = view.findViewById(R.id.save_aps_row);
LinearLayout autoScanRow = view.findViewById(R.id.autoscan_row);
Expand All @@ -81,6 +84,7 @@ public void onViewCreated(@NonNull View view, Bundle savedInstanceState) {
saveAps.setChecked(core.isStoreEnabled());
autoBanner.setChecked(core.isBannerScanEnabled());
pixieIfaceDown.setChecked(core.isPixieIfaceDown());
internalDeauth.setChecked(core.isInternalDeauthEnabled());
hide.setChecked(core.getBoolean("hide"));
autoWifi.setChecked(core.getBoolean("wifi"));
autoScan.setChecked(core.getBoolean("autoScan"));
Expand All @@ -89,13 +93,20 @@ public void onViewCreated(@NonNull View view, Bundle savedInstanceState) {
saveAps.setOnCheckedChangeListener((btn, b) -> core.putBoolean("save_aps", b));
autoBanner.setOnCheckedChangeListener((btn, b) -> core.putBoolean("autoBanner", b));
pixieIfaceDown.setOnCheckedChangeListener((btn, b) -> core.putBoolean("pixie_iface_down", b));
internalDeauth.setOnCheckedChangeListener((btn, b) -> core.putBoolean("internal_deauth", b));
hide.setOnCheckedChangeListener((btn, b) -> core.putBoolean("hide", b));
autoWifi.setOnCheckedChangeListener((btn, b) -> core.putBoolean("wifi", b));
autoScan.setOnCheckedChangeListener((btn, b) -> core.putBoolean("autoScan", b));

bindRowToSwitch(autoWifiRow, autoWifi);
bindRowToSwitch(saveApsRow, saveAps);
bindRowToSwitch(pixieIfaceDownRow, pixieIfaceDown);
bindRowToSwitch(internalDeauthRow, internalDeauth);
if (core.isRootless()) {
// The internal radio doesn't exist in the rootless VM — the toggle has no effect there
internalDeauthRow.setVisibility(View.GONE);
internalDeauthDivider.setVisibility(View.GONE);
}
bindRowToSwitch(autoScanRow, autoScan);
bindRowToSwitch(bannerRow, autoBanner);
bindRowToSwitch(hideRow, hide);
Expand Down
4 changes: 4 additions & 0 deletions app/src/main/java/com/zalexdev/stryker/utils/Core.java
Original file line number Diff line number Diff line change
Expand Up @@ -1387,6 +1387,10 @@ public boolean isPixieIfaceDown(){
return preferences.getBoolean("pixie_iface_down", true);
}

public boolean isInternalDeauthEnabled(){
return preferences.getBoolean("internal_deauth", false);
}

public String wpsIfaceDownFlag(){
return isPixieIfaceDown() ? " --iface-down" : "";
}
Expand Down
11 changes: 7 additions & 4 deletions app/src/main/java/com/zalexdev/stryker/wifi/WiFIAdapter.java
Original file line number Diff line number Diff line change
Expand Up @@ -678,10 +678,11 @@ public void doOnBackground() {
String wlanscan = core.getHSInterface();
String deauthPref = core.getDeauthInterface();
ArrayList<String> clients = new ArrayList<>();
if (!core.isRootless() && MonitorManager.isInternalRadio(deauthPref)){
if (!core.isRootless() && !core.isInternalDeauthEnabled()
&& MonitorManager.isInternalRadio(deauthPref)){
if (!MonitorManager.isInternalRadio(wlanscan)) {
deauthPref = wlanscan;
sendEvent("Deauth interface is the internal radio — using " + wlanscan + " instead");
sendEvent("Deauth interface is the internal radio — using " + wlanscan + " instead (enable 'Deauth with internal adapter' in Settings to use it)");
} else {
deauth = false;
}
Expand Down Expand Up @@ -787,6 +788,7 @@ public void onEvent(String line) {
? wlandeauth + "mon" : wlandeauth;
final String hsIface = capIface;
final boolean internalDeauth = !core.isRootless()
&& !core.isInternalDeauthEnabled()
&& MonitorManager.isInternalRadio(deauthIface);
final String[] lastRelock = {""};
if (deauth) {
Expand Down Expand Up @@ -1295,10 +1297,11 @@ else if (type == 7){
if (dialogCanceled.get()) return;
String deauthIface = core.getDeauthInterface();
boolean ok = false;
if (core.isRootless() || !MonitorManager.isInternalRadio(deauthIface)){
if (core.isRootless() || !MonitorManager.isInternalRadio(deauthIface)
|| core.isInternalDeauthEnabled()){
ok = core.enableMonitorMode(deauthIface, String.valueOf(network.getChannel()));
}else{
activity.runOnUiThread(() -> outputtext.append("Internal wifi adapter (wlan0) does not support packet injection! Please use external wifi adapter!\n"));
activity.runOnUiThread(() -> outputtext.append("Internal wifi adapter (wlan0) deauth is disabled! Enable 'Deauth with internal adapter' in Settings, or use an external wifi adapter!\n"));
}
if (dialogCanceled.get()) return;
final String monIface = core.getDeauthInterface();
Expand Down
62 changes: 62 additions & 0 deletions app/src/main/res/layout/settings_main.xml
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,68 @@
android:layout_marginStart="72dp"
android:background="@color/light_lite_contrast" />

<LinearLayout
android:id="@+id/internal_deauth_row"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="?attr/selectableItemBackground"
android:clickable="true"
android:focusable="true"
android:gravity="center_vertical"
android:minHeight="64dp"
android:orientation="horizontal"
android:paddingStart="14dp"
android:paddingTop="12dp"
android:paddingEnd="14dp"
android:paddingBottom="12dp">

<ImageView
android:layout_width="44dp"
android:layout_height="44dp"
android:background="@drawable/settings_icon_bg"
android:padding="10dp"
android:src="@drawable/deauth"
app:tint="@color/stryker_accent" />

<LinearLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginStart="14dp"
android:layout_weight="1"
android:orientation="vertical">

<com.google.android.material.textview.MaterialTextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/settings_internal_deauth_title"
android:textColor="?android:attr/textColorPrimary"
android:textSize="16sp"
android:textStyle="bold" />

<com.google.android.material.textview.MaterialTextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="2dp"
android:text="@string/settings_internal_deauth_subtitle"
android:textColor="@color/grey"
android:textSize="12sp" />
</LinearLayout>

<com.google.android.material.switchmaterial.SwitchMaterial
android:id="@+id/internal_deauth_switch"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:clickable="false"
android:focusable="false" />
</LinearLayout>

<View
android:id="@+id/internal_deauth_divider"
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginStart="72dp"
android:background="@color/light_lite_contrast" />

<LinearLayout
android:id="@+id/change_interfaces"
android:layout_width="match_parent"
Expand Down
2 changes: 2 additions & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,8 @@ Storage is only consumed as the guest writes, and space freed inside the VM is r
<string name="settings_change_interfaces_subtitle">Pick which adapter handles scan, handshake, deauth, WPS</string>
<string name="settings_pixie_iface_down_title">Turn interface down</string>
<string name="settings_pixie_iface_down_subtitle">Disable Wi‑Fi and drop the adapter during Pixie/WPS attacks. Needed for most internal adapters; turn off for external adapters that must stay up</string>
<string name="settings_internal_deauth_title">Deauth with internal adapter</string>
<string name="settings_internal_deauth_subtitle">Allow deauthentication on the internal Wi‑Fi radio (wlan0). Enable only if your device supports packet injection on the internal adapter; otherwise an external adapter is used</string>

<string name="settings_change_commands_title">Custom monitor commands</string>
<string name="settings_change_commands_subtitle">Override how monitor mode is enabled per adapter</string>
Expand Down