[Soot-list] Log-statement-insertion into apk file.

Marc-André Laverdière marc-andre.laverdiere-papineau at polymtl.ca
Wed May 14 08:58:19 EDT 2014


Hallo Sarah,

What do you mean by 'none of them was helpful'?
As a general thing, the biggest issues I'd see with that kind of
invocation is a) are you in the right working directory and b) if you
are running from your IDE, you probably don't have the environment
variables set like in your shell. So PATH would be different, maybe
JAVA_HOME is not set, things like that.

Marc-André Laverdière-Papineau
Doctorant - PhD Candidate

On 05/13/2014 08:58 PM, H S wrote:
> Hi:
> Maybe its nor too related to this soot list, but I would be thankful if
> you could me help on the following question.
> According to the paper Instrumenting Android apps as easy as ABC, I want
> to sign apk files inside my java source file using jarsigner.exe on
> which there is an example in this paper.
> I wanted to implement automatically running/executing jarsigner using
> Runtime. Exec() or ProcessBuilder, etc.
> But none of them was helpful.
> However via cmd.exe I can sign my apk.
> Any suggestions would be appreciated.
> Sarah
> 
> Gesendet über Yahoo Mail für Android
> 
> 
> ------------------------------------------------------------------------
> *From: * Steven Arzt <Steven.Arzt at cased.de>;
> *To: * 'H S' <aras_h1988 at yahoo.com>; 'soot-list at CS.McGill.CA'
> <soot-list at cs.mcgill.ca>; 'Siegfried Rasthofer'
> <siegfried.rasthofer at cased.de>; <soot-list at sable.mcgill.ca>;
> *Subject: * AW: Log-statement-insertion into apk file.
> *Sent: * Mon, May 12, 2014 8:40:59 AM
> 
> Hi Sarah,
> 
>  
> 
> Your signature looks wrong. This might be a problem with the encoding in
> the e-mail, but to me it looks like you are missing some blanks:
> 
>  
> 
>                 <android.util.Log: int i(java.lang.String,java.lang.String)>
> 
>  
> 
> You should also make sure that your android.jar file from the Android
> SDK is on the Soot classpath. Soot places it there automatically unless
> you explicitly specify your own classpath. In the latter case you have
> to make sure to add it on your own. Next, after getting your classpath
> right (and optionally specifying previously unreferenced classes as
> basic classes), you need to tell Soot to load the required classes.
> Please stick to the tutorials as they have been tested and are known to
> work:
> 
>  
> 
>                 http://sseblog.ec-spride.de/tutorials/
> 
>  
> 
> Best regards,
> 
>   Steven
> 
>  
> 
> *Von:*H S [mailto:aras_h1988 at yahoo.com]
> *Gesendet:* Montag, 12. Mai 2014 00:48
> *An:* soot-list at CS.McGill.CA; Steven Arzt; 'Siegfried Rasthofer';
> soot-list at sable.mcgill.ca
> *Betreff:* Log-statement-insertion into apk file.
> 
>  
> 
> Hi :
> 
>  
> 
> I want to add Log statement into an apk file. 
> 
>  
> 
> Here is my code:
> 
>  
> 
> Scene.v().addBasicClass("android.util.Log",SootClass.SIGNATURES);
> 
> SootMethod
> sm=Scene.v().getMethod(<android.util.Log:inti(java.lang.String,java.lang.String)>");
> 
> Value logType = StringConstant.v("INFO");
> 
> Value logMessage = StringConstant.v("Inserted Log after show()");
> 
> StaticInvokeExpr invokeExpr =
> Jimple.v().newStaticInvokeExpr(sm.makeRef(), logType, logMessage);
> 
> Unit generated = Jimple.v().newInvokeStmt(invokeExpr);
> 
>  
> 
> Here is Run-result
> 
> Exception in thread "main" java.lang.RuntimeException: tried to get
> nonexistent method <android.util.Log: int
> i(java.lang.String,java.lang.String)>
> 
>      at soot.Scene.getMethod(Scene.java:613)
> 
>  
> 
> I also used instead of addBasicClass Method, this following lines:
> 
>  
> 
> SootClass logClass = Scene.v().loadClassAndSupport("android.util.Log");
> 
>         SootMethod sm = logClass.getMethod("<android.util.Log: int
> i(java.lang.String,java.lang.String)>");
> 
>  
> 
> But I get:
> 
> Exception in thread "main" java.lang.RuntimeException: This operation
> requires resolving level SIGNATURES but android.util.Log is at resolving
> level HIERARCHY
> 
> If you are extending Soot, try to add the following call before calling
> soot.Main.main(..):
> 
> Scene.v().addBasicClass(android.util.Log,SIGNATURES);
> 
> Otherwise, try whole-program mode (-w).
> 
>  
> 
> I have also added Options.v().set_whole_program(true);
> 
> But it wasn't helpful. 
> 
>  
> 
> Any suggestion would be appreciated.
> 
>  
> 
> Sarah
> 
>  
> 
> 
> 
> _______________________________________________
> Soot-list mailing list
> Soot-list at CS.McGill.CA
> https://mailman.CS.McGill.CA/mailman/listinfo/soot-list
> 


More information about the Soot-list mailing list