How to check if a (possibly obfuscated) class exists without displaying in logs

I am trying to check if a class exists at runtime.

Usage is Class.forName( "com.class.Name" );

not an option, as the class I want to test might be obfuscated using proguard.

Another option is to use a block try-catch(NoClassDefFoundError)

and try to access the actual class, but this results in the following logs:

  • art: Rejecting re-init on previously-failed class

    in newer os versions with ART - which I was able to avoid by executing Class cls = CheckedClass.class

    surrounded by a try-catch

    different method.

  • dalvikvm: Could not find class...

    on older os versions using dalvik which I haven't figured out yet how to avoid. Any thoughts?

+3
java android


source to share


No one has answered this question yet

Check out similar questions:

890
How to check if a service is running on Android?
837
How to hide title bar for Activity in XML with existing custom theme
757
How to check if a String is numeric in Java
756
How to check if a file exists in Java?
624
How to add text to an existing file in Java
4
How can I take a picture of my sdk encoded with kotlin (and get rid of the metadata)
2
How to obfuscate an Android library project using Eclipse?
0
How to fix NoClassDefFoundError in my library
0
Android Dragon 820 - Add System Service
0
How to change value in java class (obfuscated file without source)



All Articles
Loading...
X
Show
Funny
Dev
Pics