Meaning of dalvik VM VFY codes

Can someone please explain to me the meaning of the following warnings when launching my Android application (warnings are displayed in the sequence as indicated):

04-17 15:29:11.693: I/dalvikvm(4442): DexOpt: access denied from Lcom/kirona/iclient/db/core/services/impl/MiscDatabaseModuleDaoImpl; to field Lcom/kirona/iclient/database/common/impl/AbstractDatabaseModuleDao;.logger 04-17 15:29:11.653: W/dalvikvm(4442): VFY: unable to resolve static field 30 (logger) in Lcom/kirona/iclient/db/core/services/impl/MiscDatabaseModuleDaoImpl; 04-17 15:29:11.653: D/dalvikvm(4442): VFY: replacing opcode 0x62 at 0x0001 04-17 15:29:11.693: D/dalvikvm(4442): VFY: dead code 0x0046-006e in Lcom/kirona/iclient/db/core/services/impl/MiscDatabaseModuleDaoImpl;.getSequenceNextVal (Ljava/lang/String;)J 

The application works fine, but I need to understand the problem, since we have more complex applications with similar errors that cause dalvikvm to crash.

+6
source share
1 answer

The problem is that the MiscDatabaseModuleDaoImpl class MiscDatabaseModuleDaoImpl trying to access the AbstractDatabaseModuleDao.logger field, but cannot, due to access restrictions (i.e. private, protected, etc.). In this case, the operation code of the sget object (operation code 0x62) that accesses this field is replaced by the one that throws a verification exception, which may lead to a crash during execution if it is executed.

In addition, the last message refers to dead code in the MiscDatabaseModuleDaoImpl.getSequenceNextVal method. It is safe - it will not cause any problems during operation. However, it would be nice to know what dead code is and delete it. You can parse your application using baksmali, with the -code-offsets option, and then look at the disassembly for this method. The --code-offsets parameter places a comment before each statement containing an offset. In the error message, offsets from 0x46 to 0x6e are dead code. There should also be .line directives, which will be the corresponding line numbers from the source java file.

+4
source

Source: https://habr.com/ru/post/913442/


All Articles