Skip to content

Update Endpoint.java #832

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Feb 11, 2017
Merged
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
10 changes: 5 additions & 5 deletions cSploit/src/main/java/org/csploit/android/net/Endpoint.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,16 @@
package org.csploit.android.net;

import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import org.csploit.android.core.System;
import org.csploit.android.helpers.NetworkHelper;

import java.io.BufferedReader;
import java.math.BigInteger;
import java.net.InetAddress;
import java.net.UnknownHostException;
import java.util.Arrays;

import org.csploit.android.core.System;
import org.csploit.android.helpers.NetworkHelper;

public class Endpoint implements Comparable<Endpoint>
{
private InetAddress mAddress = null;
Expand Down Expand Up @@ -57,9 +57,9 @@ public Endpoint(String address){
this(address, null);
}

public Endpoint(InetAddress address, byte[] hardware){
public Endpoint(InetAddress address, @Nullable byte[] hardware){
mAddress = address;
mHardware = Arrays.copyOf(hardware, hardware.length);
mHardware = hardware != null ? Arrays.copyOf(hardware, hardware.length) : null;
}

public Endpoint(String address, String hardware){
Expand Down
12 changes: 4 additions & 8 deletions cSploit/src/main/java/org/csploit/android/net/Network.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,20 +25,15 @@
import android.net.wifi.WifiInfo;
import android.net.wifi.WifiManager;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.util.Patterns;

import org.apache.commons.net.util.SubnetUtils;
import org.csploit.android.core.Logger;
import org.csploit.android.core.System;
import org.csploit.android.helpers.NetworkHelper;

import java.lang.reflect.Method;
import java.net.InetAddress;
import java.net.InterfaceAddress;
import java.net.NetworkInterface;
import java.net.NoRouteToHostException;
import java.net.SocketException;
import java.net.UnknownHostException;
import java.net.*;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Enumeration;
Expand Down Expand Up @@ -339,9 +334,10 @@ public byte[] getGatewayHardware() {
return Endpoint.parseMacAddress(mWifiInfo.getBSSID());
}

@Nullable
public byte[] getLocalHardware() {
try {
return mInterface.getHardwareAddress();
return mInterface.getHardwareAddress(); //FIXME: #831
} catch (SocketException e) {
System.errorLogging(e);
}
Expand Down