Closed arya6000 closed 3 years ago
Interesting. I wonder if this is at the source or resource level or somewhere during the rebuild process. Kotlin must be involved somehow.
I've downloaded application and thats about it.
A similar issue, likely related to kotlin, appears in the package com.xfinity.cloudtvr available on the US Google play store. I have tried the latest version of apktool both with -r and -s (as well as all combinations of those parameters without any changes to the APK or its assets). The resulting apk throws the same exception seen above.
One thing of note: When comparing the original APK with the output APK from apktool, a kotlin top level directory present in the original is missing in the output (./kotlin is in the original but missing entirely from the output). This may be a regression of Issue #1520 and may be what is causing these issues. I have yet to try your commit at 93d61cc that originally fixed this issue to confirm however.
Thanks for the research. I was pretty sure I wrote a test for this, but I guess not. I'll take another look for that directory to ensure its being treated properly.
I have tracked down the issue I am seeing. Basically what is going on is that the kotlin directory is simply not being copied in Androlib.java during the build process (void build(ExtFile appDir, File outFile)). Locally I have fixed this issue by adding a buildlibrary call to copy the kotlin directory (i.e. buildLibrary(appDir, "kotlin");).
I am not sure if this will resolve the issue the original poster had and I am not sure if this is the correct way to fix this issue (i.e. falling in line with the coding style/convention of the project, likely should be a call such as buildKotlin() or something similar). I can make this small patch available if desired (though you can likely make the patch in 10 seconds yourself).
Thanks for the research. That was indeed it. This does pose an interesting problem. Here is the original application:
➜ Bug1703 unzip -l tinder.apk | grep kotlin
5995 00-00-1980 00:00 META-INF/Tinder_release.kotlin_module
158 00-00-1980 00:00 META-INF/aggregator_release.kotlin_module
78 00-00-1980 00:00 META-INF/api_release.kotlin_module
2675 00-00-1980 00:00 META-INF/core.kotlin_module
1816 00-00-1980 00:00 META-INF/data_release.kotlin_module
363 00-00-1980 00:00 META-INF/domain_release.kotlin_module
80 00-00-1980 00:00 META-INF/engine_release.kotlin_module
360 00-00-1980 00:00 META-INF/kotlin-reflection.kotlin_module
246 00-00-1980 00:00 META-INF/kotlin-runtime.kotlin_module
43 00-00-1980 00:00 META-INF/kotlin-stdlib-jre7.kotlin_module
2190 00-00-1980 00:00 META-INF/kotlin-stdlib.kotlin_module
59 00-00-1980 00:00 META-INF/moshi-kotlin.kotlin_module
187 00-00-1980 00:00 META-INF/purchase_release.kotlin_module
121 00-00-1980 00:00 META-INF/services/kotlin.reflect.jvm.internal.impl.builtins.BuiltInsLoader
471 00-00-1980 00:00 META-INF/services/kotlin.reflect.jvm.internal.impl.resolve.ExternalOverridabilityCondition
59 00-00-1980 00:00 META-INF/shimmy_release.kotlin_module
782 00-00-1980 00:00 META-INF/superlikeable_release.kotlin_module
57 00-00-1980 00:00 META-INF/tooltip_release.kotlin_module
303 00-00-1980 00:00 META-INF/util.runtime.kotlin_module
926 00-00-1980 00:00 kotlin/annotation/annotation.kotlin_builtins
3689 00-00-1980 00:00 kotlin/collections/collections.kotlin_builtins
726 00-00-1980 00:00 kotlin/internal/internal.kotlin_builtins
14202 00-00-1980 00:00 kotlin/kotlin.kotlin_builtins
2296 00-00-1980 00:00 kotlin/ranges/ranges.kotlin_builtins
4866 00-00-1980 00:00 kotlin/reflect/reflect.kotlin_builtins
Bringing notice to the kotlin files in META-INF
. Now the decoded and rebuilt application.
➜ dist unzip -l tinder.apk | grep kotlin
926 12-31-1980 19:00 kotlin/annotation/annotation.kotlin_builtins
3689 12-31-1980 19:00 kotlin/collections/collections.kotlin_builtins
726 12-31-1980 19:00 kotlin/internal/internal.kotlin_builtins
14202 12-31-1980 19:00 kotlin/kotlin.kotlin_builtins
2296 12-31-1980 19:00 kotlin/ranges/ranges.kotlin_builtins
4866 12-31-1980 19:00 kotlin/reflect/reflect.kotlin_builtins
➜ dist
We obviously strip signatures so those kotlin META-INF files are gone. You can preserve them however using the -c
flag during decode and build. Patch should be up soon, not sure if it'll resolve this as I haven't tested on device yet but will do that when able.
After just locating this issue, I just wanted to bring the following to your attention since it's regarding a similar situation as described and updated as well...
https://github.com/iBotPeaches/Apktool/issues/1860
Thanks a bunch! 👍
~Ibuprophen
Facing same problem on a Kotlin app. Using --copy-original
results in Kotlin files being copied over, but gives INSTALL_PARSE_FAILED_NO_CERTIFICATES
on installation. I did manually sign it with jarsigner
.
EDIT: if using --copy-original
the RSA, SF and MF files need to be manually purged from META-INF
prior to signing the APK with jarsigner
.
I can't really investigate this anymore. Sorry for 2-3 year delay.
It looks like we had to remove this app because of a DMCA takedown by Tinder.
Closing.
Information
apktool -version
) - 2.3.1Stacktrace/Logcat
Steps to Reproduce
Frameworks
If this APK is from an OEM ROM (Samsung, HTC, LG). Please attach framework files (
.apks
that live in/system/framework
or/system/priv-app
)APK
If this APK can be freely shared, please upload/attach a link to it. https://www.apkmirror.com/apk/tinder/tinder-tinder/tinder-tinder-8-4-1-release/tinder-8-4-1-android-apk-download/
Questions to ask before submission
apktool d
,apktool b
without changing anything? YesAfter installing the repackaged APK the app opens with no errors, and I can login to Facebook successfully. However after logging in, the app crashes with the logcat message.