Add a shared interface for different types of dex files

Repurposed DexFile to be the shared API. Will be used for abstracting
accesses to original dex files and CompactDex files.

As implementation diverges, functionality will be moved from DexFile
accordingly.

Will consider renaming DexFile -> IDexFile in a follow up CL.

Bug: 63756964
Test: test-art-host

Change-Id: Iad2508c2b9a7b6e0669fca5f7d10299a9b1541a2
diff --git a/runtime/oat_file.cc b/runtime/oat_file.cc
index 3f4cb94..c122830 100644
--- a/runtime/oat_file.cc
+++ b/runtime/oat_file.cc
@@ -48,6 +48,7 @@
 #include "mem_map.h"
 #include "mirror/class.h"
 #include "mirror/object-inl.h"
+#include "native_dex_file.h"
 #include "oat.h"
 #include "oat_file-inl.h"
 #include "oat_file_manager.h"
@@ -458,7 +459,9 @@
     }
 
     const uint8_t* dex_file_pointer = DexBegin() + dex_file_offset;
-    if (UNLIKELY(!DexFile::IsMagicValid(dex_file_pointer))) {
+
+    const bool valid_magic = NativeDexFile::IsMagicValid(dex_file_pointer);
+    if (UNLIKELY(!valid_magic)) {
       *error_msg = StringPrintf("In oat file '%s' found OatDexFile #%zu for '%s' with invalid "
                                     "dex file magic '%s'",
                                 GetLocation().c_str(),
@@ -467,7 +470,7 @@
                                 dex_file_pointer);
       return false;
     }
-    if (UNLIKELY(!DexFile::IsVersionValid(dex_file_pointer))) {
+    if (UNLIKELY(!NativeDexFile::IsVersionValid(dex_file_pointer))) {
       *error_msg = StringPrintf("In oat file '%s' found OatDexFile #%zu for '%s' with invalid "
                                     "dex file version '%s'",
                                 GetLocation().c_str(),