Git Product home page Git Product logo

Comments (23)

orhanobut avatar orhanobut commented on August 30, 2024

Let us check for this issue. Which samsung device exactly are you using and android version?

from hawk.

savekirk avatar savekirk commented on August 30, 2024

samsung GT-S5282 - 4.1.2
samsung GT-I8190 - 4.1.2
samsung GT-S5300 - 2.3.6

from hawk.

csechuan avatar csechuan commented on August 30, 2024

And samsung GT-I9100G - 4.1.2
Not always happen though but enough to kill my app :(

from hawk.

Christophe668 avatar Christophe668 commented on August 30, 2024

Same problem in my app:
Here is the stacktrace.

java.lang.RuntimeException: Unable to create application MeteoApp: java.lang.RuntimeException: java.security.NoSuchAlgorithmException: SecretKeyFactory PBKDF2WithHmacSHA1 implementation not found
       at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4233)
       at android.app.ActivityThread.access$1300(ActivityThread.java:137)
       at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1271)
       at android.os.Handler.dispatchMessage(Handler.java:99)
       at android.os.Looper.loop(Looper.java:137)
       at android.app.ActivityThread.main(ActivityThread.java:4827)
       at java.lang.reflect.Method.invokeNative(Method.java)
       at java.lang.reflect.Method.invoke(Method.java:511)
       at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:841)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:608)
       at dalvik.system.NativeStart.main(NativeStart.java)
Caused by: java.lang.RuntimeException: java.security.NoSuchAlgorithmException: SecretKeyFactory PBKDF2WithHmacSHA1 implementation not found
       at com.orhanobut.hawk.AesEncryption.generateSecretKey(AesEncryption.java:84)
       at com.orhanobut.hawk.AesEncryption.<init>(AesEncryption.java:25)
       at com.orhanobut.hawk.Hawk.init(Hawk.java:68)
       at com.orhanobut.hawk.Hawk.init(Hawk.java:54)
       at MeteoApp.onCreate(MeteoApp.java:57)
       at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:999)
       at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4230)
       at android.app.ActivityThread.access$1300(ActivityThread.java:137)
       at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1271)
       at android.os.Handler.dispatchMessage(Handler.java:99)
       at android.os.Looper.loop(Looper.java:137)
       at android.app.ActivityThread.main(ActivityThread.java:4827)
       at java.lang.reflect.Method.invokeNative(Method.java)
       at java.lang.reflect.Method.invoke(Method.java:511)
       at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:841)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:608)
       at dalvik.system.NativeStart.main(NativeStart.java)
Caused by: java.security.NoSuchAlgorithmException: SecretKeyFactory PBKDF2WithHmacSHA1 implementation not found
       at org.apache.harmony.security.fortress.Engine.notFound(Engine.java:177)
       at org.apache.harmony.security.fortress.Engine.getInstance(Engine.java:151)
       at javax.crypto.SecretKeyFactory.getInstance(SecretKeyFactory.java:108)
       at com.orhanobut.hawk.AesCbcWithIntegrity.generateKeyFromPassword(AesCbcWithIntegrity.java:159)
       at com.orhanobut.hawk.AesCbcWithIntegrity.generateKeyFromPassword(AesCbcWithIntegrity.java:185)
       at com.orhanobut.hawk.AesEncryption.generateSecretKey(AesEncryption.java:82)
       at com.orhanobut.hawk.AesEncryption.<init>(AesEncryption.java:25)
       at com.orhanobut.hawk.Hawk.init(Hawk.java:68)
       at com.orhanobut.hawk.Hawk.init(Hawk.java:54)
       at MeteoApp.onCreate(MeteoApp.java:57)
       at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:999)
       at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4230)
       at android.app.ActivityThread.access$1300(ActivityThread.java:137)
       at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1271)
       at android.os.Handler.dispatchMessage(Handler.java:99)
       at android.os.Looper.loop(Looper.java:137)
       at android.app.ActivityThread.main(ActivityThread.java:4827)
       at java.lang.reflect.Method.invokeNative(Method.java)
       at java.lang.reflect.Method.invoke(Method.java:511)
       at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:841)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:608)
       at dalvik.system.NativeStart.main(NativeStart.java)

It happens on these devices :

screen shot 2015-05-07 at 09 56 56

screen shot 2015-05-07 at 09 57 32

This is a great library but it cannot be used on a production app used by a lot of people. The crash rate increase really quickly with that crash.

from hawk.

orhanobut avatar orhanobut commented on August 30, 2024

