apktools and admob: not working #623

Closed
iBotPeaches opened this Issue Mar 18, 2015 · 15 comments

Comments

Projects
None yet
1 participant
@iBotPeaches
Owner

iBotPeaches commented Mar 18, 2015

Original issue 513 created by euquiq on 2013-09-10T15:37:50.000Z:

What steps will reproduce the problem?

  1. Any Apk including

<activity android:name="com.google.ads.AdActivity" android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize"/>

in its AndroidManifest.xml

  1. Any min Sdk or target Sdk (I am using Min=8 Target=17 but I tried 4,13 ... 7,15 .... 8,17, etc etc.
    3.

What is the expected output? What do you see instead?

After decompiling, the AndroidManifest.xml shows:

<activity android:name="com.google.ads.AdActivity" android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode"/>

Notice the missing "|screenSize|smallestScreenSize"

What version of the product are you using? On what operating system?

Windows 2003, I tried Apktools 1.5.1 and 1.5.2 ... currently I am trying with apktools.jar beta version 5, just in case, but every version has the same behavior.

Please provide any additional information below.

As a result, the recompiled APK wont show admob ads, but instead the dreaded red box stating that there is something missing in the AndroidManifest.xml

After decompiling, I also tried to manually edit the AndroidManifest.XML and add the "|screenSize|smallestScreenSize" but then when recompiling, the apktool throws the following error:

Error: String types not allowed (at 'configChanges' with value 'keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize')

@iBotPeaches

This comment has been minimized.

Show comment
Hide comment
@iBotPeaches

iBotPeaches Mar 18, 2015

Owner

Comment #1 originally posted by connor.tumbleson on 2013-09-10T16:01:34.000Z:

Since this bug has been reported 12031023120 times and comes and goes. I'll need to do some deeper research.

The "String types" isn't an apktool error. That is AAPT. That makes me think that there is a newer Admob SDK that maybe you aren't using.

Either way smallestScreenSize and screenSize I see http://developer.android.com/guide/topics/manifest/activity-element.html#config there, so it shouldn't be stripping them.

Can I have the apk? If not, just hook the admob SDK into a test apk for me and attach that. I'll take a look this weekend.

Owner

iBotPeaches commented Mar 18, 2015

Comment #1 originally posted by connor.tumbleson on 2013-09-10T16:01:34.000Z:

Since this bug has been reported 12031023120 times and comes and goes. I'll need to do some deeper research.

The "String types" isn't an apktool error. That is AAPT. That makes me think that there is a newer Admob SDK that maybe you aren't using.

Either way smallestScreenSize and screenSize I see http://developer.android.com/guide/topics/manifest/activity-element.html#config there, so it shouldn't be stripping them.

Can I have the apk? If not, just hook the admob SDK into a test apk for me and attach that. I'll take a look this weekend.

@iBotPeaches

This comment has been minimized.

Show comment
Hide comment
@iBotPeaches

iBotPeaches Mar 18, 2015

Owner

Comment #2 originally posted by euquiq on 2013-09-10T18:05:37.000Z:

Hi Connor! I am using latest Admob SDK. Let me attach an apk that depicts the problem, and thank you for your time!

Owner

iBotPeaches commented Mar 18, 2015

Comment #2 originally posted by euquiq on 2013-09-10T18:05:37.000Z:

Hi Connor! I am using latest Admob SDK. Let me attach an apk that depicts the problem, and thank you for your time!

@iBotPeaches

This comment has been minimized.

Show comment
Hide comment
@iBotPeaches

iBotPeaches Mar 18, 2015

Owner

Comment #3 originally posted by euquiq on 2013-09-14T14:56:55.000Z:

Quick reminder, that the "issuer" has posted the requested data :)

Owner

iBotPeaches commented Mar 18, 2015

Comment #3 originally posted by euquiq on 2013-09-14T14:56:55.000Z:

Quick reminder, that the "issuer" has posted the requested data :)

@iBotPeaches

This comment has been minimized.

Show comment
Hide comment
@iBotPeaches

