4

Probably a very silly problem but I cannot add jbcrypt from mindrot.org https://www.mindrot.org/projects/jBCrypt/ to my existing android studios application.

Layout of the filing for jbcrypt

Martin Zeitler
  • 1
  • 19
  • 155
  • 216
Nic Parmee
  • 145
  • 1
  • 16

2 Answers2

8

add repository mavenCentral() in the project's build.gradle

and then add this dependency to the module's build.gradle:

dependencies {
    implementation "org.mindrot:jbcrypt:0.4"
}
Martin Zeitler
  • 1
  • 19
  • 155
  • 216
0

I don't know if this is the correct/best way to include jBCrypt into an android studio project. This is how I solved the problem in windows 10.

  1. Go to GitHub and download this zip file -> https://github.com/jeremyh/jBCrypt

  2. Extract, and cut out the BCrypt.java file and paste into the project under app/java/yourpackagename/ (add to same location as the android activities, or wherever you want to keep it organized)

  3. Change the package name in the Bcrypt.java file so that your project will compile.

  4. Finally, import the package, and google jBCrypt examples to understand how to use the class, or dive right into the source.

The only file you add to your project is BCrypt.java

Hope this helps!

Aaron
  • 1
  • 1