Any Good way of securing assets and video file store internal in android or react-native

Viewed 2244

We are building completely offline commercial eLearning app. we have to store some important video locally in the app and we don't want that to be stolen by extracting apk.

Is there any good way to achieve this with encryption/decryption or password protection etc on native android or react-native.

We are trying various solutions but a better way from you will help us in saving time and learning.

3 Answers

You can't do it.

You can encrypt it, but application will need key to decrypt it. Key can be sniffed or extracted from bytecode. Or even screen can be recorded without any key extraction.

Don't spend time on making troubles for anyone, spend time on great content.

100% securing assets and video is not possible, but you can use these ways to avoid extracting more data, like source code, assets form your APK, and resources:

1. Use ProGuard to obfuscate application code
2. Use NDK using C and C++ to put your application core and secure part of code in .so files
3. To secure resources, don't include all important resources in the assets folder with APK. Download these resources at the time of application first start up.

yes, its possible to do secure videos by using encryption.

please follow the following steps.

  1. Encrypt your videos.(you can optimize this process by only encrypting the starting frames of the video, in this way, it will not be readable by any other player and your decryption will not take much time). I can provide you more information about it.
  2. As your app will be offline so you have to keep decryption key in the app. so break the key into parts and build the key programmatically to avoid key extraction.
  3. Use pro guard to obfuscate your code.
  4. Use FLAG_SECURE to avoid screenshots and recording.
  5. Cheers!
Related