iBotPeaches Mar 18, 2015

Owner

Comment #4 originally posted by connor.tumbleson on 2013-09-14T15:02:46.000Z:

I just decompiled on an internal 2.0b6 build and I think everything worked out fine.

I ran apktool d webviewer.apk, with no files in $HOME/apktool/framework

and examining the manifest, I get this: http://pastebin.com/hssTyncv

Looks fine to me. Though, I am on Ubuntu 13.10. I'll go check on a Windows computer.

Owner

iBotPeaches commented Mar 18, 2015

Comment #4 originally posted by connor.tumbleson on 2013-09-14T15:02:46.000Z:

I just decompiled on an internal 2.0b6 build and I think everything worked out fine.

I ran apktool d webviewer.apk, with no files in $HOME/apktool/framework

and examining the manifest, I get this: http://pastebin.com/hssTyncv

Looks fine to me. Though, I am on Ubuntu 13.10. I'll go check on a Windows computer.

@iBotPeaches

This comment has been minimized.

Show comment
Hide comment
@iBotPeaches

iBotPeaches Mar 18, 2015

Owner

Comment #5 originally posted by euquiq on 2013-09-14T15:07:56.000Z:

That manifest seems to be quite OK :) maybe in 2.0b6 is fixed ? if you may point me into the 2.06b jar I will be more than glad to try !!

Owner

iBotPeaches commented Mar 18, 2015

Comment #5 originally posted by euquiq on 2013-09-14T15:07:56.000Z:

That manifest seems to be quite OK :) maybe in 2.0b6 is fixed ? if you may point me into the 2.06b jar I will be more than glad to try !!

@iBotPeaches

This comment has been minimized.

Show comment
Hide comment
@iBotPeaches

iBotPeaches Mar 18, 2015

Owner

Comment #6 originally posted by connor.tumbleson on 2013-09-14T15:11:45.000Z:

I'll get a 2.0b6 out today sometime. I just tested on my Win 8.1 computer and all is good. I can't think of any change I did related to Manifests between 2b5 and 2b6, but I can't seem to duplicate this :/

http://pastebin.com/6G1cKtqP (Win8 decompiled)

Owner

iBotPeaches commented Mar 18, 2015

Comment #6 originally posted by connor.tumbleson on 2013-09-14T15:11:45.000Z:

I'll get a 2.0b6 out today sometime. I just tested on my Win 8.1 computer and all is good. I can't think of any change I did related to Manifests between 2b5 and 2b6, but I can't seem to duplicate this :/

http://pastebin.com/6G1cKtqP (Win8 decompiled)

@iBotPeaches

This comment has been minimized.

Show comment
Hide comment
@iBotPeaches

iBotPeaches Mar 18, 2015

Owner

Comment #7 originally posted by connor.tumbleson on 2013-09-14T17:48:35.000Z:

Give this a shot: http://miui.connortumbleson.com/other/apktool/test_versions/apktool_2.0.0b6.jar

Owner

iBotPeaches commented Mar 18, 2015

Comment #7 originally posted by connor.tumbleson on 2013-09-14T17:48:35.000Z:

Give this a shot: http://miui.connortumbleson.com/other/apktool/test_versions/apktool_2.0.0b6.jar

@iBotPeaches

This comment has been minimized.

Show comment
Hide comment
@iBotPeaches

iBotPeaches Mar 18, 2015

Owner

Comment #8 originally posted by euquiq on 2013-09-14T18:59:09.000Z:

Hi Connor, I just tried... with the exact same apk I gave you, erasing the file in $HOME/apktool/framework, when I view the decompiled Androidmanifest.xml I get the dreaded:

