blob: 45a2eed126299369a2662c396c106366d38b1e84 [file] [log] [blame]
Brian Carlstromf91c8c32011-09-21 17:30:34 -07001/*
2 * Copyright (C) 2008 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
Brian Carlstrom1d9f52b2011-10-13 10:50:45 -070017#include <unistd.h>
18
Elliott Hughes07ed66b2012-12-12 18:34:25 -080019#include "base/logging.h"
Brian Carlstromaded5f72011-10-07 17:15:04 -070020#include "class_linker.h"
Ian Rogers62d6c772013-02-27 08:32:07 -080021#include "common_throws.h"
Ian Rogers4f6ad8a2013-03-18 15:27:28 -070022#include "dex_file-inl.h"
Ian Rogers1d54e732013-05-02 21:10:01 -070023#include "gc/space/image_space.h"
24#include "gc/space/space-inl.h"
Brian Carlstrom81f3ca12012-03-17 00:27:35 -070025#include "image.h"
Elliott Hugheseac76672012-05-24 21:56:51 -070026#include "jni_internal.h"
Ian Rogers2dd0e2c2013-01-24 12:42:14 -080027#include "mirror/class_loader.h"
Ian Rogers05f30572013-02-20 12:13:11 -080028#include "mirror/object-inl.h"
Ian Rogers2dd0e2c2013-01-24 12:42:14 -080029#include "mirror/string.h"
Brian Carlstrom700c8d32012-11-05 10:42:02 -080030#include "oat.h"
Brian Carlstrom1d9f52b2011-10-13 10:50:45 -070031#include "os.h"
Brian Carlstromaded5f72011-10-07 17:15:04 -070032#include "runtime.h"
Ian Rogers00f7d0e2012-07-19 15:28:27 -070033#include "scoped_thread_state_change.h"
Ian Rogersc9818482012-01-11 08:52:51 -080034#include "ScopedLocalRef.h"
Brian Carlstromf91c8c32011-09-21 17:30:34 -070035#include "ScopedUtfChars.h"
Elliott Hugheseac76672012-05-24 21:56:51 -070036#include "toStringArray.h"
37#include "zip_archive.h"
Brian Carlstromf91c8c32011-09-21 17:30:34 -070038
39namespace art {
40
Brian Carlstromf91c8c32011-09-21 17:30:34 -070041// A smart pointer that provides read-only access to a Java string's UTF chars.
42// Unlike libcore's NullableScopedUtfChars, this will *not* throw NullPointerException if
43// passed a null jstring. The correct idiom is:
44//
45// NullableScopedUtfChars name(env, javaName);
Brian Carlstromc252c3e2011-10-16 23:21:02 -070046// if (env->ExceptionCheck()) {
Brian Carlstromf91c8c32011-09-21 17:30:34 -070047// return NULL;
48// }
49// // ... use name.c_str()
50//
51// TODO: rewrite to get rid of this, or change ScopedUtfChars to offer this option.
52class NullableScopedUtfChars {
Elliott Hughesba8eee12012-01-24 20:25:24 -080053 public:
54 NullableScopedUtfChars(JNIEnv* env, jstring s) : mEnv(env), mString(s) {
55 mUtfChars = (s != NULL) ? env->GetStringUTFChars(s, NULL) : NULL;
56 }
57
58 ~NullableScopedUtfChars() {
59 if (mUtfChars) {
60 mEnv->ReleaseStringUTFChars(mString, mUtfChars);
Brian Carlstromf91c8c32011-09-21 17:30:34 -070061 }
Elliott Hughesba8eee12012-01-24 20:25:24 -080062 }
Brian Carlstromf91c8c32011-09-21 17:30:34 -070063
Elliott Hughesba8eee12012-01-24 20:25:24 -080064 const char* c_str() const {
65 return mUtfChars;
66 }
Brian Carlstromf91c8c32011-09-21 17:30:34 -070067
Elliott Hughesba8eee12012-01-24 20:25:24 -080068 size_t size() const {
69 return strlen(mUtfChars);
70 }
Brian Carlstromf91c8c32011-09-21 17:30:34 -070071
Elliott Hughesba8eee12012-01-24 20:25:24 -080072 // Element access.
73 const char& operator[](size_t n) const {
74 return mUtfChars[n];
75 }
Brian Carlstromf91c8c32011-09-21 17:30:34 -070076
Elliott Hughesba8eee12012-01-24 20:25:24 -080077 private:
78 JNIEnv* mEnv;
79 jstring mString;
80 const char* mUtfChars;
Brian Carlstromf91c8c32011-09-21 17:30:34 -070081
Elliott Hughesba8eee12012-01-24 20:25:24 -080082 // Disallow copy and assignment.
83 NullableScopedUtfChars(const NullableScopedUtfChars&);
84 void operator=(const NullableScopedUtfChars&);
Brian Carlstromf91c8c32011-09-21 17:30:34 -070085};
86
Brian Carlstrom7571e8b2013-08-12 17:04:14 -070087static jint DexFile_openDexFileNative(JNIEnv* env, jclass, jstring javaSourceName, jstring javaOutputName, jint) {
Brian Carlstromf91c8c32011-09-21 17:30:34 -070088 ScopedUtfChars sourceName(env, javaSourceName);
89 if (sourceName.c_str() == NULL) {
90 return 0;
91 }
92 NullableScopedUtfChars outputName(env, javaOutputName);
Brian Carlstromc252c3e2011-10-16 23:21:02 -070093 if (env->ExceptionCheck()) {
Brian Carlstromf91c8c32011-09-21 17:30:34 -070094 return 0;
95 }
Ian Rogers8d31bbd2013-10-13 10:44:14 -070096
Brian Carlstrom756ee4e2013-10-03 15:46:12 -070097 uint32_t dex_location_checksum;
Brian Carlstrom08cbf662013-12-10 16:52:57 -080098 uint32_t* dex_location_checksum_pointer = &dex_location_checksum;
Ian Rogers8d31bbd2013-10-13 10:44:14 -070099 std::string error_msg;
Brian Carlstrom08cbf662013-12-10 16:52:57 -0800100 if (!DexFile::GetChecksum(sourceName.c_str(), dex_location_checksum_pointer, &error_msg)) {
101 dex_location_checksum_pointer = NULL;
Brian Carlstrom756ee4e2013-10-03 15:46:12 -0700102 }
103
104 ClassLinker* linker = Runtime::Current()->GetClassLinker();
105 const DexFile* dex_file;
Ian Rogers8d31bbd2013-10-13 10:44:14 -0700106 if (outputName.c_str() == nullptr) {
Brian Carlstrom08cbf662013-12-10 16:52:57 -0800107 // FindOrCreateOatFileForDexLocation can tolerate a missing dex_location_checksum
108 error_msg.clear();
Ian Rogers8d31bbd2013-10-13 10:44:14 -0700109 dex_file = linker->FindDexFileInOatFileFromDexLocation(sourceName.c_str(),
Brian Carlstrom08cbf662013-12-10 16:52:57 -0800110 dex_location_checksum_pointer, &error_msg);
Brian Carlstrom756ee4e2013-10-03 15:46:12 -0700111 } else {
Brian Carlstrom08cbf662013-12-10 16:52:57 -0800112 // FindOrCreateOatFileForDexLocation requires the dex_location_checksum
113 if (dex_location_checksum_pointer == NULL) {
114 ScopedObjectAccess soa(env);
115 DCHECK(!error_msg.empty());
116 ThrowIOException("%s", error_msg.c_str());
117 return 0;
118 }
Ian Rogers8d31bbd2013-10-13 10:44:14 -0700119 dex_file = linker->FindOrCreateOatFileForDexLocation(sourceName.c_str(), dex_location_checksum,
120 outputName.c_str(), &error_msg);
Brian Carlstrom756ee4e2013-10-03 15:46:12 -0700121 }
Ian Rogers8d31bbd2013-10-13 10:44:14 -0700122 if (dex_file == nullptr) {
Vladimir Marko60836d52014-01-16 15:53:38 +0000123 ScopedObjectAccess soa(env);
124 CHECK(!error_msg.empty());
125 ThrowIOException("%s", error_msg.c_str());
jeffhaoc393a4f2011-10-19 13:46:09 -0700126 return 0;
Brian Carlstromaded5f72011-10-07 17:15:04 -0700127 }
128 return static_cast<jint>(reinterpret_cast<uintptr_t>(dex_file));
129}
130
Ian Rogers1eb512d2013-10-18 15:42:20 -0700131static const DexFile* toDexFile(int dex_file_address, JNIEnv* env) {
Brian Carlstromaded5f72011-10-07 17:15:04 -0700132 const DexFile* dex_file = reinterpret_cast<const DexFile*>(static_cast<uintptr_t>(dex_file_address));
Ian Rogers1eb512d2013-10-18 15:42:20 -0700133 if (UNLIKELY(dex_file == nullptr)) {
134 ScopedObjectAccess soa(env);
Ian Rogers62d6c772013-02-27 08:32:07 -0800135 ThrowNullPointerException(NULL, "dex_file == null");
Brian Carlstromaded5f72011-10-07 17:15:04 -0700136 }
137 return dex_file;
Brian Carlstromf91c8c32011-09-21 17:30:34 -0700138}
139
Ian Rogers00f7d0e2012-07-19 15:28:27 -0700140static void DexFile_closeDexFile(JNIEnv* env, jclass, jint cookie) {
141 const DexFile* dex_file;
Ian Rogers1eb512d2013-10-18 15:42:20 -0700142 dex_file = toDexFile(cookie, env);
143 if (dex_file == nullptr) {
Brian Carlstromaded5f72011-10-07 17:15:04 -0700144 return;
145 }
146 if (Runtime::Current()->GetClassLinker()->IsDexFileRegistered(*dex_file)) {
147 return;
148 }
149 delete dex_file;
Brian Carlstromf91c8c32011-09-21 17:30:34 -0700150}
151
Elliott Hughes0512f022012-03-15 22:10:52 -0700152static jclass DexFile_defineClassNative(JNIEnv* env, jclass, jstring javaName, jobject javaLoader,
153 jint cookie) {
Ian Rogers1eb512d2013-10-18 15:42:20 -0700154 const DexFile* dex_file = toDexFile(cookie, env);
Brian Carlstromaded5f72011-10-07 17:15:04 -0700155 if (dex_file == NULL) {
Brian Carlstrom7571e8b2013-08-12 17:04:14 -0700156 VLOG(class_linker) << "Failed to find dex_file";
Brian Carlstromaded5f72011-10-07 17:15:04 -0700157 return NULL;
158 }
Brian Carlstromdf143242011-10-10 18:05:34 -0700159 ScopedUtfChars class_name(env, javaName);
160 if (class_name.c_str() == NULL) {
Brian Carlstrom2e450bf2013-09-06 15:39:46 -0700161 VLOG(class_linker) << "Failed to find class_name";
Brian Carlstromdf143242011-10-10 18:05:34 -0700162 return NULL;
163 }
Elliott Hughes95572412011-12-13 18:14:20 -0800164 const std::string descriptor(DotToDescriptor(class_name.c_str()));
Ian Rogersee39a102013-09-19 02:56:49 -0700165 const DexFile::ClassDef* dex_class_def = dex_file->FindClassDef(descriptor.c_str());
Brian Carlstromaded5f72011-10-07 17:15:04 -0700166 if (dex_class_def == NULL) {
Brian Carlstrom2e450bf2013-09-06 15:39:46 -0700167 VLOG(class_linker) << "Failed to find dex_class_def";
Brian Carlstromaded5f72011-10-07 17:15:04 -0700168 return NULL;
169 }
Ian Rogers1eb512d2013-10-18 15:42:20 -0700170 ScopedObjectAccess soa(env);
Brian Carlstromaded5f72011-10-07 17:15:04 -0700171 ClassLinker* class_linker = Runtime::Current()->GetClassLinker();
172 class_linker->RegisterDexFile(*dex_file);
Mathieu Chartier590fee92013-09-13 13:46:47 -0700173 SirtRef<mirror::ClassLoader> class_loader(soa.Self(), soa.Decode<mirror::ClassLoader*>(javaLoader));
Ian Rogers7dfb28c2013-08-22 08:18:36 -0700174 mirror::Class* result = class_linker->DefineClass(descriptor.c_str(), class_loader, *dex_file,
175 *dex_class_def);
Brian Carlstrom2e450bf2013-09-06 15:39:46 -0700176 VLOG(class_linker) << "DexFile_defineClassNative returning " << result;
Ian Rogers00f7d0e2012-07-19 15:28:27 -0700177 return soa.AddLocalReference<jclass>(result);
Brian Carlstromf91c8c32011-09-21 17:30:34 -0700178}
179
Elliott Hughes0512f022012-03-15 22:10:52 -0700180static jobjectArray DexFile_getClassNameList(JNIEnv* env, jclass, jint cookie) {
Ian Rogers00f7d0e2012-07-19 15:28:27 -0700181 const DexFile* dex_file;
Ian Rogers1eb512d2013-10-18 15:42:20 -0700182 dex_file = toDexFile(cookie, env);
183 if (dex_file == nullptr) {
184 return nullptr;
Brian Carlstromaded5f72011-10-07 17:15:04 -0700185 }
Brian Carlstrom03a20ba2011-10-13 10:24:13 -0700186
187 std::vector<std::string> class_names;
188 for (size_t i = 0; i < dex_file->NumClassDefs(); ++i) {
189 const DexFile::ClassDef& class_def = dex_file->GetClassDef(i);
190 const char* descriptor = dex_file->GetClassDescriptor(class_def);
191 class_names.push_back(DescriptorToDot(descriptor));
192 }
193 return toStringArray(env, class_names);
Brian Carlstromf91c8c32011-09-21 17:30:34 -0700194}
195
Elliott Hughes0512f022012-03-15 22:10:52 -0700196static jboolean DexFile_isDexOptNeeded(JNIEnv* env, jclass, jstring javaFilename) {
Ian Rogers8d31bbd2013-10-13 10:44:14 -0700197 const bool kVerboseLogging = false; // Spammy logging.
198 const bool kDebugLogging = true; // Logging useful for debugging.
Brian Carlstrombf2cb162012-02-27 17:49:19 -0800199
Brian Carlstrom03a20ba2011-10-13 10:24:13 -0700200 ScopedUtfChars filename(env, javaFilename);
Brian Carlstrom1d9f52b2011-10-13 10:50:45 -0700201
Ian Rogers8d31bbd2013-10-13 10:44:14 -0700202 if ((filename.c_str() == nullptr) || !OS::FileExists(filename.c_str())) {
Brian Carlstrombf2cb162012-02-27 17:49:19 -0800203 LOG(ERROR) << "DexFile_isDexOptNeeded file '" << filename.c_str() << "' does not exist";
Ian Rogers8d31bbd2013-10-13 10:44:14 -0700204 ScopedLocalRef<jclass> fnfe(env, env->FindClass("java/io/FileNotFoundException"));
205 const char* message = (filename.c_str() == nullptr) ? "<empty file name>" : filename.c_str();
206 env->ThrowNew(fnfe.get(), message);
207 return JNI_FALSE;
Brian Carlstrom1d9f52b2011-10-13 10:50:45 -0700208 }
209
210 // Always treat elements of the bootclasspath as up-to-date. The
211 // fact that code is running at all means that this should be true.
Brian Carlstrom81f3ca12012-03-17 00:27:35 -0700212 Runtime* runtime = Runtime::Current();
213 ClassLinker* class_linker = runtime->GetClassLinker();
Brian Carlstrom1d9f52b2011-10-13 10:50:45 -0700214 const std::vector<const DexFile*>& boot_class_path = class_linker->GetBootClassPath();
215 for (size_t i = 0; i < boot_class_path.size(); i++) {
216 if (boot_class_path[i]->GetLocation() == filename.c_str()) {
Ian Rogers8d31bbd2013-10-13 10:44:14 -0700217 if (kVerboseLogging) {
Brian Carlstrombf2cb162012-02-27 17:49:19 -0800218 LOG(INFO) << "DexFile_isDexOptNeeded ignoring boot class path file: " << filename.c_str();
219 }
Brian Carlstrom1d9f52b2011-10-13 10:50:45 -0700220 return JNI_FALSE;
221 }
222 }
223
Brian Carlstrom30e2ea42013-06-19 23:25:37 -0700224 // Check if we have an odex file next to the dex file.
225 std::string odex_filename(OatFile::DexFilenameToOdexFilename(filename.c_str()));
Ian Rogers8d31bbd2013-10-13 10:44:14 -0700226 std::string error_msg;
227 UniquePtr<const OatFile> oat_file(OatFile::Open(odex_filename, odex_filename, NULL, false,
228 &error_msg));
229 if (oat_file.get() == nullptr) {
230 if (kVerboseLogging) {
231 LOG(INFO) << "DexFile_isDexOptNeeded failed to open oat file '" << filename.c_str()
232 << "': " << error_msg;
233 }
234 error_msg.clear();
235 } else {
236 const art::OatFile::OatDexFile* oat_dex_file = oat_file->GetOatDexFile(filename.c_str(), NULL,
237 kDebugLogging);
238 if (oat_dex_file != nullptr) {
Ian Rogers33e95662013-05-20 20:29:14 -0700239 uint32_t location_checksum;
Ian Rogers8d31bbd2013-10-13 10:44:14 -0700240 // If its not possible to read the classes.dex assume up-to-date as we won't be able to
241 // compile it anyway.
242 if (!DexFile::GetChecksum(filename.c_str(), &location_checksum, &error_msg)) {
243 if (kVerboseLogging) {
Ian Rogers33e95662013-05-20 20:29:14 -0700244 LOG(INFO) << "DexFile_isDexOptNeeded ignoring precompiled stripped file: "
Ian Rogers8d31bbd2013-10-13 10:44:14 -0700245 << filename.c_str() << ": " << error_msg;
Ian Rogers33e95662013-05-20 20:29:14 -0700246 }
247 return JNI_FALSE;
248 }
Ian Rogers8d31bbd2013-10-13 10:44:14 -0700249 if (ClassLinker::VerifyOatFileChecksums(oat_file.get(), filename.c_str(), location_checksum,
250 &error_msg)) {
251 if (kVerboseLogging) {
Brian Carlstrom30e2ea42013-06-19 23:25:37 -0700252 LOG(INFO) << "DexFile_isDexOptNeeded precompiled file " << odex_filename
Brian Carlstrom0d3bbff2013-10-28 15:21:32 -0700253 << " has an up-to-date checksum compared to " << filename.c_str();
Ian Rogers33e95662013-05-20 20:29:14 -0700254 }
255 return JNI_FALSE;
Brian Carlstrom0d3bbff2013-10-28 15:21:32 -0700256 } else {
257 if (kVerboseLogging) {
258 LOG(INFO) << "DexFile_isDexOptNeeded found precompiled file " << odex_filename
259 << " with an out-of-date checksum compared to " << filename.c_str()
260 << ": " << error_msg;
261 }
262 error_msg.clear();
Ian Rogers33e95662013-05-20 20:29:14 -0700263 }
Brian Carlstromafe25512012-06-27 17:02:58 -0700264 }
Brian Carlstromfad71432011-10-16 20:25:10 -0700265 }
Brian Carlstrom5b332c82012-02-01 15:02:31 -0800266
Brian Carlstroma004aa92012-02-08 18:05:09 -0800267 // Check if we have an oat file in the cache
Brian Carlstrom30e2ea42013-06-19 23:25:37 -0700268 std::string cache_location(GetDalvikCacheFilenameOrDie(filename.c_str()));
Ian Rogers8d31bbd2013-10-13 10:44:14 -0700269 oat_file.reset(OatFile::Open(cache_location, filename.c_str(), NULL, false, &error_msg));
270 if (oat_file.get() == nullptr) {
271 if (kDebugLogging) {
272 LOG(INFO) << "DexFile_isDexOptNeeded cache file " << cache_location
273 << " does not exist for " << filename.c_str() << ": " << error_msg;
274 }
Brian Carlstrom5b332c82012-02-01 15:02:31 -0800275 return JNI_TRUE;
276 }
277
Mathieu Chartier02e25112013-08-14 16:14:24 -0700278 for (const auto& space : runtime->GetHeap()->GetContinuousSpaces()) {
279 if (space->IsImageSpace()) {
Mathieu Chartierb062fdd2012-07-03 09:51:48 -0700280 // TODO: Ensure this works with multiple image spaces.
Mathieu Chartier02e25112013-08-14 16:14:24 -0700281 const ImageHeader& image_header = space->AsImageSpace()->GetImageHeader();
Ian Rogers8d31bbd2013-10-13 10:44:14 -0700282 if (oat_file->GetOatHeader().GetImageFileLocationOatChecksum() !=
283 image_header.GetOatChecksum()) {
284 if (kDebugLogging) {
285 ScopedObjectAccess soa(env);
286 LOG(INFO) << "DexFile_isDexOptNeeded cache file " << cache_location
287 << " has out-of-date oat checksum compared to "
288 << image_header.GetImageRoot(ImageHeader::kOatLocation)->AsString()->ToModifiedUtf8();
289 }
Brian Carlstrom28db0122012-10-18 16:20:41 -0700290 return JNI_TRUE;
291 }
Brian Carlstrom700c8d32012-11-05 10:42:02 -0800292 if (oat_file->GetOatHeader().GetImageFileLocationOatDataBegin()
293 != reinterpret_cast<uint32_t>(image_header.GetOatDataBegin())) {
Ian Rogers8d31bbd2013-10-13 10:44:14 -0700294 if (kDebugLogging) {
295 ScopedObjectAccess soa(env);
296 LOG(INFO) << "DexFile_isDexOptNeeded cache file " << cache_location
297 << " has out-of-date oat begin compared to "
298 << image_header.GetImageRoot(ImageHeader::kOatLocation)->AsString()->ToModifiedUtf8();
299 }
Mathieu Chartierb062fdd2012-07-03 09:51:48 -0700300 return JNI_TRUE;
301 }
302 }
Brian Carlstrom81f3ca12012-03-17 00:27:35 -0700303 }
304
Brian Carlstroma004aa92012-02-08 18:05:09 -0800305 uint32_t location_checksum;
Ian Rogers8d31bbd2013-10-13 10:44:14 -0700306 if (!DexFile::GetChecksum(filename.c_str(), &location_checksum, &error_msg)) {
307 if (kDebugLogging) {
308 LOG(ERROR) << "DexFile_isDexOptNeeded failed to compute checksum of " << filename.c_str()
309 << " (error " << error_msg << ")";
310 }
Brian Carlstroma004aa92012-02-08 18:05:09 -0800311 return JNI_TRUE;
312 }
313
Ian Rogers8d31bbd2013-10-13 10:44:14 -0700314 if (!ClassLinker::VerifyOatFileChecksums(oat_file.get(), filename.c_str(), location_checksum,
315 &error_msg)) {
316 if (kDebugLogging) {
317 LOG(INFO) << "DexFile_isDexOptNeeded cache file " << cache_location
318 << " has out-of-date checksum compared to " << filename.c_str()
319 << " (error " << error_msg << ")";
320 }
Brian Carlstrom5b332c82012-02-01 15:02:31 -0800321 return JNI_TRUE;
322 }
323
Ian Rogers8d31bbd2013-10-13 10:44:14 -0700324 if (kVerboseLogging) {
Brian Carlstrombf2cb162012-02-27 17:49:19 -0800325 LOG(INFO) << "DexFile_isDexOptNeeded cache file " << cache_location
326 << " is up-to-date for " << filename.c_str();
327 }
Ian Rogers8d31bbd2013-10-13 10:44:14 -0700328 CHECK(error_msg.empty()) << error_msg;
Brian Carlstromf91c8c32011-09-21 17:30:34 -0700329 return JNI_FALSE;
330}
331
332static JNINativeMethod gMethods[] = {
333 NATIVE_METHOD(DexFile, closeDexFile, "(I)V"),
Ian Rogers66a556f2012-02-14 00:05:38 -0800334 NATIVE_METHOD(DexFile, defineClassNative, "(Ljava/lang/String;Ljava/lang/ClassLoader;I)Ljava/lang/Class;"),
Brian Carlstromf91c8c32011-09-21 17:30:34 -0700335 NATIVE_METHOD(DexFile, getClassNameList, "(I)[Ljava/lang/String;"),
336 NATIVE_METHOD(DexFile, isDexOptNeeded, "(Ljava/lang/String;)Z"),
Brian Carlstrom7571e8b2013-08-12 17:04:14 -0700337 NATIVE_METHOD(DexFile, openDexFileNative, "(Ljava/lang/String;Ljava/lang/String;I)I"),
Brian Carlstromf91c8c32011-09-21 17:30:34 -0700338};
339
Brian Carlstromf91c8c32011-09-21 17:30:34 -0700340void register_dalvik_system_DexFile(JNIEnv* env) {
Elliott Hugheseac76672012-05-24 21:56:51 -0700341 REGISTER_NATIVE_METHODS("dalvik/system/DexFile");
Brian Carlstromf91c8c32011-09-21 17:30:34 -0700342}
343
344} // namespace art