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 @@ -92,6 +92,19 @@ public static String formatNetmask(int prefixLength) {
}
}

/**
* Adapter reported to Wine when Android has no active network. Represents an
* up link-local interface so iphlpapi never hands the guest a down, all-zero
* adapter (which some games dereference blindly during boot enumeration).
*/
public static IFAddress offlineFallback() {
IFAddress ifAddress = new IFAddress();
ifAddress.flags = OsConstants.IFF_UP | OsConstants.IFF_RUNNING;
ifAddress.address = "169.254.1.2";
ifAddress.netmask = "255.255.0.0";
return ifAddress;
}

public boolean isConnected() {
NetworkInfo networkInfo = connectivityManager.getActiveNetworkInfo();
if (networkInfo == null) return false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public void updateIFAddrsFile(List<NetworkHelper.IFAddress> ifAddresses) {
content.append(ifAddress.toString());
}
} else {
content.append(new NetworkHelper.IFAddress().toString());
content.append(NetworkHelper.offlineFallback().toString());
}
FileUtils.writeString(file, content.toString());
}
Expand Down