And hence, when I recompile it, the admob ads are not showing :( just as before.

C:\android\webviewer\prueba>apktool d webviewer.apk
I: Baksmaling...
I: Loading resource table...
I: Loaded.
I: Loading resource table from file: C:\Documents and Settings\Administrador\apk
tool\framework\1.apk
I: Loaded.
I: Decoding file-resources...
I: Decoding values_/_ XMLs...
I: Done.
I: Copying assets and libs...

C:\android\webviewer\prueba>type webviewer\androidmanifest.xml







<uses-permission android:name="android.permission.VIBRATE" />
<application android:label="Web2Apk" android:icon="@drawable/icon">
    <activity android:name="com.google.ads.AdActivity" android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode" />
    <activity android:label="Web2Apk" android:name=".main" android:launchMode="singleTop" android:screenOrientation="unspecified" android:windowSoftInputMode="stateHidden" android:hardwareAccelerated="true">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>
    <service android:name=".svcdownload" />
    <receiver android:name=".svcdownload$svcdownload_BR" />
</application>

C:\android\webviewer\prueba>

Owner

iBotPeaches commented Mar 18, 2015

Comment #8 originally posted by euquiq on 2013-09-14T18:59:09.000Z:

Hi Connor, I just tried... with the exact same apk I gave you, erasing the file in $HOME/apktool/framework, when I view the decompiled Androidmanifest.xml I get the dreaded:

And hence, when I recompile it, the admob ads are not showing :( just as before.

C:\android\webviewer\prueba>apktool d webviewer.apk
I: Baksmaling...
I: Loading resource table...
I: Loaded.
I: Loading resource table from file: C:\Documents and Settings\Administrador\apk
tool\framework\1.apk
I: Loaded.
I: Decoding file-resources...
I: Decoding values_/_ XMLs...
I: Done.
I: Copying assets and libs...

C:\android\webviewer\prueba>type webviewer\androidmanifest.xml







<uses-permission android:name="android.permission.VIBRATE" />
<application android:label="Web2Apk" android:icon="@drawable/icon">
    <activity android:name="com.google.ads.AdActivity" android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode" />
    <activity android:label="Web2Apk" android:name=".main" android:launchMode="singleTop" android:screenOrientation="unspecified" android:windowSoftInputMode="stateHidden" android:hardwareAccelerated="true">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>
    <service android:name=".svcdownload" />
    <receiver android:name=".svcdownload$svcdownload_BR" />
</application>

C:\android\webviewer\prueba>

@iBotPeaches

This comment has been minimized.

Show comment
Hide comment
@iBotPeaches

iBotPeaches Mar 18, 2015

Owner

Comment #9 originally posted by connor.tumbleson on 2013-09-14T19:01:26.000Z:

I have no idea then. I can't confirm on either my Ubuntu or Windows computer.

Are you sure you are running 2b6? I removed the "Loaded." messages, so that doesn't appear to be 2b6.

Owner

iBotPeaches commented Mar 18, 2015

Comment #9 originally posted by connor.tumbleson on 2013-09-14T19:01:26.000Z:

I have no idea then. I can't confirm on either my Ubuntu or Windows computer.

Are you sure you are running 2b6? I removed the "Loaded." messages, so that doesn't appear to be 2b6.

@iBotPeaches

This comment has been minimized.

Show comment
Hide comment
@iBotPeaches

iBotPeaches Mar 18, 2015

Owner

Comment #10 originally posted by euquiq on 2013-09-14T20:33:28.000Z:

Thank you Connor. I feel quite stupid, I did copy the new apktool.jar into my working directory, where the apktool.bat file was.

Because of your last comment, I did a disk-wide search of apktool.jar and found it inside c:/windows ... I replaced THAT apktool.jar and things started working OK ! Your 2.06b is working as a charm. This seems to have been the problem with the earlier versions I tried too.

Mistery solved. Sorry to use up your time like this. Thanks !

Owner

iBotPeaches commented Mar 18, 2015

Comment #10 originally posted by euquiq on 2013-09-14T20:33:28.000Z:

Thank you Connor. I feel quite stupid, I did copy the new apktool.jar into my working directory, where the apktool.bat file was.

Because of your last comment, I did a disk-wide search of apktool.jar and found it inside c:/windows ... I replaced THAT apktool.jar and things started working OK ! Your 2.06b is working as a charm. This seems to have been the problem with the earlier versions I tried too.

Mistery solved. Sorry to use up your time like this. Thanks !

@iBotPeaches

This comment has been minimized.

Show comment
Hide comment
@iBotPeaches

iBotPeaches Mar 18, 2015

Owner

Comment #11 originally posted by euquiq on 2013-09-14T20:40:55.000Z:

Maybe it is a good addition to place the version string as the first text when running apktool ? just before the I: Baksmaling ... it seems to be a pretty harmless piece of info that would hopefully prevent any further mistaking of apktool version misuse ?

Owner

iBotPeaches commented Mar 18, 2015

Comment #11 originally posted by euquiq on 2013-09-14T20:40:55.000Z:

Maybe it is a good addition to place the version string as the first text when running apktool ? just before the I: Baksmaling ... it seems to be a pretty harmless piece of info that would hopefully prevent any further mistaking of apktool version misuse ?

@iBotPeaches

This comment has been minimized.

Show comment
Hide comment
@iBotPeaches

iBotPeaches Mar 18, 2015

Owner

Comment #12 originally posted by connor.tumbleson on 2013-09-18T02:29:22.000Z:

There is the command apktool --version.

While this would be helpful to debug problems, I don't really want to add anymore output to apktool at all. Unless its useful to have like

Apktool x.x.x decoding filename....

(I've asked the IRC channel. I'll gather opinions. If you see a commit about it, I merged it).

Owner

iBotPeaches commented Mar 18, 2015

Comment #12 originally posted by connor.tumbleson on 2013-09-18T02:29:22.000Z:

There is the command apktool --version.

While this would be helpful to debug problems, I don't really want to add anymore output to apktool at all. Unless its useful to have like

Apktool x.x.x decoding filename....

(I've asked the IRC channel. I'll gather opinions. If you see a commit about it, I merged it).

@iBotPeaches

This comment has been minimized.

Show comment
Hide comment
@iBotPeaches

iBotPeaches Mar 18, 2015

Owner

Comment #13 originally posted by vaovao26 on 2013-09-19T14:39:45.000Z:

Can you clear your solutions?

I tried apktools 1.5.1, 1.5.2, 2.0.0bt5, 2.0.0bt6 ... :(

Owner

iBotPeaches commented Mar 18, 2015

Comment #13 originally posted by vaovao26 on 2013-09-19T14:39:45.000Z:

Can you clear your solutions?

I tried apktools 1.5.1, 1.5.2, 2.0.0bt5, 2.0.0bt6 ... :(

@iBotPeaches

This comment has been minimized.

Show comment
Hide comment
@iBotPeaches

iBotPeaches Mar 18, 2015

Owner

Comment #14 originally posted by hungnvdhbkvn on 2013-09-19T14:40:18.000Z:

Can you clear your solutions?

I tried apktools 1.5.1, 1.5.2, 2.0.0bt5, 2.0.0bt6 ... :(

Owner

iBotPeaches commented Mar 18, 2015

Comment #14 originally posted by hungnvdhbkvn on 2013-09-19T14:40:18.000Z:

Can you clear your solutions?

I tried apktools 1.5.1, 1.5.2, 2.0.0bt5, 2.0.0bt6 ... :(

@iBotPeaches

This comment has been minimized.

Show comment
Hide comment
@iBotPeaches

iBotPeaches Mar 18, 2015

Owner

Comment #15 originally posted by kkashi01 on 2013-12-29T17:07:52.000Z:

Hello, I have the same problem. I downloaded apktool_2.0.0b6.jar, still same issue. I have attached my .apk and appreciate all the help

java -jar apktool_2.0.0b6.jar d -s -f testAdMobAdAmazon.apk

kkashi01@gmail.com

Owner

iBotPeaches commented Mar 18, 2015

Comment #15 originally posted by kkashi01 on 2013-12-29T17:07:52.000Z:

Hello, I have the same problem. I downloaded apktool_2.0.0b6.jar, still same issue. I have attached my .apk and appreciate all the help

java -jar apktool_2.0.0b6.jar d -s -f testAdMobAdAmazon.apk

kkashi01@gmail.com

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment