Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

META-INF CERT.RSA not detected #938

Open
vitaminac opened this issue May 8, 2021 · 9 comments
Open

META-INF CERT.RSA not detected #938

vitaminac opened this issue May 8, 2021 · 9 comments

Comments

@vitaminac
Copy link

vitaminac commented May 8, 2021

The latest version of calabash-android has problem detecting CERT.RSA file.

C:\Users\xxxxxxxx>bundle exec calabash-android run app-debug.apk
No test server found for this combination of app and calabash version. Recreating test server.
*** WARNING: You must use ANSICON 1.31 or higher (https://github.com/adoxa/ansicon/) to get coloured output on Windows
DEBUG: Setting Android SDK location to $ANDROID_HOME
DEBUG: Android SDK location set to 'C:\Users\ziyao\AppData\Local\Android\Sdk'
DEBUG: Set aapt path to 'C:\Users\ziyao\AppData\Local\Android\Sdk/build-tools/30.0.3/aapt.exe'
DEBUG: Set zipalign path to 'C:\Users\ziyao\AppData\Local\Android\Sdk/build-tools/30.0.3/zipalign.exe'
DEBUG: Set adb path to 'C:\Users\ziyao\AppData\Local\Android\Sdk/platform-tools/adb.exe'
DEBUG: Set android jar path to 'C:\Users\ziyao\AppData\Local\Android\Sdk/platforms/android-30/android.jar'
DEBUG: Setting Java SDK location to $JAVA_HOME
DEBUG: Java SDK location set to 'C:\Program Files\Java\jdk1.8.0_201'
DEBUG: Found java on PATH
DEBUG: Set java path to '\Program Files\Common Files\Oracle\Java\javapath/java.exe'
DEBUG: Set keytool path to 'C:\Program Files\Java\jdk1.8.0_201/bin/keytool.exe'
DEBUG: Set jarsigner path to 'C:\Program Files\Java\jdk1.8.0_201/bin/jarsigner.exe'
WARNING: skipped META-INF/CERT.RSA as unsafe
2021-05-08 12:34:36 - Signature files:
Traceback (most recent call last):
10: from C:/Ruby25-x64/bin/calabash-android:23:in <main>' 9: from C:/Ruby25-x64/bin/calabash-android:23:in load'
8: from C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/calabash-android-0.9.20/bin/calabash-android:86:in <top (required)>' 7: from C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/calabash-android-0.9.20/bin/calabash-android-run.rb:16:in calabash_run'
6: from C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/calabash-android-0.9.20/lib/calabash-android/helpers.rb:107:in build_test_server_if_needed' 5: from C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/calabash-android-0.9.20/bin/calabash-android-build.rb:2:in calabash_build'
4: from C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/calabash-android-0.9.20/lib/calabash-android/helpers.rb:169:in fingerprint_from_apk' 3: from C:/Ruby25-x64/lib/ruby/2.5.0/tmpdir.rb:89:in mktmpdir'
2: from C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/calabash-android-0.9.20/lib/calabash-android/helpers.rb:170:in block in fingerprint_from_apk' 1: from C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/calabash-android-0.9.20/lib/calabash-android/helpers.rb:170:in chdir'
C:/Ruby25-x64/lib/ruby/gems/2.5.0/gems/calabash-android-0.9.20/lib/calabash-android/helpers.rb:188:in `block (2 levels) in fingerprint_from_apk': No signature files found in META-INF. Cannot proceed. (RuntimeError)

calabash-android copy all .RSA files to a temporary directory and https://github.com/calabash/calabash-android/blob/e77dbf723a/ruby-gem/lib/calabash-android/helpers.rb#L176 failed to copy the .RSA because of this line of rubyzip https://github.com/rubyzip/rubyzip/blob/7f3bb294872048c98f885d96f8bddf3668201a4a/lib/zip/entry.rb#L210

@JoeSSS
Copy link
Contributor

JoeSSS commented May 13, 2021

did it start just with version 0.9.20 ? there is another thread about that problem: #802

@JoeSSS
Copy link
Contributor

JoeSSS commented May 13, 2021

@igorFedotenkov most likely related to the latest rubyzip bump af5e3be#diff-04ff53c4c09c9939a1d7dcce85419cddaec67a4ad76f900bd553564e401adaf2R47

@JoeSSS
Copy link
Contributor

JoeSSS commented May 13, 2021

can we pin it back?

@JoeSSS
Copy link
Contributor

JoeSSS commented May 13, 2021

@vitaminac can you try again with 0.9.22 version please?

@vitaminac
Copy link
Author

vitaminac commented May 16, 2021

rubyzip has this behaviour since v1.2.2 rubyzip/rubyzip@3dd165b, we need to have v1.2.1 to solve the problem, see this comment as well #802 (comment), another solution is to pass dest_path as parameter when calling extract here https://github.com/calabash/calabash-android/blob/master/ruby-gem/lib/calabash-android/helpers.rb#L176, see reference https://github.com/rubyzip/rubyzip/blob/7f3bb294872048c98f885d96f8bddf3668201a4a/lib/zip/entry.rb#L209

@JoeSSS
Copy link
Contributor

JoeSSS commented May 17, 2021

I created the branch with 1.2.1. Could you please try to run tests with this version in Gemfile.

gem 'calabash-android', git: 'https://github.com/calabash/calabash-android.git', branch: 'downgrade_rubyzip'

@JoeSSS
Copy link
Contributor

JoeSSS commented May 17, 2021

Unfortunately I cannot test it on my own

@vitaminac
Copy link
Author

vitaminac commented May 23, 2021

After specified calabash-android version to this branch the issue is solved, so I can remove rubyzip from my Gemfile

@vitaminac
Copy link
Author

Hi could you merge downgrade_rubyzip to master, so anyone else can also solve the problem.

@vitaminac vitaminac reopened this May 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants