-
Notifications
You must be signed in to change notification settings - Fork 892
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
Ignore case in validatePackageName #1660
Conversation
Currently `validatePackageName` fails for package names containing uppercase letters. A message like this is shown during pod install: ``` warn Invalid application's package name "com.lugg.ReactNativeConfig" in 'AndroidManifest.xml'. Read guidelines for setting the package name here: https://developer.android.com/studio/build/application-id warn Invalid application's package name "com.BV.LinearGradient" in 'AndroidManifest.xml'. Read guidelines for setting the package name here: https://developer.android.com/studio/build/application-id warn Invalid application's package name "com.lugg.ReactNativeConfig" in 'AndroidManifest.xml'. Read guidelines for setting the package name here: https://developer.android.com/studio/build/application-id warn Invalid application's package name "com.BV.LinearGradient" in 'AndroidManifest.xml'. Read guidelines for setting the package name here: https://developer.android.com/studio/build/application-id ``` However both the package name (https://developer.android.com/guide/topics/manifest/manifest-element.html#package) and the application id (https://developer.android.com/studio/build/application-id) are allowed to contain upper case letters. This change adds the "i" flag to the regex to ignore case when validating package name. Related issue: facebook/react-native#34247
Do you think this is gonna fix |
@matinzd It will not fix pod install calling android specific configuration. I am not familiar enough with the code in this repo to know how to do that. It fixes only it considering valid package names as invalid. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me, but the problem I have with this is why getAndroidProject
should be called via pod install
?
I think this needs to be fixed in cli bin with passing params. If it's gradle running the script, android should be checked and if this is being called from native_modules
in the ruby script, only ios should only be called.
Thanks! Looks good. Can you please add a test with this case? |
@matinzd right, we could add a |
@thymikee Added a few tests for |
* Ignore case in validatePackageName Currently `validatePackageName` fails for package names containing uppercase letters. A message like this is shown during pod install: ``` warn Invalid application's package name "com.lugg.ReactNativeConfig" in 'AndroidManifest.xml'. Read guidelines for setting the package name here: https://developer.android.com/studio/build/application-id warn Invalid application's package name "com.BV.LinearGradient" in 'AndroidManifest.xml'. Read guidelines for setting the package name here: https://developer.android.com/studio/build/application-id warn Invalid application's package name "com.lugg.ReactNativeConfig" in 'AndroidManifest.xml'. Read guidelines for setting the package name here: https://developer.android.com/studio/build/application-id warn Invalid application's package name "com.BV.LinearGradient" in 'AndroidManifest.xml'. Read guidelines for setting the package name here: https://developer.android.com/studio/build/application-id ``` However both the package name (https://developer.android.com/guide/topics/manifest/manifest-element.html#package) and the application id (https://developer.android.com/studio/build/application-id) are allowed to contain upper case letters. This change adds the "i" flag to the regex to ignore case when validating package name. Related issue: facebook/react-native#34247 * Add tests for validatePackageName
Summary:
Currently
validatePackageName
fails for package names containing uppercase letters. A message like this is shown during pod install:However both the package name (https://developer.android.com/guide/topics/manifest/manifest-element.html#package) and the application id (https://developer.android.com/studio/build/application-id) are allowed to contain upper case letters.
This change adds the "i" flag to the regex to ignore case when validating package name.
Related issue: facebook/react-native#34247
Test Plan:
I verified in browser console that the updated regex works correctly:
![Screenshot 2022-07-28 at 15 05 24](https://user-images.githubusercontent.com/4928274/181500847-c6e7db61-5a8f-4c5a-bfd9-64f1276dad09.png)