The Source class post-compilation code is as follows:
Public Booleanisexpiring () {if(( This. Timestamp = =NULL) || ( This. Timestamp.length () <= 0)) { return true; } BooleanIsexpiring =false; Try{SimpleDateFormat DF=NewSimpleDateFormat (Ssoauthconfig.getauthdatadateformart ()); Date Date1= Df.parse ( This. timestamp); LongTime1 =Date1.gettime (); LongTime2 =System.currenttimemillis (); LongDiffmilsecs = time2-time1; LOG.I (TAG,"Diffmilsecs:" +string.valueof (diffmilsecs)); if(Diffmilsecs > 0L) isexpiring=true; } Catch(Exception e) {isexpiring=true; LOG.E (TAG,"Parse Date Exception", E); } returnisexpiring; }
Now to take
if (Diffmilsecs > 0L)
This line is changed into
if (Diffmilsecs > -100000l)
File exception after modified in Javabite, cannot decompile. (It is logically possible to add a constant to a constant pool and reference it here.) Changes are very small, no impact, and the previous class file modification is normal, why not this time? )
Compare normal class file decompile and exception class files using Ida Anti-compilation results as follows:
The modified file, the anti-compile times are wrong, but Ida can show the location of the exception.
Look again at the exception of the Anti-compilation:
We can see the zone exception between the. Stack and the. End stack. A single class file, not yet running, how can there be stack information? Ida what does the stack here represent? Are there any links between our modified class file anti-compile exceptions and these?
Look at the following description
Stackmaptable attribute, introduced in J2SE 6, records the information needed for type checking, such as the offset of bytecode, the type of validation of local variables, the type of validation in the Operation Stack, and the type checking process. The code Attribute can contain only one stackmaptable Attribute, which records all validation information in the current code Attribute.
See Java bytecode (. class file) format in detail (ii)
Does it have anything to do with this? Compared to the. class file format
stackmaptable The field definition for this segment to parse the information in the. Stack and. End stack as shown in Ida. Specifically do not write, the process is not complicated, but the manual solution is cumbersome, compared to the structure of a single item (like Ida.
Cn/com/zte/android/securityauth/model/ssoauthresultdata This information is a reference in the constant pool of the class file). There is also no useful tool to find detailed parsing stackmaptable.
Summary: The compiler-compiled class file after J2SE 6 is cumbersome to modify, taking into account the stackmaptable frame check. If you can reverse the source code, it is best to reverse the source code changes, and then into class files. If not, can only find tools to help, as for manual writing stackmaptable, or do not consider it.
Java Bytecode Modification Exception analysis