mirror of
https://github.com/libretro/RetroArch
synced 2025-03-25 16:44:01 +00:00
(Android) Remove apk-extract
This commit is contained in:
parent
317049cd25
commit
d171c831c3
@ -1,23 +1,7 @@
|
|||||||
LOCAL_PATH := $(call my-dir)
|
LOCAL_PATH := $(call my-dir)
|
||||||
include $(CLEAR_VARS)
|
include $(CLEAR_VARS)
|
||||||
|
|
||||||
LOCAL_MODULE := retroarch-jni
|
|
||||||
RARCH_DIR := ../../../..
|
RARCH_DIR := ../../../..
|
||||||
LOCAL_CFLAGS += -std=gnu99 -Wall -DRARCH_DUMMY_LOG -DHAVE_ZLIB -DHAVE_MMAP -DRARCH_INTERNAL
|
|
||||||
LOCAL_LDLIBS := -llog -lz
|
|
||||||
LOCAL_SRC_FILES := apk-extract/apk-extract.c \
|
|
||||||
$(RARCH_DIR)/libretro-common/file/file_extract.c \
|
|
||||||
$(RARCH_DIR)/libretro-common/file/file_path.c \
|
|
||||||
$(RARCH_DIR)/file_ops.c \
|
|
||||||
$(RARCH_DIR)/libretro-common/string/string_list.c \
|
|
||||||
$(RARCH_DIR)/libretro-common/compat/compat_strl.c \
|
|
||||||
$(RARCH_DIR)/libretro-common/file/retro_file.c \
|
|
||||||
$(RARCH_DIR)/libretro-common/file/retro_stat.c \
|
|
||||||
$(RARCH_DIR)/verbosity.c
|
|
||||||
|
|
||||||
LOCAL_C_INCLUDES := $(LOCAL_PATH)/$(RARCH_DIR)/libretro-common/include/
|
|
||||||
|
|
||||||
include $(BUILD_SHARED_LIBRARY)
|
|
||||||
|
|
||||||
HAVE_NEON := 1
|
HAVE_NEON := 1
|
||||||
HAVE_LOGGER := 0
|
HAVE_LOGGER := 0
|
||||||
|
@ -1,22 +1,7 @@
|
|||||||
LOCAL_PATH := $(call my-dir)
|
LOCAL_PATH := $(call my-dir)
|
||||||
include $(CLEAR_VARS)
|
include $(CLEAR_VARS)
|
||||||
|
|
||||||
LOCAL_MODULE := retroarch-jni
|
|
||||||
RARCH_DIR := ../../../..
|
RARCH_DIR := ../../../..
|
||||||
LOCAL_CFLAGS += -std=gnu99 -Wall -DRARCH_DUMMY_LOG -DHAVE_ZLIB -DHAVE_MMAP -DRARCH_INTERNAL
|
|
||||||
LOCAL_LDLIBS := -llog -lz
|
|
||||||
LOCAL_SRC_FILES := apk-extract/apk-extract.c \
|
|
||||||
$(RARCH_DIR)/libretro-common/file/file_extract.c \
|
|
||||||
$(RARCH_DIR)/libretro-common/file/file_path.c \
|
|
||||||
$(RARCH_DIR)/file_ops.c \
|
|
||||||
$(RARCH_DIR)/libretro-common/string/string_list.c \
|
|
||||||
$(RARCH_DIR)/libretro-common/compat/compat_strl.c \
|
|
||||||
$(RARCH_DIR)/libretro-common/file/retro_file.c \
|
|
||||||
$(RARCH_DIR)/libretro-common/file/retro_stat.c
|
|
||||||
|
|
||||||
LOCAL_C_INCLUDES := $(LOCAL_PATH)/$(RARCH_DIR)/libretro-common/include/
|
|
||||||
|
|
||||||
include $(BUILD_SHARED_LIBRARY)
|
|
||||||
|
|
||||||
HAVE_NEON := 1
|
HAVE_NEON := 1
|
||||||
HAVE_LOGGER := 0
|
HAVE_LOGGER := 0
|
||||||
|
@ -1,78 +0,0 @@
|
|||||||
|
|
||||||
#include <stdio.h>
|
|
||||||
#include <string.h>
|
|
||||||
|
|
||||||
#include <file/file_extract.h>
|
|
||||||
#include <file/file_path.h>
|
|
||||||
#include <retro_assert.h>
|
|
||||||
#include <retro_stat.h>
|
|
||||||
#include <retro_miscellaneous.h>
|
|
||||||
|
|
||||||
#include "../native/com_retroarch_browser_NativeInterface.h"
|
|
||||||
|
|
||||||
struct userdata
|
|
||||||
{
|
|
||||||
const char *subdir;
|
|
||||||
const char *dest;
|
|
||||||
};
|
|
||||||
|
|
||||||
static int zlib_cb(const char *name, const char *valid_exts,
|
|
||||||
const uint8_t *cdata,
|
|
||||||
unsigned cmode, uint32_t csize, uint32_t size,
|
|
||||||
uint32_t crc32, void *userdata)
|
|
||||||
{
|
|
||||||
char path[PATH_MAX];
|
|
||||||
char path_dir[PATH_MAX];
|
|
||||||
struct userdata *user = userdata;
|
|
||||||
const char *subdir = user->subdir;
|
|
||||||
const char *dest = user->dest;
|
|
||||||
|
|
||||||
if (strstr(name, subdir) != name)
|
|
||||||
return 1;
|
|
||||||
|
|
||||||
name += strlen(subdir) + 1;
|
|
||||||
|
|
||||||
fill_pathname_join(path, dest, name, sizeof(path));
|
|
||||||
fill_pathname_basedir(path_dir, path, sizeof(path_dir));
|
|
||||||
|
|
||||||
if (!path_mkdir(path_dir))
|
|
||||||
goto error;
|
|
||||||
|
|
||||||
printf("Extracting %s -> %s ...\n", name, path);
|
|
||||||
|
|
||||||
if (!zlib_perform_mode(path, valid_exts,
|
|
||||||
cdata, cmode, csize, size, crc32, userdata))
|
|
||||||
goto error;
|
|
||||||
|
|
||||||
return 1;
|
|
||||||
|
|
||||||
error:
|
|
||||||
printf("Failed to deflate to: %s.\n", path);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
JNIEXPORT jboolean JNICALL Java_com_retroarch_browser_NativeInterface_extractArchiveTo(
|
|
||||||
JNIEnv *env, jclass cls, jstring archive, jstring subdir, jstring dest)
|
|
||||||
{
|
|
||||||
const char *archive_c = (*env)->GetStringUTFChars(env, archive, NULL);
|
|
||||||
const char *subdir_c = (*env)->GetStringUTFChars(env, subdir, NULL);
|
|
||||||
const char *dest_c = (*env)->GetStringUTFChars(env, dest, NULL);
|
|
||||||
|
|
||||||
jboolean ret = JNI_TRUE;
|
|
||||||
|
|
||||||
struct userdata data = {
|
|
||||||
.subdir = subdir_c,
|
|
||||||
.dest = dest_c,
|
|
||||||
};
|
|
||||||
|
|
||||||
if (!zlib_parse_file(archive_c, NULL, zlib_cb, &data))
|
|
||||||
{
|
|
||||||
printf("Failed to parse APK: %s.\n", archive_c);
|
|
||||||
ret = JNI_FALSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
(*env)->ReleaseStringUTFChars(env, archive, archive_c);
|
|
||||||
(*env)->ReleaseStringUTFChars(env, subdir, subdir_c);
|
|
||||||
(*env)->ReleaseStringUTFChars(env, dest, dest_c);
|
|
||||||
return ret;
|
|
||||||
}
|
|
@ -1,21 +0,0 @@
|
|||||||
/* DO NOT EDIT THIS FILE - it is machine generated */
|
|
||||||
#include <jni.h>
|
|
||||||
/* Header for class com_retroarch_browser_NativeInterface */
|
|
||||||
|
|
||||||
#ifndef _Included_com_retroarch_browser_NativeInterface
|
|
||||||
#define _Included_com_retroarch_browser_NativeInterface
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
/*
|
|
||||||
* Class: com_retroarch_browser_NativeInterface
|
|
||||||
* Method: extractArchiveTo
|
|
||||||
* Signature: (Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Z
|
|
||||||
*/
|
|
||||||
JNIEXPORT jboolean JNICALL Java_com_retroarch_browser_NativeInterface_extractArchiveTo
|
|
||||||
(JNIEnv *, jclass, jstring, jstring, jstring);
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
#endif
|
|
@ -1,20 +0,0 @@
|
|||||||
package com.retroarch.browser;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Helper class which calls into JNI for various tasks.
|
|
||||||
*/
|
|
||||||
public final class NativeInterface
|
|
||||||
{
|
|
||||||
static
|
|
||||||
{
|
|
||||||
System.loadLibrary("retroarch-jni");
|
|
||||||
}
|
|
||||||
|
|
||||||
// Disallow explicit instantiation.
|
|
||||||
private NativeInterface()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
public static native boolean extractArchiveTo(String archive,
|
|
||||||
String subDirectory, String destinationFolder);
|
|
||||||
}
|
|
@ -25,7 +25,6 @@ import android.os.Environment;
|
|||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
|
|
||||||
import com.retroarch.R;
|
import com.retroarch.R;
|
||||||
import com.retroarch.browser.NativeInterface;
|
|
||||||
import com.retroarch.browser.preferences.fragments.util.PreferenceListFragment;
|
import com.retroarch.browser.preferences.fragments.util.PreferenceListFragment;
|
||||||
import com.retroarch.browser.preferences.util.UserPreferences;
|
import com.retroarch.browser.preferences.util.UserPreferences;
|
||||||
import com.retroarch.browser.retroactivity.RetroActivityFuture;
|
import com.retroarch.browser.retroactivity.RetroActivityFuture;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user