AnsweredAssumed Answered

Wrapping apk error

Question asked by daniele.elia on Oct 29, 2015
Latest reply on Nov 10, 2015 by Martin_Carranza

Hello,

I'm trying to wrap an apk from command line (because from MAA site it's not working) and I have an error.

I don't have source code, only the apk; can you help me to understand it?

 

Thanks

 

This is the command output

 

[root@centosVM2 x]# ./wrap.sh -a TEST_1.0.apk -p Test_camdo.plist

checking for /usr/java/latest//bin/jarsigner ...

checking for TEST_1.0.apk ...

checking for Test_camdo.plist ...

checking for emm/conf/mdo.keystore ...

/root/x/emm

Using JAVA_HOME=/usr/java/latest/

APK File: TEST_1.0.apk

Plist: Test_camdo.plist

Keystore: emm/conf/mdo.keystore

Wrapper: ca-maa-android-sdk-wrapper-15.2.jar

Certificate Password: *******

Keystore Password: *******

Alias: mdo

/usr/java/latest//bin/java -jar ca-maa-android-sdk-wrapper-15.2.jar -apk TEST_1.0.apk -plist Test_camdo.plist -rules emm/conf/android.xml -keystore emm/conf/mdo.keystore -storepass mobiledevops -keypass mobiledevops -buildtype release -alias mdo

Step 1 of 4: Extracting Target APK: TEST_1.0.apk

Step 2 of 4: Instrumenting ......

Step 3 of 4: Packaging instrumented APK.

^[[6~^[[6~/tmp/AndroidWrapper_91710625057882541408517645720855___5489337/apktoolExtract/res/values-v23/styles.xml:5: error: Error retrieving parent for item: No resource found that matches the given name '@android:style/AlertDialog'.

 

 

/tmp/AndroidWrapper_91710625057882541408517645720855___5489337/apktoolExtract/res/values-v23/styles.xml:6: error: Error retrieving parent for item: No resource found that matches the given name '@android:style/DialogWindowTitle'.

 

 

Exception in thread "main" brut.androlib.AndrolibException: brut.androlib.AndrolibException: brut.common.BrutException: could not exec command: [/tmp/brut_util_Jar_9063816268722799167.tmp, p, --forced-package-id, 127, --min-sdk-version, 14, --target-sdk-version, 23, --version-code, 1, --version-name, 1.0, -F, /tmp/APKTOOL5006536585363267431.tmp, -0, arsc, -I, /root/apktool/framework/1.apk, -S, /tmp/AndroidWrapper_91710625057882541408517645720855___5489337/apktoolExtract/res, -M, /tmp/AndroidWrapper_91710625057882541408517645720855___5489337/apktoolExtract/AndroidManifest.xml]

  at brut.androlib.Androlib.buildResourcesFull(Androlib.java:442)

  at brut.androlib.Androlib.buildResources(Androlib.java:379)

  at brut.androlib.Androlib.build(Androlib.java:282)

  at brut.androlib.Androlib.build(Androlib.java:255)

  at brut.apktool.Main.cmdBuild(Main.java:225)

  at brut.apktool.Main.main(Main.java:84)

Caused by: brut.androlib.AndrolibException: brut.common.BrutException: could not exec command: [/tmp/brut_util_Jar_9063816268722799167.tmp, p, --forced-package-id, 127, --min-sdk-version, 14, --target-sdk-version, 23, --version-code, 1, --version-name, 1.0, -F, /tmp/APKTOOL5006536585363267431.tmp, -0, arsc, -I, /root/apktool/framework/1.apk, -S, /tmp/AndroidWrapper_91710625057882541408517645720855___5489337/apktoolExtract/res, -M, /tmp/AndroidWrapper_91710625057882541408517645720855___5489337/apktoolExtract/AndroidManifest.xml]

  at brut.androlib.res.AndrolibResources.aaptPackage(AndrolibResources.java:504)

  at brut.androlib.Androlib.buildResourcesFull(Androlib.java:428)

  ... 5 more

Caused by: brut.common.BrutException: could not exec command: [/tmp/brut_util_Jar_9063816268722799167.tmp, p, --forced-package-id, 127, --min-sdk-version, 14, --target-sdk-version, 23, --version-code, 1, --version-name, 1.0, -F, /tmp/APKTOOL5006536585363267431.tmp, -0, arsc, -I, /root/apktool/framework/1.apk, -S, /tmp/AndroidWrapper_91710625057882541408517645720855___5489337/apktoolExtract/res, -M, /tmp/AndroidWrapper_91710625057882541408517645720855___5489337/apktoolExtract/AndroidManifest.xml]

  at brut.util.OS.exec(OS.java:90)

  at brut.androlib.res.AndrolibResources.aaptPackage(AndrolibResources.java:498)

  ... 6 more

Step 4 of 4: Signing APK with dummy certificate.

jarsigner: unable to open jar file: /tmp/AndroidWrapper_91710625057882541408517645720855___5489337/manifest_modded_TEST_1.0.apk

ERROR: jar signing failed...

ERROR: Exiting, Signing APK failed!

Exception: Exiting, Signing APK failed!

java.lang.Exception: Exiting, Signing APK failed!

  at com.ca.android.wrapper.Wrapper.startWrapping(Wrapper.java:181)

  at com.ca.android.wrapper.Wrapper.doWrap(Wrapper.java:62)

  at com.ca.android.wrapper.Wrapper.doWrap(Wrapper.java:36)

  at com.ca.android.wrapper.CAAPKWrapper.runWrapper(CAAPKWrapper.java:165)

  at com.ca.android.wrapper.CAAPKWrapper.main(CAAPKWrapper.java:156)

Total time: 111 secs

Outcomes