Is it posible to view react native source code in built applications?
react-native, xamarin
Solution
The javascript does not compile to native code. It uses a bridge to communicate between javascript/native components. JS is obfuscated but that is about it. You should not be storing any secrets client side.
See: https://github.com/facebook/react-native/issues/1093 'As @vjeux said, we have no immediate plans to add encryption for JS bundle files, and yes, under the currently recommended bundling instructions, your JS will be included as plaintext that can be extracted and de-obfuscated with relative ease.'
He goes on to mention a way to base64 encode the jsbundle to deter 'casual' hackers but then explains it will not stop a 'determined hacker'.
You should not connect the client directly to the DB. You need a secure server to handle authentication, and retrieve and validate db queries.
Nothing is secure on client. So you must validate all db queries before calling the db with them. See: https://www.acunetix.com/websitesecurity/sql-injection/ 'An SQL Injection needs just two conditions to exist – a relational database that uses SQL, and a user controllable input which is directly used in an SQL query.'
By allowing the client to directly connect to the DB, you cannot prevent the oldest of attacks.
Problem
I am a developer who wants to be able to make cross-platform applications and have came across Xamarin and React Native. Since the language that Xamarin uses is C#, this means that the code has to be compiled before the application can be run. React Native, however, uses JavaScript. Since JavaScript source code can be seen on websites, and is downloaded into the webpage unlike PHP, this means that the user on the client end can easily view the source code. If the user is able to get to the source code easily and the application in question connects to a database, this means they would be able to view the password, making the application insecure. The question is, if I where to make an application which connects to a MySQL using React Native, would the user be able to easily view the source code like they can on a webpage, or is it compiled like Xamarin is, making it harder to view the source code?