Skip to content

Instantly share code, notes, and snippets.

@strazzere
Created October 24, 2013 19:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save strazzere/7143881 to your computer and use it in GitHub Desktop.
Save strazzere/7143881 to your computer and use it in GitHub Desktop.
Run after using DEXTemplate.bt -- too slow to include in every template run, but can be used after running it if wanted
//////////////////////////////////////////////////
// Post template completion checks and functions
//////////////////////////////////////////////////
int CheckSourceFileName(int source_file_index) {
local string temp_str = StringIdRead(source_file_index);
if(sizeof(temp_str) <= 6) {
return -1;
}
temp_str = SubStr(temp_str, sizeof(temp_str) - 7, -1);
return Strcmp(temp_str, ".java\"");
}
if( MessageBox( idYes | idNo,
"Check for oddities?",
"Check for source file issues?")
== idYes ) {
local int class_idx = 0;
for(class_idx = 0; class_idx < sizeof(dex_class_defs) / sizeof(dex_class_defs.class_def); class_idx++) {
if(dex_class_defs.class_def[class_idx].source_file_idx != NO_INDEX && CheckSourceFileName(dex_class_defs.class_def[class_idx].source_file_idx) != 0) {
SPrintf(temp_warning, "Source file name for class [ %s ] does not appear to be a \".java\" file!", LongTypeIdRead(dex_class_defs.class_def[class_idx].class_idx));
PrintWarning(temp_warning);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment