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

App Crash on launch when we set flag isProd to true #90

Open
echonikul opened this issue Oct 15, 2024 · 16 comments
Open

App Crash on launch when we set flag isProd to true #90

echonikul opened this issue Oct 15, 2024 · 16 comments
Assignees
Labels
bug Something isn't working stale This issue has been not active for long period of time waiting for response Response from reporter is needed

Comments

@echonikul
Copy link

While upgrading the project from 0.68.7 to 0.72.0 . When I upload an app to the Play Store and change the flag isProd to true, it crash on launch

To Reproduce Steps to reproduce the behaviour:

Upgrade React Native project from version 0.68.7 to 0.72.0.
Configure freeRASP in the project.
Set the isProd flag to true.
Upload the app to the Play Store.
Launch the app after downloading.

Expected behaviour
The app should launch successfully without crashing when isProd is set to true and after being uploaded to the Play Store.

Device: All Android Devices
OS : Android
Version of freeRASP: ^3.9.1

Additional context: The issue only occurs when isProd is set to true. When the flag is set to false, the app runs without any issues. We are using the freeRASP (^3.9.1) package in React Native, and this behaviour began after upgrading from React Native 0.68.7 to 0.72.0.

@echonikul echonikul added the bug Something isn't working label Oct 15, 2024
@msikyna
Copy link
Member

msikyna commented Oct 15, 2024

Hello @echonikul ,
could you please send us your watcherMail and package name to [email protected]? We will look at the data what incident is triggered (most likely appIntegrity).

Kind regards,
Talsec team

@msikyna msikyna added the waiting for response Response from reporter is needed label Oct 15, 2024
@echonikul
Copy link
Author

echonikul commented Oct 15, 2024 via email

@tompsota
Copy link
Member

Hi @echonikul,

did you update also freeRASP in the process? We are aware of a bug in the latest freeRASP (3.9.1) that causes unresponsiveness in specific scenarios. I'm afraid your issue might be linked to this, actually. We'll be releasing fix in the upcoming days, but for now, can you try to use [email protected]? I think this should resolve the issue.

Best,
Tomas from Talsec

@echonikul
Copy link
Author

echonikul commented Oct 15, 2024

Hi @tompsota

Could you please advise how we can verify if the version is working correctly? We’ve tried uploading the app to Google Play Console for internal testing, but we're still encountering the same crash issue. Any guidance on how to resolve this or confirm if the setup is correct would be greatly appreciated.

@tompsota
Copy link
Member

tompsota commented Oct 15, 2024

Hi @echonikul,

we enhanced resilience against reverse engineering in 3.9.0, which caused issues on slower devices without access to the internet. This feature is not present in previous versions, so the issue is somewhere else.

Do you see any error messages in the console (Google Play console, logcat)? If so, can you share them?

@echonikul
Copy link
Author

i changed the build variant to release in android studio and check the issue in LogCat.

i get this issue

Error => com.facebook.react.uimanager.IllegalViewOperationException: ViewManager for tag 323 could not be found.

Version: 3.8.2

@tompsota
Copy link
Member

So the issue is there in the release build only? And the isProd flag is set according to the build variant used?

@echonikul
Copy link
Author

Yes . Correct

@tompsota
Copy link
Member

Allright. Does the project build, or is it runtime issue?

@echonikul
Copy link
Author

Runtime issue . it crash when app opens

@tompsota
Copy link
Member

Hi @echonikul,

I was not able to reproduce the issue locally. The com.facebook.react.uimanager.IllegalViewOperationException is not coming from our package; can you verify that the issue is caused by freeRASP? Or do you have any evidence pointing to it?

The isProd flag does not have effect on which checks are executed, it just "hides" some of the failed checks so that you are not overwhelmed by many reports during development of the app. Therefore, freeRASP should not cause crashes only with isProd set to true - I can see just some issues with proguard rules in release build, but this would lead to build errors, which does not seem to be your case.

Best,
Tomas from Talsec

@echonikul
Copy link
Author

If I comment out the freeRASP code, the app works fine. It also works when isProd is set to false.

@tompsota
Copy link
Member

What are your reactions to callbacks? Is there any that should kill the app?

@echonikul
Copy link
Author

echonikul commented Oct 17, 2024

@tompsota

const actions = {
privilegedAccess: () => RNExitApp.exitApp(),
debug: () => RNExitApp.exitApp(),
simulator: () => RNExitApp.exitApp(),
appIntegrity: () => RNExitApp.exitApp(),
unofficialStore: () => RNExitApp.exitApp(),
hooks: () => RNExitApp.exitApp(),
deviceBinding: () => RNExitApp.exitApp(),
secureHardwareNotAvailable: () => RNExitApp.exitApp(),
passcode: () => RNExitApp.exitApp(),
deviceID: () => RNExitApp.exitApp(),
obfuscationIssues: () => RNExitApp.exitApp(),
};

const config = {
androidConfig: {
packageName: "",
certificateHashes: ["
"],
},
iosConfig: {
appBundleId: "",
appTeamId: "
",
},
watcherMail: "
***@gmail.com",
isProd: true,
};

setThreatListeners(actions);
talsecStart(config);

Instead of using the useFreeRASP hook, we are using:

setThreatListeners(actions);
talsecStart(config);

in the release variant, and it’s working fine.

Is this okay?

@msikyna msikyna removed the waiting for response Response from reporter is needed label Oct 18, 2024
@tompsota
Copy link
Member

Hi @echonikul,

This is allright. The useFreerasp hook is there just for convenience, it contains just some some extra validation compared to these two methods.

Where in your code did you call the hook? It cannot be placed inside useEffect..

Regards,
Tomas from Talsec

@tompsota tompsota added the waiting for response Response from reporter is needed label Oct 21, 2024
Copy link

Hello!
This issue has been marked as inactive. If there is no further activity within the next 14 days, this issue will be automatically closed.
If you believe this issue is still relevant and requires attention, please comment or provide additional information.

@github-actions github-actions bot added the stale This issue has been not active for long period of time label Nov 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working stale This issue has been not active for long period of time waiting for response Response from reporter is needed
Projects
None yet
Development

No branches or pull requests

4 participants