From 16f84e171cb91cc051617a097daa73fab682223c Mon Sep 17 00:00:00 2001 From: M66B Date: Mon, 15 Dec 2014 11:08:59 +0100 Subject: [PATCH] Added restrictions InetAddress.get(All)ByNameOnNet Refs #1757 --- CHANGELOG.md | 1 + res/values/functions.xml | 2 ++ src/biz/bokhorst/xprivacy/Meta.java | 2 ++ src/biz/bokhorst/xprivacy/XInetAddress.java | 5 ++++- 4 files changed, 9 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 560ee3b46..ee36bf919 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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) diff --git a/res/values/functions.xml b/res/values/functions.xml index 593604792..247326b10 100644 --- a/res/values/functions.xml +++ b/res/values/functions.xml @@ -118,8 +118,10 @@ Google documentation]]> Google documentation]]> Google documentation]]> + Google documentation]]> Google documentation]]> Google documentation]]> + Google documentation]]> Google documentation]]> Google documentation]]> Google documentation]]> diff --git a/src/biz/bokhorst/xprivacy/Meta.java b/src/biz/bokhorst/xprivacy/Meta.java index 3296320b0..25bdf8a3d 100644 --- a/src/biz/bokhorst/xprivacy/Meta.java +++ b/src/biz/bokhorst/xprivacy/Meta.java @@ -177,8 +177,10 @@ public static List 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()); diff --git a/src/biz/bokhorst/xprivacy/XInetAddress.java b/src/biz/bokhorst/xprivacy/XInetAddress.java index 4cd5d52f7..e1a100743 100644 --- a/src/biz/bokhorst/xprivacy/XInetAddress.java +++ b/src/biz/bokhorst/xprivacy/XInetAddress.java @@ -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 getInstances() {