I started working on this issue, apparently some devices don't have this algorithm. I think today I'll create a new version with the fix

from hawk.

Christophe668 avatar Christophe668 commented on August 30, 2024

Thanks a lot ! If you need more info, I will be glad to help you

from hawk.

aligurelli avatar aligurelli commented on August 30, 2024

i have same problem too, thanks a lot. We are waiting for new build :)

from hawk.

orhanobut avatar orhanobut commented on August 30, 2024

Soon, there will be a new release, I'll update this post for the snapshot version, if it works we can release it. Thanks for the feedback really.

from hawk.

orhanobut avatar orhanobut commented on August 30, 2024

@aligurelli @Christophe668 @csechuan @sakirk I uploaded a new snapshot version with a fallback fix, could you try with this please? I don't have these devices and cannot test properly unfortunately, I just did some mockup.

snapshot version is

repositories {
    maven { url "https://oss.sonatype.org/content/repositories/snapshots/"}
}
dependencies {
    compile 'com.orhanobut:hawk:1.7-SNAPSHOT'
}

If everything works properly, I'll put a new release.

from hawk.

csechuan avatar csechuan commented on August 30, 2024

Thx. Will test it out. You replace encryption with conceal?

from hawk.

orhanobut avatar orhanobut commented on August 30, 2024

@csechuan no, I didn't use conceal, I just added a fallback to another key generation. I also updated the snapshot version with a new quick fix. Please try below.

repositories {
    maven { url "https://oss.sonatype.org/content/repositories/snapshots/"}
}
dependencies {
    compile 'com.orhanobut:hawk:1.9-SNAPSHOT'
}

from hawk.

Christophe668 avatar Christophe668 commented on August 30, 2024

Thx @orhanobut. Unfortunately I don't have a device affected by this issue so if I release this update it would be launched on a large set of user. Do you think it is stable enough to be released on a production app with a large set of user?

from hawk.

orhanobut avatar orhanobut commented on August 30, 2024

Best would be to wait for the release version. I also dont have these devices but gonna check this at work. This should fix this issue permanently but still need a good test.

I will keep to update this post. It would be great if someone check this version as well :(

from hawk.

csechuan avatar csechuan commented on August 30, 2024

So far so good.

from hawk.

orhanobut avatar orhanobut commented on August 30, 2024

@csechuan Do you have this problem anymore so far? That would be great feedback if you have tried and test it in a device that was affected this issue, Thanks

from hawk.

csechuan avatar csechuan commented on August 30, 2024

Has a little problem.

Caused by java.lang.NullPointerException
com.orhanobut.hawk.Hawk.encode (Hawk.java:167)
com.orhanobut.hawk.Hawk.put (Hawk.java:131)

from hawk.

orhanobut avatar orhanobut commented on August 30, 2024

I think the secretkeyfactory problem is solved, today I'll release a new build including this NPE.

from hawk.

csechuan avatar csechuan commented on August 30, 2024

Wait. Not yet.
When I release my app, it cant start hawk at all.

E/AndroidRuntime﹕ FATAL EXCEPTION: pool-2-thread-1
java.lang.NullPointerException
at io.abc.app.g.d.a(ELog.java:12)
at io.abc.app.g.d.a(ELog.java:20)
at io.abc.app.Hello$1.a(Hello.java:45)
at com.e.a.m$1.run(Hawk.java:110)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1076)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:569)
at java.lang.Thread.run(Thread.java:856)

from hawk.

orhanobut avatar orhanobut commented on August 30, 2024

Can you try without proguard? and can you also tell me which android version? you may need to add some config in the proguard. I tested in a few devices, had no problem at all. Can you also tell me how do you init hawk?

from hawk.

orhanobut avatar orhanobut commented on August 30, 2024

@csechuan I think this issue is related to something, can we move this issue to another thread please? While creating issue, could you also show me the exception without proguard if possible and also the value might be null?

from hawk.

csechuan avatar csechuan commented on August 30, 2024

Ok. I found out the problem is with Gson itself. Gson cant serialize / deserialize enums after pro-guarded, so have to make exceptions on those enum thingy.
I am using ver 1.8, so far no problem with NPE. Thanks for solving this. I think we can close this.

from hawk.

orhanobut avatar orhanobut commented on August 30, 2024

That's great news. I'll close this issue. @csechuan thanks for testing.

from hawk.

Christophe668 avatar Christophe668 commented on August 30, 2024

Thank you @orhanobut for this fix and @csechuan for testing !

from hawk.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.