Resolving JNI calls in android5.x system flash-back problem

Source: Internet
Author: User

The log information is as follows:
08-14 15:48:41.127:a/art (5526): art/runtime/check_jni.cc:70] JNI detected ERROR in Application:illegal class name ' xxx.x Xx.xxx '
08-14 15:48:41.127:a/art (5526): art/runtime/check_jni.cc:70] (should be of the form ' Package/class ', [Lpackage/class; ' O R ' [[B ']
08-14 15:48:41.127:a/art (5526): art/runtime/check_jni.cc:70] in call to Findclass

check_jni.cc Source Address:https://android.googlesource.com/platform/art/+/kitkat-dev/runtime/check_jni.cc

Looking at the log is an error in calling Findclass. The Checkclassname method is called to check if the class name is legal when Findclass. Checkclasname method source code is as follows:

 //Checks that ' class_name ' is a valid "fully-qualified" JNI class name, like "Java/lang/thread"  //or "[Ljava/lang/object;". A ClassLoader can actually normalize class names a couple of  //times, so using "java.l Ang. Thread "instead of" Java/lang/thread "might work in some  //circumstances Incorrect.  void  Checkclassname (const  char  * class_name) {if  (! Isvalidjniclassname (class_name)) {jniabortf (function_name_,  "illegal class Name '%s ' \ n '  , class_name); } }



The Isvalidjniclassname method was called in the Checkclassname method, and Google searched for "Isvalidjniclassname site:android.googlesource.com", The declaration of the Isvalidjniclassname method is found in Utils.h, implemented in utils.cc.



Here are the link addresses for Utils.h and utils.cc:
https://android.googlesource.com/platform/art/+/master/runtime/utils.h
https://android.googlesource.com/platform/art/+/kitkat-release/runtime/utils.cc

The Isvalidjniclassname method is implemented as follows:

He calls the Isvalidclassname method, noting that the third argument is ‘/‘ that this is the delimiter for the class name, and when I call Findclass here, the class name is ‘.‘ separated, and the problem is ‘/‘ resolved.

Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.

Resolving JNI calls in android5.x system flash-back problem

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.