[Gsmmap] [PATCH] MsdService: fix crash due to missing java.lang.ProcessManager$ProcessImpl in Android 7.0

Emanuel emanuel at srlabs.de
Fri Dec 16 10:30:49 CET 2016


Dear Vedant,

Thank you so much for providing us with a useful patch. It will surely
be implemented in the next release. If you find any other solutions to
new incompatibilities, please let us know here or send us a private
message to: snoopsnitch at srlabs.de.

Best Regards,
Emanuel
(Security Research Labs)


On 2016-12-15 2:41 PM, Vedant Lath wrote:
> Android 7.0 shifted to using OpenJDK class library which has
> java.lang.UNIXProcess instead of java.lang.ProcessManager$ProcessImpl
> ---
>  SnoopSnitch/src/de/srlabs/snoopsnitch/qdmon/MsdService.java | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/SnoopSnitch/src/de/srlabs/snoopsnitch/qdmon/MsdService.java b/SnoopSnitch/src/de/srlabs/snoopsnitch/qdmon/MsdService.java
> index 3e95716..e9a9a09 100644
> --- a/SnoopSnitch/src/de/srlabs/snoopsnitch/qdmon/MsdService.java
> +++ b/SnoopSnitch/src/de/srlabs/snoopsnitch/qdmon/MsdService.java
> @@ -1992,7 +1992,7 @@ public class MsdService extends Service{
>  		// data like the process id). However, the actual class of the
>  		// process does contain a pid field (declared as private), which can be
>  		// accessed via reflection.
> -		if(parser.getClass().getName().equals("java.lang.ProcessManager$ProcessImpl")) {
> +		if(parser.getClass().getName().equals("java.lang.ProcessManager$ProcessImpl") || parser.getClass().getName().equals("java.lang.UNIXProcess")) {
>  			try {
>  				Field f = parser.getClass().getDeclaredField("pid");
>  				f.setAccessible(true);
> @@ -2049,7 +2049,7 @@ public class MsdService extends Service{
>  				ok = false;
>  			}
>  		} else{
> -			handleFatalError("Failed to get parser pid, parser class name is " + parser.getClass().getName() + " instead of java.lang.ProcessManager$ProcessImpl");
> +			handleFatalError("Failed to get parser pid, parser class name is " + parser.getClass().getName() + " instead of java.lang.ProcessManager$ProcessImpl or java.lang.UNIXProcess");
>  			ok = false;
>  		}
>  		// TODO: Maybe check memory usage of this Service process as well.
> 




More information about the Gsmmap mailing list