Use file magic to determine file type, not file extension.

Bug: 10614658
Change-Id: I9156dfca78ac8cd1c62fb258825cc791629270a4
diff --git a/runtime/dex_file.h b/runtime/dex_file.h
index 7be5cb8..346154c 100644
--- a/runtime/dex_file.h
+++ b/runtime/dex_file.h
@@ -346,7 +346,7 @@
   // For .dex files, this is the header checksum.
   // For zip files, this is the classes.dex zip entry CRC32 checksum.
   // Return true if the checksum could be found, false otherwise.
-  static bool GetChecksum(const std::string& filename, uint32_t& checksum)
+  static bool GetChecksum(const std::string& filename, uint32_t* checksum)
       SHARED_LOCKS_REQUIRED(Locks::mutator_lock_);
 
   // Opens .dex file, guessing the container format based on file extension
@@ -815,13 +815,12 @@
 
  private:
   // Opens a .dex file
-  static const DexFile* OpenFile(const std::string& filename,
+  static const DexFile* OpenFile(int fd,
                                  const std::string& location,
                                  bool verify);
 
   // Opens a dex file from within a .jar, .zip, or .apk file
-  static const DexFile* OpenZip(const std::string& filename,
-                                const std::string& location);
+  static const DexFile* OpenZip(int fd, const std::string& location);
 
   // Opens a .dex file at the given address backed by a MemMap
   static const DexFile* OpenMemory(const std::string& location,