title: how to run apktool from webcode (php)
body: <p>Essentially when a user uploads a .apk file I need to decode it and extract some information from the AndroidManifest.xml file inside the apk.
  When I run this command from command line <code>apktool decode BluetoothChat.apk</code> everything is fine.
  The output:</p>
  
  <pre><code>I: Baksmaling...
  I: Loading resource table...
  I: Loaded.
  I: Loading resource table from file: /home/tashax/apktool/framework/1.apk
  I: Loaded.
  I: Decoding file-resources...
  I: Decoding values*/* XMLs...
  I: Done.
  I: Copying assets and libs...
  </code></pre>
  
  <p>However, if I try to execute it from the webcode using php <code>exec()</code> function, I get an error. It fails on <code>I: Loading resource table from file: /home/tashax/apktool/framework/1.apk</code>, I'm thinking it cannot find the  framework/1.apk file . This seems to be the setup issue, had anyone done something similar or knows what I'm missing?
  Here's are the errors from apktool when ran from web:</p>
  
  <pre><code>I: Baksmaling... 
  I: Loading resource table... 
  I: Loaded. 
  W: Could not decode attr value, using undecoded value instead: ns=android, name=versionCode, value=0x00000001 
  W: Could not decode attr value, using undecoded value instead: ns=android, name=versionName, value=0x0000000d 
  Exception in thread "main" java.lang.NullPointerException at   java.io.Writer.write(Writer.java:157) 
  at brut.androlib.res.util.ExtMXSerializer.writeAttributeValue(ExtMXSerializer.java:38) 
  at org.xmlpull.mxp1_serializer.MXSerializer.attribute(MXSerializer.java:673) 
  at   org.xmlpull.v1.wrapper.classic.XmlSerializerDelegate.attribute(XmlSerializerDelegate.java:106) 
  at org.xmlpull.v1.wrapper.classic.StaticXmlSerializerWrapper.writeStartTag(StaticXmlSerializerWrapper.java:267) 
  at org.xmlpull.v1.wrapper.classic.StaticXmlSerializerWrapper.event(StaticXmlSerializerWrapper.java:211) 
  at brut.androlib.res.decoder.XmlPullStreamDecoder.decode(XmlPullStreamDecoder.java:46) 
  at  brut.androlib.res.decoder.ResStreamDecoderContainer.decode(ResStreamDecoderContainer.java:34) 
  at brut.androlib.res.decoder.ResFileDecoder.decode(ResFileDecoder.java:100) 
  at brut.androlib.res.AndrolibResources.decode(AndrolibResources.java:114) 
  at brut.androlib.Androlib.decodeResourcesFull(Androlib.java:93) 
  at brut.androlib.ApkDecoder.decode(ApkDecoder.java:98) 
  at brut.apktool.Main.cmdDecode(Main.java:128) 
  at brut.apktool.Main.main(Main.java:65)
  </code></pre>
  
  <p>Thanks!</p>