Skip to content
This repository has been archived by the owner on Sep 6, 2019. It is now read-only.

Commit

Permalink
Added restrictions InetAddress.get(All)ByNameOnNet
Browse files Browse the repository at this point in the history
Refs #1757
  • Loading branch information
M66B committed Dec 15, 2014
1 parent 5378bbd commit 16f84e1
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ Changelog
* Added restrictions for [UsageStatsManager](https://developer.android.com/reference/android/app/usage/UsageStatsManager.html) ([issue](/../../issues/1757))
* Added restrictions *IpPrefix.getAddress* and *IpPrefix.getRawAddress* ([issue](/../../issues/1757))
* Added restrictions for [LinkProperties](http://developer.android.com/reference/android/net/LinkProperties.html)
* Added restrictions *InetAddress.getAllByNameOnNet* and *InetAddress.getByNameOnNet* ([issue](/../../issues/1757))

[Open issues](https://github.com/M66B/XPrivacy/issues?state=open)

Expand Down
2 changes: 2 additions & 0 deletions res/values/functions.xml
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,10 @@
<string name="internet_WiFi_getConnectionInfo" translatable="false"><![CDATA[<a href="https://developer.android.com/reference/android/net/wifi/SupplicantState.html">Google documentation</a>]]></string>
<string name="internet_WiFi_Srv_getConnectionInfo" translatable="false"><![CDATA[<a href="https://developer.android.com/reference/android/net/wifi/SupplicantState.html">Google documentation</a>]]></string>
<string name="internet_InetAddress_getAllByName" translatable="false"><![CDATA[<a href="https://developer.android.com/reference/java/net/InetAddress.html#getAllByName(java.lang.String)">Google documentation</a>]]></string>
<string name="internet_InetAddress_getAllByNameOnNet" translatable="false"><![CDATA[<a href="https://developer.android.com/reference/android/net/Network.html#getAllByName(java.lang.String)">Google documentation</a>]]></string>
<string name="internet_InetAddress_getByAddress" translatable="false"><![CDATA[<a href="https://developer.android.com/reference/java/net/InetAddress.html#getByAddress(java.lang.String,%20byte[])">Google documentation</a>]]></string>
<string name="internet_InetAddress_getByName" translatable="false"><![CDATA[<a href="https://developer.android.com/reference/java/net/InetAddress.html#getByName(java.lang.String)">Google documentation</a>]]></string>
<string name="internet_InetAddress_getByNameOnNet" translatable="false"><![CDATA[<a href="https://developer.android.com/reference/android/net/Network.html#getByName(java.lang.String)">Google documentation</a>]]></string>
<string name="internet_IpPrefix_getAddress" translatable="false"><![CDATA[<a href="https://developer.android.com/reference/android/net/IpPrefix.html#getAddress()">Google documentation</a>]]></string>
<string name="internet_IpPrefix_getRawAddress" translatable="false"><![CDATA[<a href="https://developer.android.com/reference/android/net/IpPrefix.html#getRawAddress()">Google documentation</a>]]></string>
<string name="internet_LinkProperties_getAddresses" translatable="false"><![CDATA[<a href="https://developer.android.com/reference/android/net/LinkProperties.html#getLinkAddresses()">Google documentation</a>]]></string>
Expand Down
2 changes: 2 additions & 0 deletions src/biz/bokhorst/xprivacy/Meta.java
Original file line number Diff line number Diff line change
Expand Up @@ -177,8 +177,10 @@ public static List<Hook> get() {

// java.net.InetAddress
mListHook.add(new Hook("internet", "InetAddress.getAllByName", "INTERNET", 1, null, null).unsafe().dangerous().whitelist(cTypeIPAddress));
mListHook.add(new Hook("internet", "InetAddress.getAllByNameOnNet", "INTERNET", 21, "3.5.6", null).unsafe().dangerous().whitelist(cTypeIPAddress));
mListHook.add(new Hook("internet", "InetAddress.getByAddress", "INTERNET", 1, null, null).unsafe().dangerous().whitelist(cTypeIPAddress));
mListHook.add(new Hook("internet", "InetAddress.getByName", "INTERNET", 1, null, null).unsafe().dangerous().whitelist(cTypeIPAddress));
mListHook.add(new Hook("internet", "InetAddress.getByNameOnNet", "INTERNET", 21, "3.5.6", null).unsafe().dangerous().whitelist(cTypeIPAddress));

// android.net.IpPrefix
mListHook.add(new Hook("internet", "IpPrefix.getAddress", null, 21, "3.5.6", null).dangerous().unsafe());
Expand Down
5 changes: 4 additions & 1 deletion src/biz/bokhorst/xprivacy/XInetAddress.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,17 @@ public String getClassName() {
}

// public static InetAddress[] getAllByName(String host)
// public static InetAddress[] getAllByNameOnNet(String host, int netId)
// public static InetAddress getByAddress(byte[] ipAddress)
// public static InetAddress getByAddress(String hostName, byte[] ipAddress)
// public static InetAddress getByName(String host)
// public static InetAddress getByNameOnNet(String host, int netId)
// libcore/luni/src/main/java/java/net/InetAddress.java
// http://developer.android.com/reference/java/net/InetAddress.html
// http://grepcode.com/file/repository.grepcode.com/java/ext/com.google.android/android/5.0.0_r1/android/net/Network.java

private enum Methods {
getAllByName, getByAddress, getByName
getAllByName, getAllByNameOnNet, getByAddress, getByName, getByNameOnNet
};

public static List<XHook> getInstances() {
Expand Down

0 comments on commit 16f84e1

Please sign in to comment.