Fixing issues discovered by Philipp Wiesemann apk
authorstopiccot <alexey.petruchik@gmail.com>
Wed, 23 Apr 2014 03:42:32 +0300
branchapk
changeset 8897fff9c0b9f1fb
parent 8896 d931167c375a
child 8898 0f1bfc218f62
Fixing issues discovered by Philipp Wiesemann
android-project/src/org/libsdl/app/SDLActivity.java
include/SDL_hints.h
src/core/android/SDL_android.c
     1.1 --- a/android-project/src/org/libsdl/app/SDLActivity.java	Mon Apr 07 21:20:39 2014 +0300
     1.2 +++ b/android-project/src/org/libsdl/app/SDLActivity.java	Wed Apr 23 03:42:32 2014 +0300
     1.3 @@ -300,7 +300,7 @@
     1.4                                                 int is_accelerometer, int nbuttons, 
     1.5                                                 int naxes, int nhats, int nballs);
     1.6      public static native int nativeRemoveJoystick(int device_id);
     1.7 -    public static native String getHint(String name);
     1.8 +    public static native String nativeGetHint(String name);
     1.9  
    1.10      public static void flipBuffers() {
    1.11          SDLActivity.nativeFlipBuffers();
    1.12 @@ -507,8 +507,8 @@
    1.13      public InputStream openAPKExtensionInputStream(String fileName) throws IOException {
    1.14          // Get a ZipResourceFile representing a merger of both the main and patch files
    1.15          if (expansionFile == null) {
    1.16 -            Integer mainVersion = Integer.parseInt(getHint("SDL_ANDROID_APK_EXPANSION_MAIN_FILE_VERSION"));
    1.17 -            Integer patchVersion = Integer.parseInt(getHint("SDL_ANDROID_APK_EXPANSION_MAIN_FILE_VERSION"));
    1.18 +            Integer mainVersion = Integer.parseInt(nativeGetHint("SDL_ANDROID_APK_EXPANSION_MAIN_FILE_VERSION"));
    1.19 +            Integer patchVersion = Integer.parseInt(nativeGetHint("SDL_ANDROID_APK_EXPANSION_PATCH_FILE_VERSION"));
    1.20  
    1.21              expansionFile = APKExpansionSupport.getAPKExpansionZipFile(this, mainVersion, patchVersion);
    1.22          }
     2.1 --- a/include/SDL_hints.h	Mon Apr 07 21:20:39 2014 +0300
     2.2 +++ b/include/SDL_hints.h	Wed Apr 23 03:42:32 2014 +0300
     2.3 @@ -443,7 +443,7 @@
     2.4  /**
     2.5   * \brief Android APK expansion patch file version. Should be a string number like "1", "2" etc.
     2.6   */
     2.7 -#define SDL_HINT_ANDROID_APK_EXPANSION_PATCH_FILE_VERSION "SDL_ANDROID_APK_EXPANSION_MAIN_PATCH_VERSION"
     2.8 +#define SDL_HINT_ANDROID_APK_EXPANSION_PATCH_FILE_VERSION "SDL_ANDROID_APK_EXPANSION_PATCH_FILE_VERSION"
     2.9  
    2.10  
    2.11  /**
     3.1 --- a/src/core/android/SDL_android.c	Mon Apr 07 21:20:39 2014 +0300
     3.2 +++ b/src/core/android/SDL_android.c	Wed Apr 23 03:42:32 2014 +0300
     3.3 @@ -385,7 +385,7 @@
     3.4      (*env)->ReleaseStringUTFChars(env, text, utftext);
     3.5  }
     3.6  
     3.7 -jstring Java_org_libsdl_app_SDLActivity_getHint(JNIEnv* env, jclass cls, jstring name) {
     3.8 +jstring Java_org_libsdl_app_SDLActivity_nativeGetHint(JNIEnv* env, jclass cls, jstring name) {
     3.9      const char *utfname = (*env)->GetStringUTFChars(env, name, NULL);
    3.10      const char *hint = SDL_GetHint(utfname);
    3.11