Merge branch 'master' into feature/redesign
This commit is contained in:
commit
22c9d836e0
@ -6,7 +6,7 @@ import java.io.File
|
||||
object Const {
|
||||
|
||||
// Paths
|
||||
const val MAGISK_PATH = "/sbin/.magisk/img"
|
||||
const val MAGISK_PATH = "/sbin/.magisk/modules"
|
||||
var MAGISK_DISABLE_FILE = File("xxx")
|
||||
const val TMP_FOLDER_PATH = "/dev/tmp"
|
||||
const val MAGISK_LOG = "/cache/magisk.log"
|
||||
@ -23,8 +23,8 @@ object Const {
|
||||
val USER_ID = Process.myUid() / 100000
|
||||
|
||||
object Version {
|
||||
const val MIN_VERSION = "v18.0"
|
||||
const val MIN_VERCODE = 18000
|
||||
const val MIN_VERSION = "v19.0"
|
||||
const val MIN_VERCODE = 19000
|
||||
const val CONNECT_MODE = 20100
|
||||
const val PROVIDER_CONNECT = 20102
|
||||
}
|
||||
|
@ -18,6 +18,9 @@
|
||||
<androidx.constraintlayout.widget.ConstraintLayout
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="?selectableItemBackground"
|
||||
android:clickable="false"
|
||||
android:focusable="false"
|
||||
android:onClick="@{() -> item.toggle()}">
|
||||
|
||||
<androidx.appcompat.widget.AppCompatTextView
|
||||
@ -38,10 +41,11 @@
|
||||
|
||||
<androidx.appcompat.widget.AppCompatImageView
|
||||
android:id="@+id/hide_process_icon"
|
||||
android:focusable="true"
|
||||
android:clickable="true"
|
||||
style="@style/Widget.Icon"
|
||||
isChecked="@{item.isHidden}"
|
||||
android:background="@null"
|
||||
android:clickable="false"
|
||||
android:focusable="false"
|
||||
app:layout_constraintBottom_toBottomOf="parent"
|
||||
app:layout_constraintEnd_toEndOf="parent"
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
|
@ -1,4 +1,3 @@
|
||||
# v7.5.0
|
||||
- Support new communication method (ContentProvider)
|
||||
- Fix several issues with hidden stub APK
|
||||
- Support using BiometricPrompt (face unlock)
|
||||
# v7.5.1
|
||||
- Fix toggling app components in MagiskHide screen
|
||||
- Update translations
|
||||
|
@ -89,8 +89,8 @@ EOF
|
||||
|
||||
add_hosts_module() {
|
||||
# Do not touch existing hosts module
|
||||
[ -d /sbin/.magisk/img/hosts ] && return
|
||||
cd /sbin/.magisk/img
|
||||
[ -d /sbin/.magisk/modules/hosts ] && return
|
||||
cd /sbin/.magisk/modules
|
||||
mkdir -p hosts/system/etc
|
||||
cat << EOF > hosts/module.prop
|
||||
id=hosts
|
||||
@ -99,17 +99,10 @@ version=1.0
|
||||
versionCode=1
|
||||
author=Magisk Manager
|
||||
description=Magisk Manager built-in systemless hosts module
|
||||
minMagisk=17000
|
||||
EOF
|
||||
if [ -f .core/hosts ]; then
|
||||
# Migrate old hosts file to new module
|
||||
mv -f .core/hosts hosts/system/etc/hosts
|
||||
else
|
||||
cp -f /system/etc/hosts hosts/system/etc/hosts
|
||||
fi
|
||||
cp -f /system/etc/hosts hosts/system/etc/hosts
|
||||
magisk --clone-attr /system/etc/hosts hosts/system/etc/hosts
|
||||
touch hosts/update
|
||||
touch hosts/auto_mount
|
||||
cd /
|
||||
}
|
||||
|
||||
|
@ -8,6 +8,7 @@
|
||||
<string name="settings">Configuració</string>
|
||||
<string name="install">Instal·lar</string>
|
||||
<string name="unsupport_magisk_title">Versió de Magisk incompatible</string>
|
||||
<string name="unsupport_magisk_msg">Aquesta versió de Magisk Manager no suporta versions de Magisk més petites que la %1$s.\n\nL\'App es comportarà com si Magisk no estigués instal·lat, si us plau actualitzi Magisk el més aviat possible.</string>
|
||||
|
||||
<!--Status Fragment-->
|
||||
<string name="magisk_version_error">Magisk no està instal·lat</string>
|
||||
|
@ -7,6 +7,7 @@
|
||||
<string name="settings">Setelan</string>
|
||||
<string name="install">Pasang</string>
|
||||
<string name="unsupport_magisk_title">Versi Magisk Tidak Didukung</string>
|
||||
<string name="unsupport_magisk_msg">Magisk Manager versi ini tidak mendukung versi Magisk di bawah %1$s.\n\nAplikasi akan bertingkah seperti tidak ada Magisk terpasang, silakan perbarui Magisk sesegera mungkin.</string>
|
||||
|
||||
<!--Status Fragment-->
|
||||
<string name="magisk_version_error">Magisk tidak terpasang.</string>
|
||||
@ -16,17 +17,18 @@
|
||||
<string name="checking_safetyNet_status">Memeriksa status SafetyNet…</string>
|
||||
<string name="safetyNet_check_success">Pemeriksaan SafetyNet Berhasil</string>
|
||||
<string name="safetyNet_api_error">Kesalahan pada API SafetyNet</string>
|
||||
<string name="safetyNet_res_invalid">Tanggapan tidak valid.</string>
|
||||
<string name="safetyNet_res_invalid">Tanggapan tidak valid</string>
|
||||
<string name="magisk_up_to_date">Magisk dalam versi terbaru</string>
|
||||
<string name="manager_up_to_date">Magisk Manager dalam versi terbaru</string>
|
||||
<string name="advanced_settings_title">Opsi Lanjutan</string>
|
||||
<string name="keep_force_encryption">Pertahankan enkripsi paksa</string>
|
||||
<string name="keep_dm_verity">Pertahankan AVB 2.0/dm-verity</string>
|
||||
<string name="recovery_mode">Mode Pemulihan</string>
|
||||
<string name="current_installed">Terpasang: %1$s</string>
|
||||
<string name="latest_version">Terbaru: %1$s</string>
|
||||
<string name="uninstall">Copot</string>
|
||||
<string name="uninstall_magisk_title">Copot Magisk</string>
|
||||
<string name="uninstall_magisk_msg">Semua modul akan dinonaktifkan/dihapus. Root akan dihapus, dan berpotensi mengenkripsi data Anda jika belum.</string>
|
||||
<string name="uninstall_magisk_msg">Semua modul akan dinonaktifkan/dihapus!\nRoot akan dihapus!\nData Anda berpotensi terenkripsi jika belum!</string>
|
||||
<string name="update">Perbarui</string>
|
||||
<string name="core_only_enabled">(Mode core only aktif)</string>
|
||||
|
||||
@ -73,7 +75,7 @@
|
||||
<string name="manager_update_title">Pembaruan Magisk Manager Tersedia!</string>
|
||||
|
||||
<!--Installation-->
|
||||
<string name="manager_download_install">Tekan untuk unduh dan pasang.</string>
|
||||
<string name="manager_download_install">Tekan untuk unduh dan pasang</string>
|
||||
<string name="download_zip_only">Unduh Zip Saja</string>
|
||||
<string name="direct_install">Pasang Langsung (Direkomendasikan)</string>
|
||||
<string name="install_inactive_slot">Pasang ke Slot Nonaktif (Setelah OTA)</string>
|
||||
@ -89,7 +91,7 @@
|
||||
<string name="repo_install_msg">Apakah Anda ingin memasang %1$s sekarang?</string>
|
||||
<string name="download">Unduh</string>
|
||||
<string name="reboot">Reboot</string>
|
||||
<string name="settings_reboot_toast">Reboot untuk menerapkan perubahan.</string>
|
||||
<string name="settings_reboot_toast">Reboot untuk menerapkan perubahan</string>
|
||||
<string name="release_notes">Catatan rilis</string>
|
||||
<string name="repo_cache_cleared">Cache repo dibersihkan</string>
|
||||
|
||||
@ -100,7 +102,7 @@
|
||||
<string name="failure">Gagal</string>
|
||||
<string name="hide_manager_title">Menyembunyikan Magisk Manager…</string>
|
||||
<string name="hide_manager_fail_toast">Kesalahan menyembunyikan Magisk Manager.</string>
|
||||
<string name="open_link_failed_toast">Tidak ada aplikasi ditemukan untuk membuka tautan.</string>
|
||||
<string name="open_link_failed_toast">Tidak ada aplikasi ditemukan untuk membuka tautan</string>
|
||||
<string name="warning">Peringatan</string>
|
||||
<string name="complete_uninstall">Copot Total</string>
|
||||
<string name="restore_img">Pulihkan Image</string>
|
||||
@ -109,28 +111,29 @@
|
||||
<string name="restore_fail">Cadangan stock tidak ada!</string>
|
||||
<string name="proprietary_title">Unduh Kode Proprieter</string>
|
||||
<string name="proprietary_notice">Magisk Manager adalah aplikasi FOSS dan tidak menyertakan kode API proprieter Google SafetyNet.\n\nAkankah Anda mengizinkan Magisk Manager untuk mengunduh sebuah ekstensi (berisi GoogleApiClient) untuk pemeriksaan SafetyNet?</string>
|
||||
<string name="setup_fail">Penyiapan gagal.</string>
|
||||
<string name="setup_fail">Penyiapan gagal</string>
|
||||
<string name="env_fix_title">Memerlukan Penyiapan Tambahan</string>
|
||||
<string name="env_fix_msg">Perangkat Anda memerlukan penyiapan tambahan untuk Magisk dapat bekerja dengan baik. Ia akan mengunduh zip penyiapan Magisk, apakah Anda ingin melanjutkan sekarang?</string>
|
||||
<string name="setup_msg">Menjalankan penyiapan lingkungan…</string>
|
||||
<string name="authenticate">Otentikasi</string>
|
||||
|
||||
<!--Settings Activity -->
|
||||
<string name="settings_general_category">Umum</string>
|
||||
<string name="settings_dark_theme_title">Tema Gelap</string>
|
||||
<string name="settings_dark_theme_summary">Aktifkan tema gelap.</string>
|
||||
<string name="settings_dark_theme_summary">Aktifkan tema gelap</string>
|
||||
<string name="settings_download_path_title">Lokasi unduhan</string>
|
||||
<string name="settings_download_path_message">File akan disimpan ke %1$s</string>
|
||||
<string name="settings_clear_cache_title">Bersihkan Cache Repo</string>
|
||||
<string name="settings_clear_cache_summary">Bersihkan informasi ter-cache untuk repo online. Ini memaksa apl untuk menyegarkan secara online.</string>
|
||||
<string name="settings_clear_cache_summary">Bersihkan informasi ter-cache untuk repo online. Ini memaksa apl untuk menyegarkan secara online</string>
|
||||
<string name="settings_hide_manager_title">Sembunyikan Magisk Manager</string>
|
||||
<string name="settings_hide_manager_summary">Pak ulang Magisk Manager dengan nama paket acak.</string>
|
||||
<string name="settings_hide_manager_summary">Pak ulang Magisk Manager dengan nama paket dan apl acak</string>
|
||||
<string name="settings_restore_manager_title">Pulihkan Magisk Manager</string>
|
||||
<string name="settings_restore_manager_summary">Pulihkan Magisk Manager dengan paket asli</string>
|
||||
<string name="settings_restore_manager_summary">Pulihkan Magisk Manager dengan paket dan nama asli</string>
|
||||
<string name="language">Bahasa</string>
|
||||
<string name="system_default">(Default Sistem)</string>
|
||||
<string name="settings_update">Setelan Pembaruan</string>
|
||||
<string name="settings_check_update_title">Periksa Pembaruan</string>
|
||||
<string name="settings_check_update_summary">Secara periodik memeriksa pembaruan di latar belakang.</string>
|
||||
<string name="settings_check_update_summary">Secara periodik memeriksa pembaruan di latar belakang</string>
|
||||
<string name="settings_update_channel_title">Kanal Pembaruan</string>
|
||||
<string name="settings_update_stable">Stabil</string>
|
||||
<string name="settings_update_beta">Beta</string>
|
||||
@ -138,11 +141,15 @@
|
||||
<string name="settings_update_custom_msg">Masukkan sebuah URL kustom</string>
|
||||
<string name="settings_core_only_title">Magisk Mode Core Only</string>
|
||||
<string name="settings_core_only_summary">Aktifkan fitur inti saja. MagiskSU dan MagiskHide akan tetap diaktifkan</string>
|
||||
<string name="settings_magiskhide_summary">Sembunyikan Magisk dari berbagai bentuk pendeteksian.</string>
|
||||
<string name="settings_magiskhide_summary">Sembunyikan Magisk dari berbagai bentuk pendeteksian</string>
|
||||
<string name="settings_hosts_title">Host tanpa sistem</string>
|
||||
<string name="settings_hosts_summary">Dukungan host tanpa sistem untuk apl pemblokir iklan.</string>
|
||||
<string name="settings_hosts_summary">Dukungan host tanpa sistem untuk apl pemblokir iklan</string>
|
||||
<string name="settings_hosts_toast">Ditambahkan modul host tanpa sistem</string>
|
||||
|
||||
<string name="settings_app_name">Ketik nama apl yang diinginkan</string>
|
||||
<string name="settings_app_name_hint">Nama baru</string>
|
||||
<string name="settings_app_name_helper">Apl akan dipak ulang ke nama ini</string>
|
||||
<string name="settings_app_name_error">Format tidak valid</string>
|
||||
<string name="settings_su_app_adb">Apl dan ADB</string>
|
||||
<string name="settings_su_app">Apl saja</string>
|
||||
<string name="settings_su_adb">ADB saja</string>
|
||||
@ -160,22 +167,25 @@
|
||||
<string name="request_timeout_summary">%1$d detik</string>
|
||||
<string name="settings_su_reauth_title">Otentikasi ulang setelah pembaruan</string>
|
||||
<string name="settings_su_reauth_summary">Otentikasi ulang izin superuser setelah pembaruan sebuah aplikasi</string>
|
||||
<string name="settings_su_biometric_title">Aktifkan Otentikasi Biometrik</string>
|
||||
<string name="settings_su_biometric_summary">Gunakan otentikasi biometrik untuk mengizinkan permintaan superuser</string>
|
||||
<string name="no_biometric">Perangkat tidak didukung atau tidak ada opsi biometrik yang diaktifkan</string>
|
||||
|
||||
<string name="multiuser_mode">Mode Multipengguna</string>
|
||||
<string name="settings_owner_only">Pemilik Perangkat Saja</string>
|
||||
<string name="settings_owner_manage">Pemilik Perangkat Mengelola</string>
|
||||
<string name="settings_user_independent">Pengguna-Independen</string>
|
||||
<string name="owner_only_summary">Hanya pemilik yang memiliki akses root.</string>
|
||||
<string name="owner_manage_summary">Hanya pemilik yang dapat mengelola akses root dan menerima permintaan.</string>
|
||||
<string name="user_indepenent_summary">Setiap pengguna memiliki aturan root-nya sendiri.</string>
|
||||
<string name="owner_only_summary">Hanya pemilik yang memiliki akses root</string>
|
||||
<string name="owner_manage_summary">Hanya pemilik yang dapat mengelola akses root dan menerima permintaan</string>
|
||||
<string name="user_indepenent_summary">Setiap pengguna memiliki aturan root-nya sendiri</string>
|
||||
|
||||
<string name="mount_namespace_mode">Mode Mount Ruang Nama</string>
|
||||
<string name="settings_ns_global">Ruang Nama Global</string>
|
||||
<string name="settings_ns_requester">Ruang Nama Warisan</string>
|
||||
<string name="settings_ns_isolate">Ruang Nama Terisolasi</string>
|
||||
<string name="global_summary">Semua sesi root menggunakan mount ruang nama global.</string>
|
||||
<string name="requester_summary">Sesi root akan mewarisi ruang nama peminta mereka.</string>
|
||||
<string name="isolate_summary">Setiap sesi root akan memiliki ruang nama tersendiri.</string>
|
||||
<string name="global_summary">Semua sesi root menggunakan mount ruang nama global</string>
|
||||
<string name="requester_summary">Sesi root akan mewarisi ruang nama peminta mereka</string>
|
||||
<string name="isolate_summary">Setiap sesi root akan memiliki ruang nama tersendiri</string>
|
||||
<string name="settings_download_path_error">Kesalahan membuat folder. Folder harus dapat diakses dari direktori penyimpanan root dan bukan merupakan file.</string>
|
||||
|
||||
<!--Superuser-->
|
||||
|
@ -8,6 +8,7 @@
|
||||
<string name="settings">Ustawienia</string>
|
||||
<string name="install">Instaluj</string>
|
||||
<string name="unsupport_magisk_title">Nieobsługiwana Wersja Magisk</string>
|
||||
<string name="unsupport_magisk_msg">Ta wersja Magisk Managera nie obsługuje wersji Magiska poniżej %1$s.\n\nZaktualizuj Magisk.</string>
|
||||
|
||||
<!--Status Fragment-->
|
||||
<string name="magisk_version_error">Magisk nie jest zainstalowany.</string>
|
||||
@ -166,7 +167,10 @@
|
||||
<string name="request_timeout_summary">%1$d sekund</string>
|
||||
<string name="settings_su_reauth_title">Ponowienie uwierzytelnienia po aktualizacji</string>
|
||||
<string name="settings_su_reauth_summary">Ponowne uwierzytelnianie uprawnienia superużytkownika po aktualizacji aplikacji</string>
|
||||
|
||||
<string name="settings_su_biometric_title">Uwierzytelnianie odciskiem palca</string>
|
||||
<string name="settings_su_biometric_summary">Użyj odcisku palca aby przyznać uprawnienia superużytkownika</string>
|
||||
<string name="no_biometric">Niewspierane urządzenie lub brak odcisku palca</string>
|
||||
|
||||
<string name="multiuser_mode">Tryb Multiusera</string>
|
||||
<string name="settings_owner_only">Tylko Właściciel Urządzenia</string>
|
||||
<string name="settings_owner_manage">Zarządzanie Właścicielami Urządzenia</string>
|
||||
|
@ -90,11 +90,10 @@
|
||||
<string name="repo_install_title">Nainštalovať %1$s</string>
|
||||
<string name="repo_install_msg">Chcete teraz nainštalovať %1$s?</string>
|
||||
<string name="download">Stiahnuť</string>
|
||||
<string name="reboot">Reštart</string>
|
||||
<string name="reboot">Reštartovať</string>
|
||||
<string name="settings_reboot_toast">Pre aplikovanie nastavení je potrebný reštart</string>
|
||||
<string name="release_notes">Poznámky k vydaniu</string>
|
||||
<string name="repo_cache_cleared">Cache repo odstránená</string>
|
||||
|
||||
<string name="dtbo_patched_title">DTBO bol zaplátaný!</string>
|
||||
<string name="dtbo_patched_reboot">Magisk Manager zaplátal dtbo.img, prosím, reštartujte.</string>
|
||||
<string name="flashing">Flashovanie</string>
|
||||
@ -115,6 +114,7 @@
|
||||
<string name="env_fix_title">Vyžaduje sa ďalšie nastavenie</string>
|
||||
<string name="env_fix_msg">Vaše zariadenie si vyžaduje ďalšie nastavenie pre správne fungovanie Magisk. Stiahne sa inštalačný zip súbor Magisk, chcete pokračovať teraz?</string>
|
||||
<string name="setup_msg">Nastavenie je spustené…</string>
|
||||
<string name="authenticate">Autentifikácia</string>
|
||||
|
||||
<!--Settings Activity -->
|
||||
<string name="settings_general_category">Všeobecné</string>
|
||||
@ -166,6 +166,9 @@
|
||||
<string name="request_timeout_summary">%1$d sekúnd</string>
|
||||
<string name="settings_su_reauth_title">Overenie autentifikácie po upgrade</string>
|
||||
<string name="settings_su_reauth_summary">Overí autentifikáciu oprávnení superuser po upgrade aplikácie</string>
|
||||
<string name="settings_su_biometric_title">Povoliť biometrickú autentifikáciu</string>
|
||||
<string name="settings_su_biometric_summary">Použite biometrickú autentifikáciu pre povolenie žiadostí superuser</string>
|
||||
<string name="no_biometric">Nepodporované zariadenia alebo biometria nie je povolená v nastaveniach</string>
|
||||
|
||||
<string name="multiuser_mode">Režim viacerých používateľov</string>
|
||||
<string name="settings_owner_only">Iba majiteľ zariadenia</string>
|
||||
|
@ -13,6 +13,7 @@ LIBNANOPB := $(EXT_PATH)/nanopb
|
||||
LIBSYSTEMPROPERTIES := jni/systemproperties/include
|
||||
LIBUTILS := jni/utils/include
|
||||
LIBMINCRYPT := $(EXT_PATH)/mincrypt/include
|
||||
LIBXZ := $(EXT_PATH)/xz-embedded
|
||||
|
||||
########################
|
||||
# Binaries
|
||||
@ -22,11 +23,9 @@ ifdef B_MAGISK
|
||||
|
||||
include $(CLEAR_VARS)
|
||||
LOCAL_MODULE := magisk
|
||||
LOCAL_SHARED_LIBRARIES := libsqlite
|
||||
LOCAL_STATIC_LIBRARIES := libnanopb libsystemproperties libutils
|
||||
LOCAL_C_INCLUDES := \
|
||||
jni/include \
|
||||
$(EXT_PATH)/include \
|
||||
$(LIBNANOPB) \
|
||||
$(LIBSYSTEMPROPERTIES) \
|
||||
$(LIBUTILS)
|
||||
@ -98,9 +97,9 @@ ifdef BB_INIT
|
||||
LOCAL_STATIC_LIBRARIES := libsepol libxz libutils
|
||||
LOCAL_C_INCLUDES := \
|
||||
jni/include \
|
||||
$(EXT_PATH)/include \
|
||||
out \
|
||||
out/$(TARGET_ARCH_ABI) \
|
||||
$(LIBXZ) \
|
||||
$(LIBSEPOL) \
|
||||
$(LIBUTILS)
|
||||
|
||||
|
@ -341,13 +341,10 @@ static bool magisk_env() {
|
||||
|
||||
// Remove stuffs
|
||||
rm_rf("/cache/data_adb");
|
||||
rm_rf("/data/adb/modules/.core");
|
||||
unlink("/data/magisk.img");
|
||||
unlink("/data/magisk_debug.log");
|
||||
|
||||
// Backwards compatibility
|
||||
symlink("./.magisk", "/sbin/.core");
|
||||
symlink("./modules", MAGISKTMP "/img");
|
||||
|
||||
// Directories in tmpfs overlay
|
||||
xmkdir(MIRRDIR, 0);
|
||||
xmkdir(BLOCKDIR, 0);
|
||||
@ -431,10 +428,6 @@ static void prepare_modules() {
|
||||
rm_rf(MODULEUPGRADE);
|
||||
}
|
||||
bind_mount(MIRRDIR MODULEROOT, MODULEMNT, false);
|
||||
// Legacy support
|
||||
xmkdir(LEGACYCORE, 0755);
|
||||
symlink(SECURE_DIR "/post-fs-data.d", LEGACYCORE "/post-fs-data.d");
|
||||
symlink(SECURE_DIR "/service.d", LEGACYCORE "/service.d");
|
||||
|
||||
restorecon();
|
||||
chmod(SECURE_DIR, 0700);
|
||||
|
@ -3,6 +3,7 @@
|
||||
#include <time.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
#include <dlfcn.h>
|
||||
#include <sys/stat.h>
|
||||
|
||||
#include <magisk.h>
|
||||
@ -14,8 +15,93 @@
|
||||
|
||||
using namespace std;
|
||||
|
||||
typedef struct sqlite3 sqlite3;
|
||||
|
||||
static sqlite3 *mDB = nullptr;
|
||||
|
||||
// SQLite APIs
|
||||
|
||||
#define SQLITE_OPEN_READWRITE 0x00000002 /* Ok for sqlite3_open_v2() */
|
||||
#define SQLITE_OPEN_CREATE 0x00000004 /* Ok for sqlite3_open_v2() */
|
||||
#define SQLITE_OPEN_FULLMUTEX 0x00010000 /* Ok for sqlite3_open_v2() */
|
||||
|
||||
static int (*sqlite3_open_v2)(
|
||||
const char *filename,
|
||||
sqlite3 **ppDb,
|
||||
int flags,
|
||||
const char *zVfs);
|
||||
static const char *(*sqlite3_errmsg)(sqlite3 *db);
|
||||
static int (*sqlite3_close)(sqlite3 *db);
|
||||
static void (*sqlite3_free)(void *v);
|
||||
static int (*sqlite3_exec)(
|
||||
sqlite3 *db,
|
||||
const char *sql,
|
||||
int (*callback)(void*, int, char**, char**),
|
||||
void *v,
|
||||
char **errmsg);
|
||||
|
||||
// Internal Android linker APIs
|
||||
|
||||
static void (*android_get_LD_LIBRARY_PATH)(char *buffer, size_t buffer_size);
|
||||
static void (*android_update_LD_LIBRARY_PATH)(const char *ld_library_path);
|
||||
|
||||
#define DLERR(ptr) if (!(ptr)) { \
|
||||
LOGE("db: %s\n", dlerror()); \
|
||||
return false; \
|
||||
}
|
||||
|
||||
#define DLOAD(handle, arg) {\
|
||||
auto f = dlsym(handle, #arg); \
|
||||
DLERR(f) \
|
||||
*(void **) &(arg) = f; \
|
||||
}
|
||||
|
||||
#if defined(__aarch64__) || defined(__x86_64__)
|
||||
constexpr char apex_path[] = ":/apex/com.android.runtime/lib64";
|
||||
#else
|
||||
constexpr char apex_path[] = ":/apex/com.android.runtime/lib";
|
||||
#endif
|
||||
|
||||
static int dl_init = 0;
|
||||
|
||||
static bool dload_sqlite() {
|
||||
if (dl_init)
|
||||
return dl_init > 0;
|
||||
dl_init = -1;
|
||||
|
||||
auto sqlite = dlopen("libsqlite.so", RTLD_LAZY);
|
||||
if (!sqlite) {
|
||||
// Should only happen on Android 10+
|
||||
auto dl = dlopen("libdl_android.so", RTLD_LAZY);
|
||||
DLERR(dl);
|
||||
|
||||
DLOAD(dl, android_get_LD_LIBRARY_PATH);
|
||||
DLOAD(dl, android_update_LD_LIBRARY_PATH);
|
||||
|
||||
// Inject APEX into LD_LIBRARY_PATH
|
||||
char ld_path[4096];
|
||||
android_get_LD_LIBRARY_PATH(ld_path, sizeof(ld_path));
|
||||
int len = strlen(ld_path);
|
||||
strcpy(ld_path + len, apex_path);
|
||||
android_update_LD_LIBRARY_PATH(ld_path);
|
||||
sqlite = dlopen("libsqlite.so", RTLD_LAZY);
|
||||
|
||||
// Revert LD_LIBRARY_PATH just in case
|
||||
ld_path[len] = '\0';
|
||||
android_update_LD_LIBRARY_PATH(ld_path);
|
||||
}
|
||||
DLERR(sqlite);
|
||||
|
||||
DLOAD(sqlite, sqlite3_open_v2);
|
||||
DLOAD(sqlite, sqlite3_errmsg);
|
||||
DLOAD(sqlite, sqlite3_close);
|
||||
DLOAD(sqlite, sqlite3_exec);
|
||||
DLOAD(sqlite, sqlite3_free);
|
||||
|
||||
dl_init = 1;
|
||||
return true;
|
||||
}
|
||||
|
||||
int db_strings::getKeyIdx(string_view key) const {
|
||||
int idx = DB_STRING_NUM;
|
||||
for (int i = 0; i < DB_STRING_NUM; ++i) {
|
||||
@ -50,6 +136,9 @@ static int ver_cb(void *ver, int, char **data, char **) {
|
||||
#define err_ret(e) if (e) return e;
|
||||
|
||||
static char *open_and_init_db(sqlite3 *&db) {
|
||||
if (!dload_sqlite())
|
||||
return strdup("Cannot load libsqlite.so");
|
||||
|
||||
int ret = sqlite3_open_v2(MAGISKDB, &db,
|
||||
SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE | SQLITE_OPEN_FULLMUTEX, nullptr);
|
||||
if (ret)
|
||||
@ -304,3 +393,12 @@ void exec_sql(int client) {
|
||||
write_int(client, 0);
|
||||
db_err_cmd(err, return; );
|
||||
}
|
||||
|
||||
bool db_err(char *e) {
|
||||
if (e) {
|
||||
LOGE("sqlite3_exec: %s\n", e);
|
||||
sqlite3_free(e);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
22
native/jni/external/Android.mk
vendored
22
native/jni/external/Android.mk
vendored
@ -1,27 +1,9 @@
|
||||
LOCAL_PATH := $(call my-dir)
|
||||
|
||||
ifdef B_MAGISK
|
||||
|
||||
# libsqlite.so (stub)
|
||||
include $(CLEAR_VARS)
|
||||
LOCAL_MODULE:= libsqlite
|
||||
LOCAL_C_INCLUDES := $(EXT_PATH)/include
|
||||
LOCAL_SRC_FILES := stubs/sqlite3_stub.c
|
||||
include $(BUILD_SHARED_LIBRARY)
|
||||
|
||||
endif
|
||||
|
||||
# libselinux.so (stub)
|
||||
#include $(CLEAR_VARS)
|
||||
#LOCAL_MODULE:= libselinux
|
||||
#LOCAL_C_INCLUDES := $(LIBSELINUX)
|
||||
#LOCAL_SRC_FILES := stubs/selinux_stub.c
|
||||
#include $(BUILD_SHARED_LIBRARY)
|
||||
|
||||
# libxz.a
|
||||
include $(CLEAR_VARS)
|
||||
LOCAL_MODULE:= libxz
|
||||
LOCAL_C_INCLUDES := $(EXT_PATH)/include
|
||||
LOCAL_C_INCLUDES := $(LIBXZ)
|
||||
LOCAL_SRC_FILES := \
|
||||
xz-embedded/xz_crc32.c \
|
||||
xz-embedded/xz_dec_lzma2.c \
|
||||
@ -83,7 +65,7 @@ include $(BUILD_STATIC_LIBRARY)
|
||||
include $(CLEAR_VARS)
|
||||
LOCAL_MODULE := liblzma
|
||||
LOCAL_C_INCLUDES += \
|
||||
$(EXT_PATH)/include/xz_config \
|
||||
$(EXT_PATH)/xz_config \
|
||||
$(EXT_PATH)/xz/src/common \
|
||||
$(EXT_PATH)/xz/src/liblzma/api \
|
||||
$(EXT_PATH)/xz/src/liblzma/check \
|
||||
|
11573
native/jni/external/include/sqlite3.h
vendored
11573
native/jni/external/include/sqlite3.h
vendored
File diff suppressed because it is too large
Load Diff
356
native/jni/external/stubs/selinux_stub.c
vendored
356
native/jni/external/stubs/selinux_stub.c
vendored
@ -1,356 +0,0 @@
|
||||
#include <stdbool.h>
|
||||
#include <selinux/avc.h>
|
||||
#include <selinux/context.h>
|
||||
#include <selinux/get_context_list.h>
|
||||
#include <selinux/get_default_type.h>
|
||||
#include <selinux/label.h>
|
||||
#include <selinux/restorecon.h>
|
||||
#include <selinux/selinux.h>
|
||||
int is_selinux_enabled(void) { return 0; }
|
||||
int is_selinux_mls_enabled(void) { return 0; }
|
||||
void freecon(char * con) { }
|
||||
void freeconary(char ** con) { }
|
||||
int getcon(char ** con) { return 0; }
|
||||
int getcon_raw(char ** con) { return 0; }
|
||||
int setcon(const char * con) { return 0; }
|
||||
int setcon_raw(const char * con) { return 0; }
|
||||
int getpidcon(pid_t pid, char ** con) { return 0; }
|
||||
int getpidcon_raw(pid_t pid, char ** con) { return 0; }
|
||||
int getprevcon(char ** con) { return 0; }
|
||||
int getprevcon_raw(char ** con) { return 0; }
|
||||
int getexeccon(char ** con) { return 0; }
|
||||
int getexeccon_raw(char ** con) { return 0; }
|
||||
int setexeccon(const char * con) { return 0; }
|
||||
int setexeccon_raw(const char * con) { return 0; }
|
||||
int getfscreatecon(char ** con) { return 0; }
|
||||
int getfscreatecon_raw(char ** con) { return 0; }
|
||||
int setfscreatecon(const char * context) { return 0; }
|
||||
int setfscreatecon_raw(const char * context) { return 0; }
|
||||
int getkeycreatecon(char ** con) { return 0; }
|
||||
int getkeycreatecon_raw(char ** con) { return 0; }
|
||||
int setkeycreatecon(const char * context) { return 0; }
|
||||
int setkeycreatecon_raw(const char * context) { return 0; }
|
||||
int getsockcreatecon(char ** con) { return 0; }
|
||||
int getsockcreatecon_raw(char ** con) { return 0; }
|
||||
int setsockcreatecon(const char * context) { return 0; }
|
||||
int setsockcreatecon_raw(const char * context) { return 0; }
|
||||
int getfilecon(const char *path, char ** con) { return 0; }
|
||||
int getfilecon_raw(const char *path, char ** con) { return 0; }
|
||||
int lgetfilecon(const char *path, char ** con) { return 0; }
|
||||
int lgetfilecon_raw(const char *path, char ** con) { return 0; }
|
||||
int fgetfilecon(int fd, char ** con) { return 0; }
|
||||
int fgetfilecon_raw(int fd, char ** con) { return 0; }
|
||||
int setfilecon(const char *path, const char * con) { return 0; }
|
||||
int setfilecon_raw(const char *path, const char * con) { return 0; }
|
||||
int lsetfilecon(const char *path, const char * con) { return 0; }
|
||||
int lsetfilecon_raw(const char *path, const char * con) { return 0; }
|
||||
int fsetfilecon(int fd, const char * con) { return 0; }
|
||||
int fsetfilecon_raw(int fd, const char * con) { return 0; }
|
||||
int getpeercon(int fd, char ** con) { return 0; }
|
||||
int getpeercon_raw(int fd, char ** con) { return 0; }
|
||||
void selinux_set_callback(int type, union selinux_callback cb) { }
|
||||
int security_compute_av(const char * scon,
|
||||
const char * tcon,
|
||||
security_class_t tclass,
|
||||
access_vector_t requested,
|
||||
struct av_decision *avd) { return 0; }
|
||||
int security_compute_av_raw(const char * scon,
|
||||
const char * tcon,
|
||||
security_class_t tclass,
|
||||
access_vector_t requested,
|
||||
struct av_decision *avd) { return 0; }
|
||||
int security_compute_av_flags(const char * scon,
|
||||
const char * tcon,
|
||||
security_class_t tclass,
|
||||
access_vector_t requested,
|
||||
struct av_decision *avd) { return 0; }
|
||||
int security_compute_av_flags_raw(const char * scon,
|
||||
const char * tcon,
|
||||
security_class_t tclass,
|
||||
access_vector_t requested,
|
||||
struct av_decision *avd) { return 0; }
|
||||
int security_compute_create(const char * scon,
|
||||
const char * tcon,
|
||||
security_class_t tclass,
|
||||
char ** newcon) { return 0; }
|
||||
int security_compute_create_raw(const char * scon,
|
||||
const char * tcon,
|
||||
security_class_t tclass,
|
||||
char ** newcon) { return 0; }
|
||||
int security_compute_create_name(const char * scon,
|
||||
const char * tcon,
|
||||
security_class_t tclass,
|
||||
const char *objname,
|
||||
char ** newcon) { return 0; }
|
||||
int security_compute_create_name_raw(const char * scon,
|
||||
const char * tcon,
|
||||
security_class_t tclass,
|
||||
const char *objname,
|
||||
char ** newcon) { return 0; }
|
||||
int security_compute_relabel(const char * scon,
|
||||
const char * tcon,
|
||||
security_class_t tclass,
|
||||
char ** newcon) { return 0; }
|
||||
int security_compute_relabel_raw(const char * scon,
|
||||
const char * tcon,
|
||||
security_class_t tclass,
|
||||
char ** newcon) { return 0; }
|
||||
int security_compute_member(const char * scon,
|
||||
const char * tcon,
|
||||
security_class_t tclass,
|
||||
char ** newcon) { return 0; }
|
||||
int security_compute_member_raw(const char * scon,
|
||||
const char * tcon,
|
||||
security_class_t tclass,
|
||||
char ** newcon) { return 0; }
|
||||
int security_compute_user(const char * scon,
|
||||
const char *username,
|
||||
char *** con) { return 0; }
|
||||
int security_compute_user_raw(const char * scon,
|
||||
const char *username,
|
||||
char *** con) { return 0; }
|
||||
int security_load_policy(void *data, size_t len) { return 0; }
|
||||
int security_get_initial_context(const char *name,
|
||||
char ** con) { return 0; }
|
||||
int security_get_initial_context_raw(const char *name,
|
||||
char ** con) { return 0; }
|
||||
int selinux_mkload_policy(int preservebools) { return 0; }
|
||||
int selinux_init_load_policy(int *enforce) { return 0; }
|
||||
int security_set_boolean_list(size_t boolcnt,
|
||||
SELboolean * boollist, int permanent) { return 0; }
|
||||
int security_load_booleans(char *path) { return 0; }
|
||||
int security_check_context(const char * con) { return 0; }
|
||||
int security_check_context_raw(const char * con) { return 0; }
|
||||
int security_canonicalize_context(const char * con,
|
||||
char ** canoncon) { return 0; }
|
||||
int security_canonicalize_context_raw(const char * con,
|
||||
char ** canoncon) { return 0; }
|
||||
int security_getenforce(void) { return 0; }
|
||||
int security_setenforce(int value) { return 0; }
|
||||
int security_deny_unknown(void) { return 0; }
|
||||
int security_disable(void) { return 0; }
|
||||
int security_policyvers(void) { return 0; }
|
||||
int security_get_boolean_names(char ***names, int *len) { return 0; }
|
||||
int security_get_boolean_pending(const char *name) { return 0; }
|
||||
int security_get_boolean_active(const char *name) { return 0; }
|
||||
int security_set_boolean(const char *name, int value) { return 0; }
|
||||
int security_commit_booleans(void) { return 0; }
|
||||
int selinux_set_mapping(struct security_class_mapping *map) { return 0; }
|
||||
security_class_t mode_to_security_class(mode_t mode) { return 0; }
|
||||
security_class_t string_to_security_class(const char *name) { return 0; }
|
||||
const char *security_class_to_string(security_class_t cls) { return 0; }
|
||||
const char *security_av_perm_to_string(security_class_t tclass,
|
||||
access_vector_t perm) { return 0; }
|
||||
access_vector_t string_to_av_perm(security_class_t tclass,
|
||||
const char *name) { return 0; }
|
||||
int security_av_string(security_class_t tclass,
|
||||
access_vector_t av, char **result) { return 0; }
|
||||
void print_access_vector(security_class_t tclass, access_vector_t av) { }
|
||||
void set_matchpathcon_printf(void (*f) (const char *fmt, ...)) { }
|
||||
void set_matchpathcon_invalidcon(int (*f) (const char *path,
|
||||
unsigned lineno,
|
||||
char *context)) { }
|
||||
void set_matchpathcon_canoncon(int (*f) (const char *path,
|
||||
unsigned lineno,
|
||||
char **context)) { }
|
||||
void set_matchpathcon_flags(unsigned int flags) { }
|
||||
int matchpathcon_init(const char *path) { return 0; }
|
||||
int matchpathcon_init_prefix(const char *path, const char *prefix) { return 0; }
|
||||
void matchpathcon_fini(void) { }
|
||||
int realpath_not_final(const char *name, char *resolved_path) { return 0; }
|
||||
int matchpathcon(const char *path,
|
||||
mode_t mode, char ** con) { return 0; }
|
||||
int matchpathcon_index(const char *path,
|
||||
mode_t mode, char ** con) { return 0; }
|
||||
int matchpathcon_filespec_add(ino_t ino, int specind, const char *file) { return 0; }
|
||||
void matchpathcon_filespec_destroy(void) { }
|
||||
void matchpathcon_filespec_eval(void) { }
|
||||
void matchpathcon_checkmatches(char *str) { }
|
||||
int matchmediacon(const char *media, char ** con) { return 0; }
|
||||
int selinux_getenforcemode(int *enforce) { return 0; }
|
||||
char *selinux_boolean_sub(const char *boolean_name) { return 0; }
|
||||
int selinux_getpolicytype(char **policytype) { return 0; }
|
||||
const char *selinux_policy_root(void) { return 0; }
|
||||
int selinux_set_policy_root(const char *rootpath) { return 0; }
|
||||
const char *selinux_current_policy_path(void) { return 0; }
|
||||
const char *selinux_binary_policy_path(void) { return 0; }
|
||||
const char *selinux_failsafe_context_path(void) { return 0; }
|
||||
const char *selinux_removable_context_path(void) { return 0; }
|
||||
const char *selinux_default_context_path(void) { return 0; }
|
||||
const char *selinux_user_contexts_path(void) { return 0; }
|
||||
const char *selinux_file_context_path(void) { return 0; }
|
||||
const char *selinux_file_context_homedir_path(void) { return 0; }
|
||||
const char *selinux_file_context_local_path(void) { return 0; }
|
||||
const char *selinux_file_context_subs_path(void) { return 0; }
|
||||
const char *selinux_file_context_subs_dist_path(void) { return 0; }
|
||||
const char *selinux_homedir_context_path(void) { return 0; }
|
||||
const char *selinux_media_context_path(void) { return 0; }
|
||||
const char *selinux_virtual_domain_context_path(void) { return 0; }
|
||||
const char *selinux_virtual_image_context_path(void) { return 0; }
|
||||
const char *selinux_lxc_contexts_path(void) { return 0; }
|
||||
const char *selinux_x_context_path(void) { return 0; }
|
||||
const char *selinux_sepgsql_context_path(void) { return 0; }
|
||||
const char *selinux_openrc_contexts_path(void) { return 0; }
|
||||
const char *selinux_openssh_contexts_path(void) { return 0; }
|
||||
const char *selinux_snapperd_contexts_path(void) { return 0; }
|
||||
const char *selinux_systemd_contexts_path(void) { return 0; }
|
||||
const char *selinux_contexts_path(void) { return 0; }
|
||||
const char *selinux_securetty_types_path(void) { return 0; }
|
||||
const char *selinux_booleans_subs_path(void) { return 0; }
|
||||
const char *selinux_booleans_path(void) { return 0; }
|
||||
const char *selinux_customizable_types_path(void) { return 0; }
|
||||
const char *selinux_users_path(void) { return 0; }
|
||||
const char *selinux_usersconf_path(void) { return 0; }
|
||||
const char *selinux_translations_path(void) { return 0; }
|
||||
const char *selinux_colors_path(void) { return 0; }
|
||||
const char *selinux_netfilter_context_path(void) { return 0; }
|
||||
const char *selinux_path(void) { return 0; }
|
||||
int selinux_check_access(const char * scon, const char * tcon, const char *tclass, const char *perm, void *auditdata) { return 0; }
|
||||
int selinux_check_passwd_access(access_vector_t requested) { return 0; }
|
||||
int checkPasswdAccess(access_vector_t requested) { return 0; }
|
||||
int selinux_check_securetty_context(const char * tty_context) { return 0; }
|
||||
void set_selinuxmnt(const char *mnt) { }
|
||||
int selinuxfs_exists(void) { return 0; }
|
||||
void fini_selinuxmnt(void) {}
|
||||
int setexecfilecon(const char *filename, const char *fallback_type) { return 0; }
|
||||
#ifndef DISABLE_RPM
|
||||
int rpm_execcon(unsigned int verified,
|
||||
const char *filename,
|
||||
char *const argv[], char *const envp[]) { return 0; }
|
||||
#endif
|
||||
int is_context_customizable(const char * scontext) { return 0; }
|
||||
int selinux_trans_to_raw_context(const char * trans,
|
||||
char ** rawp) { return 0; }
|
||||
int selinux_raw_to_trans_context(const char * raw,
|
||||
char ** transp) { return 0; }
|
||||
int selinux_raw_context_to_color(const char * raw,
|
||||
char **color_str) { return 0; }
|
||||
int getseuserbyname(const char *linuxuser, char **seuser, char **level) { return 0; }
|
||||
int getseuser(const char *username, const char *service,
|
||||
char **r_seuser, char **r_level) { return 0; }
|
||||
int selinux_file_context_cmp(const char * a,
|
||||
const char * b) { return 0; }
|
||||
int selinux_file_context_verify(const char *path, mode_t mode) { return 0; }
|
||||
int selinux_lsetfilecon_default(const char *path) { return 0; }
|
||||
void selinux_reset_config(void) { }
|
||||
int avc_sid_to_context(security_id_t sid, char ** ctx) { return 0; }
|
||||
int avc_sid_to_context_raw(security_id_t sid, char ** ctx) { return 0; }
|
||||
int avc_context_to_sid(const char * ctx, security_id_t * sid) { return 0; }
|
||||
int avc_context_to_sid_raw(const char * ctx, security_id_t * sid) { return 0; }
|
||||
int sidget(security_id_t sid) { return 0; }
|
||||
int sidput(security_id_t sid) { return 0; }
|
||||
int avc_get_initial_sid(const char *name, security_id_t * sid) { return 0; }
|
||||
int avc_init(const char *msgprefix,
|
||||
const struct avc_memory_callback *mem_callbacks,
|
||||
const struct avc_log_callback *log_callbacks,
|
||||
const struct avc_thread_callback *thread_callbacks,
|
||||
const struct avc_lock_callback *lock_callbacks) { return 0; }
|
||||
int avc_open(struct selinux_opt *opts, unsigned nopts) { return 0; }
|
||||
void avc_cleanup(void) { }
|
||||
int avc_reset(void) { return 0; }
|
||||
void avc_destroy(void) { }
|
||||
int avc_has_perm_noaudit(security_id_t ssid,
|
||||
security_id_t tsid,
|
||||
security_class_t tclass,
|
||||
access_vector_t requested,
|
||||
struct avc_entry_ref *aeref, struct av_decision *avd) { return 0; }
|
||||
int avc_has_perm(security_id_t ssid, security_id_t tsid,
|
||||
security_class_t tclass, access_vector_t requested,
|
||||
struct avc_entry_ref *aeref, void *auditdata) { return 0; }
|
||||
void avc_audit(security_id_t ssid, security_id_t tsid,
|
||||
security_class_t tclass, access_vector_t requested,
|
||||
struct av_decision *avd, int result, void *auditdata) { }
|
||||
int avc_compute_create(security_id_t ssid,
|
||||
security_id_t tsid,
|
||||
security_class_t tclass, security_id_t * newsid) { return 0; }
|
||||
int avc_compute_member(security_id_t ssid,
|
||||
security_id_t tsid,
|
||||
security_class_t tclass, security_id_t * newsid) { return 0; }
|
||||
int avc_add_callback(int (*callback)
|
||||
(uint32_t event, security_id_t ssid,
|
||||
security_id_t tsid, security_class_t tclass,
|
||||
access_vector_t perms,
|
||||
access_vector_t * out_retained),
|
||||
uint32_t events, security_id_t ssid,
|
||||
security_id_t tsid, security_class_t tclass,
|
||||
access_vector_t perms) { return 0; }
|
||||
void avc_cache_stats(struct avc_cache_stats *stats) { }
|
||||
void avc_av_stats(void) { }
|
||||
void avc_sid_stats(void) { }
|
||||
int avc_netlink_open(int blocking) { return 0; }
|
||||
void avc_netlink_loop(void) { }
|
||||
void avc_netlink_close(void) { }
|
||||
int avc_netlink_acquire_fd(void) { return 0; }
|
||||
void avc_netlink_release_fd(void) { }
|
||||
int avc_netlink_check_nb(void) { return 0; }
|
||||
int selinux_status_open(int fallback) { return 0; }
|
||||
void selinux_status_close(void) { }
|
||||
int selinux_status_updated(void) { return 0; }
|
||||
int selinux_status_getenforce(void) { return 0; }
|
||||
int selinux_status_policyload(void) { return 0; }
|
||||
int selinux_status_deny_unknown(void) { return 0; }
|
||||
context_t context_new(const char *s) { return 0; }
|
||||
char *context_str(context_t c) { return 0; }
|
||||
void context_free(context_t c) { }
|
||||
const char *context_type_get(context_t c) { return 0; }
|
||||
const char *context_range_get(context_t c) { return 0; }
|
||||
const char *context_role_get(context_t c) { return 0; }
|
||||
const char *context_user_get(context_t c) { return 0; }
|
||||
int context_type_set(context_t c, const char *s) { return 0; }
|
||||
int context_range_set(context_t c, const char *s) { return 0; }
|
||||
int context_role_set(context_t c, const char *s) { return 0; }
|
||||
int context_user_set(context_t c, const char *s) { return 0; }
|
||||
int get_ordered_context_list(const char *user,
|
||||
char * fromcon,
|
||||
char *** list) { return 0; }
|
||||
int get_ordered_context_list_with_level(const char *user,
|
||||
const char *level,
|
||||
char * fromcon,
|
||||
char *** list) { return 0; }
|
||||
int get_default_context(const char *user,
|
||||
char * fromcon,
|
||||
char ** newcon) { return 0; }
|
||||
int get_default_context_with_level(const char *user,
|
||||
const char *level,
|
||||
char * fromcon,
|
||||
char ** newcon) { return 0; }
|
||||
int get_default_context_with_role(const char *user,
|
||||
const char *role,
|
||||
char * fromcon,
|
||||
char ** newcon) { return 0; }
|
||||
int get_default_context_with_rolelevel(const char *user,
|
||||
const char *role,
|
||||
const char *level,
|
||||
char * fromcon,
|
||||
char ** newcon) { return 0; }
|
||||
int query_user_context(char ** list,
|
||||
char ** newcon) { return 0; }
|
||||
int manual_user_enter_context(const char *user,
|
||||
char ** newcon) { return 0; }
|
||||
const char *selinux_default_type_path(void) { return 0; }
|
||||
int get_default_type(const char *role, char **type) { return 0; }
|
||||
struct selabel_handle *selabel_open(unsigned int backend,
|
||||
const struct selinux_opt *opts,
|
||||
unsigned nopts) { return 0; }
|
||||
void selabel_close(struct selabel_handle *handle) { }
|
||||
int selabel_lookup(struct selabel_handle *handle, char **con,
|
||||
const char *key, int type) { return 0; }
|
||||
int selabel_lookup_raw(struct selabel_handle *handle, char **con,
|
||||
const char *key, int type) { return 0; }
|
||||
bool selabel_partial_match(struct selabel_handle *handle, const char *key) { return 0; }
|
||||
int selabel_lookup_best_match(struct selabel_handle *rec, char **con,
|
||||
const char *key, const char **aliases, int type) { return 0; }
|
||||
int selabel_lookup_best_match_raw(struct selabel_handle *rec, char **con,
|
||||
const char *key, const char **aliases, int type) { return 0; }
|
||||
int selabel_digest(struct selabel_handle *rec,
|
||||
unsigned char **digest, size_t *digest_len,
|
||||
char ***specfiles, size_t *num_specfiles) { return 0; }
|
||||
void selabel_stats(struct selabel_handle *handle) { }
|
||||
int selinux_restorecon(const char *pathname,
|
||||
unsigned int restorecon_flags) { return 0; }
|
||||
struct selabel_handle *selinux_restorecon_default_handle(void) { return 0; }
|
||||
void selinux_restorecon_set_exclude_list(const char **exclude_list) { }
|
||||
int selinux_restorecon_set_alt_rootpath(const char *alt_rootpath) { return 0; }
|
||||
int selinux_restorecon_xattr(const char *pathname,
|
||||
unsigned int xattr_flags,
|
||||
struct dir_xattr ***xattr_list) { return 0; }
|
770
native/jni/external/stubs/sqlite3_stub.c
vendored
770
native/jni/external/stubs/sqlite3_stub.c
vendored
@ -1,770 +0,0 @@
|
||||
#include <sqlite3.h>
|
||||
SQLITE_API SQLITE_EXTERN const char sqlite3_version[];
|
||||
SQLITE_API const char *sqlite3_libversion(void) { return 0; }
|
||||
SQLITE_API const char *sqlite3_sourceid(void) { return 0; }
|
||||
SQLITE_API int sqlite3_libversion_number(void) { return 0; }
|
||||
SQLITE_API int sqlite3_compileoption_used(const char *zOptName) { return 0; }
|
||||
SQLITE_API const char *sqlite3_compileoption_get(int N) { return 0; }
|
||||
SQLITE_API int sqlite3_threadsafe(void) { return 0; }
|
||||
SQLITE_API int sqlite3_close(sqlite3 *db) { return 0; }
|
||||
SQLITE_API int sqlite3_close_v2(sqlite3 *db) { return 0; }
|
||||
SQLITE_API int sqlite3_exec(
|
||||
sqlite3 *db,
|
||||
const char *sql,
|
||||
int (*callback)(void *v,int i,char**,char**),
|
||||
void *v,
|
||||
char **errmsg
|
||||
) { return 0; }
|
||||
SQLITE_API int sqlite3_initialize(void) { return 0; }
|
||||
SQLITE_API int sqlite3_shutdown(void) { return 0; }
|
||||
SQLITE_API int sqlite3_os_init(void) { return 0; }
|
||||
SQLITE_API int sqlite3_os_end(void) { return 0; }
|
||||
SQLITE_API int sqlite3_config(int i, ...) { return 0; }
|
||||
SQLITE_API int sqlite3_db_config(sqlite3 *db, int op, ...) { return 0; }
|
||||
SQLITE_API int sqlite3_extended_result_codes(sqlite3 *db, int onoff) { return 0; }
|
||||
SQLITE_API sqlite3_int64 sqlite3_last_insert_rowid(sqlite3 *db) { return 0; }
|
||||
SQLITE_API int sqlite3_changes(sqlite3 *db) { return 0; }
|
||||
SQLITE_API int sqlite3_total_changes(sqlite3 *db) { return 0; }
|
||||
SQLITE_API int sqlite3_complete(const char *sql) { return 0; }
|
||||
SQLITE_API int sqlite3_complete16(const void *sql) { return 0; }
|
||||
SQLITE_API int sqlite3_busy_handler(sqlite3 *db,int(*cb)(void *v,int i),void *v) { return 0; }
|
||||
SQLITE_API int sqlite3_busy_timeout(sqlite3 *db, int ms) { return 0; }
|
||||
SQLITE_API int sqlite3_get_table(
|
||||
sqlite3 *db,
|
||||
const char *zSql,
|
||||
char ***pazResult,
|
||||
int *pnRow,
|
||||
int *pnColumn,
|
||||
char **pzErrmsg
|
||||
) { return 0; }
|
||||
SQLITE_API char *sqlite3_mprintf(const char *s,...) { return 0; }
|
||||
SQLITE_API char *sqlite3_vmprintf(const char *s, va_list va) { return 0; }
|
||||
SQLITE_API char *sqlite3_snprintf(int i,char *s,const char *ss, ...) { return 0; }
|
||||
SQLITE_API char *sqlite3_vsnprintf(int i,char *s,const char *ss, va_list va) { return 0; }
|
||||
SQLITE_API void *sqlite3_malloc(int i) { return 0; }
|
||||
SQLITE_API void *sqlite3_malloc64(sqlite3_uint64 u64) { return 0; }
|
||||
SQLITE_API void *sqlite3_realloc(void *v, int i) { return 0; }
|
||||
SQLITE_API void *sqlite3_realloc64(void *v, sqlite3_uint64 u64) { return 0; }
|
||||
SQLITE_API sqlite3_uint64 sqlite3_msize(void *v) { return 0; }
|
||||
SQLITE_API sqlite3_int64 sqlite3_memory_used(void) { return 0; }
|
||||
SQLITE_API sqlite3_int64 sqlite3_memory_highwater(int resetFlag) { return 0; }
|
||||
SQLITE_API int sqlite3_set_authorizer(
|
||||
sqlite3 *db,
|
||||
int (*xAuth)(void *v,int i,const char *s,const char *ss,const char *sss,const char*),
|
||||
void *pUserData
|
||||
) { return 0; }
|
||||
SQLITE_API SQLITE_DEPRECATED void *sqlite3_trace(sqlite3 *db,
|
||||
void(*xTrace)(void *v,const char*), void *v) { return 0; }
|
||||
SQLITE_API SQLITE_DEPRECATED void *sqlite3_profile(sqlite3 *db,
|
||||
void(*xProfile)(void *v,const char *s,sqlite3_uint64 u64), void *v) { return 0; }
|
||||
SQLITE_API int sqlite3_trace_v2(
|
||||
sqlite3 *db,
|
||||
unsigned uMask,
|
||||
int(*xCallback)(unsigned,void*,void*,void*),
|
||||
void *pCtx
|
||||
) { return 0; }
|
||||
SQLITE_API int sqlite3_open(
|
||||
const char *filename,
|
||||
sqlite3 **ppDb
|
||||
) { return 0; }
|
||||
SQLITE_API int sqlite3_open16(
|
||||
const void *filename,
|
||||
sqlite3 **ppDb
|
||||
) { return 0; }
|
||||
SQLITE_API int sqlite3_open_v2(
|
||||
const char *filename,
|
||||
sqlite3 **ppDb,
|
||||
int flags,
|
||||
const char *zVfs
|
||||
) { return 0; }
|
||||
SQLITE_API const char *sqlite3_uri_parameter(const char *zFilename, const char *zParam) { return 0; }
|
||||
SQLITE_API int sqlite3_uri_boolean(const char *zFile, const char *zParam, int bDefault) { return 0; }
|
||||
SQLITE_API sqlite3_int64 sqlite3_uri_int64(const char *s, const char *ss, sqlite3_int64 i64) { return 0; }
|
||||
SQLITE_API int sqlite3_errcode(sqlite3 *db) { return 0; }
|
||||
SQLITE_API int sqlite3_extended_errcode(sqlite3 *db) { return 0; }
|
||||
SQLITE_API const char *sqlite3_errmsg(sqlite3 *db) { return 0; }
|
||||
SQLITE_API const void *sqlite3_errmsg16(sqlite3 *db) { return 0; }
|
||||
SQLITE_API const char *sqlite3_errstr(int i) { return 0; }
|
||||
SQLITE_API int sqlite3_limit(sqlite3 *db, int id, int newVal) { return 0; }
|
||||
SQLITE_API int sqlite3_prepare(
|
||||
sqlite3 *db,
|
||||
const char *zSql,
|
||||
int nByte,
|
||||
sqlite3_stmt **ppStmt,
|
||||
const char **pzTail
|
||||
) { return 0; }
|
||||
SQLITE_API int sqlite3_prepare_v2(
|
||||
sqlite3 *db,
|
||||
const char *zSql,
|
||||
int nByte,
|
||||
sqlite3_stmt **ppStmt,
|
||||
const char **pzTail
|
||||
) { return 0; }
|
||||
SQLITE_API int sqlite3_prepare_v3(
|
||||
sqlite3 *db,
|
||||
const char *zSql,
|
||||
int nByte,
|
||||
unsigned int prepFlags,
|
||||
sqlite3_stmt **ppStmt,
|
||||
const char **pzTail
|
||||
) { return 0; }
|
||||
SQLITE_API int sqlite3_prepare16(
|
||||
sqlite3 *db,
|
||||
const void *zSql,
|
||||
int nByte,
|
||||
sqlite3_stmt **ppStmt,
|
||||
const void **pzTail
|
||||
) { return 0; }
|
||||
SQLITE_API int sqlite3_prepare16_v2(
|
||||
sqlite3 *db,
|
||||
const void *zSql,
|
||||
int nByte,
|
||||
sqlite3_stmt **ppStmt,
|
||||
const void **pzTail
|
||||
) { return 0; }
|
||||
SQLITE_API int sqlite3_prepare16_v3(
|
||||
sqlite3 *db,
|
||||
const void *zSql,
|
||||
int nByte,
|
||||
unsigned int prepFlags,
|
||||
sqlite3_stmt **ppStmt,
|
||||
const void **pzTail
|
||||
) { return 0; }
|
||||
SQLITE_API const char *sqlite3_sql(sqlite3_stmt *pStmt) { return 0; }
|
||||
SQLITE_API char *sqlite3_expanded_sql(sqlite3_stmt *pStmt) { return 0; }
|
||||
SQLITE_API int sqlite3_stmt_readonly(sqlite3_stmt *pStmt) { return 0; }
|
||||
SQLITE_API int sqlite3_stmt_busy(sqlite3_stmt *stmt) { return 0; }
|
||||
SQLITE_API int sqlite3_bind_blob(sqlite3_stmt *stmt, int i, const void *v, int n, void(*cb)(void*)) { return 0; }
|
||||
SQLITE_API int sqlite3_bind_blob64(sqlite3_stmt *stmt, int i, const void *v, sqlite3_uint64 u64,
|
||||
void(*cb)(void*)) { return 0; }
|
||||
SQLITE_API int sqlite3_bind_double(sqlite3_stmt *stmt, int i, double df) { return 0; }
|
||||
SQLITE_API int sqlite3_bind_int(sqlite3_stmt *stmt, int i, int ii) { return 0; }
|
||||
SQLITE_API int sqlite3_bind_int64(sqlite3_stmt *stmt, int i, sqlite3_int64 i64) { return 0; }
|
||||
SQLITE_API int sqlite3_bind_null(sqlite3_stmt *stmt, int i) { return 0; }
|
||||
SQLITE_API int sqlite3_bind_text(sqlite3_stmt *stmt,int i,const char *s,int ii,void(*cb)(void*)) { return 0; }
|
||||
SQLITE_API int sqlite3_bind_text16(sqlite3_stmt *stmt, int i, const void *v, int ii, void(*cb)(void*)) { return 0; }
|
||||
SQLITE_API int sqlite3_bind_text64(sqlite3_stmt *stmt, int i, const char *s, sqlite3_uint64 u64,
|
||||
void(*cb)(void*), unsigned char encoding) { return 0; }
|
||||
SQLITE_API int sqlite3_bind_value(sqlite3_stmt *stmt, int i, const sqlite3_value *s_val) { return 0; }
|
||||
SQLITE_API int sqlite3_bind_pointer(sqlite3_stmt *stmt, int i, void *v, const char *s,void(*cb)(void*)) { return 0; }
|
||||
SQLITE_API int sqlite3_bind_zeroblob(sqlite3_stmt *stmt, int i, int n) { return 0; }
|
||||
SQLITE_API int sqlite3_bind_zeroblob64(sqlite3_stmt *stmt, int i, sqlite3_uint64 u64) { return 0; }
|
||||
SQLITE_API int sqlite3_bind_parameter_count(sqlite3_stmt *stmt) { return 0; }
|
||||
SQLITE_API const char *sqlite3_bind_parameter_name(sqlite3_stmt *stmt, int i) { return 0; }
|
||||
SQLITE_API int sqlite3_bind_parameter_index(sqlite3_stmt *stmt, const char *zName) { return 0; }
|
||||
SQLITE_API int sqlite3_clear_bindings(sqlite3_stmt *stmt) { return 0; }
|
||||
SQLITE_API int sqlite3_column_count(sqlite3_stmt *pStmt) { return 0; }
|
||||
SQLITE_API const char *sqlite3_column_name(sqlite3_stmt *stmt, int N) { return 0; }
|
||||
SQLITE_API const void *sqlite3_column_name16(sqlite3_stmt *stmt, int N) { return 0; }
|
||||
SQLITE_API const char *sqlite3_column_database_name(sqlite3_stmt *stmt,int i) { return 0; }
|
||||
SQLITE_API const void *sqlite3_column_database_name16(sqlite3_stmt *stmt,int i) { return 0; }
|
||||
SQLITE_API const char *sqlite3_column_table_name(sqlite3_stmt *stmt,int i) { return 0; }
|
||||
SQLITE_API const void *sqlite3_column_table_name16(sqlite3_stmt *stmt,int i) { return 0; }
|
||||
SQLITE_API const char *sqlite3_column_origin_name(sqlite3_stmt *stmt,int i) { return 0; }
|
||||
SQLITE_API const void *sqlite3_column_origin_name16(sqlite3_stmt *stmt,int i) { return 0; }
|
||||
SQLITE_API const char *sqlite3_column_decltype(sqlite3_stmt *stmt,int i) { return 0; }
|
||||
SQLITE_API const void *sqlite3_column_decltype16(sqlite3_stmt *stmt,int i) { return 0; }
|
||||
SQLITE_API int sqlite3_step(sqlite3_stmt *stmt) { return 0; }
|
||||
SQLITE_API int sqlite3_data_count(sqlite3_stmt *pStmt) { return 0; }
|
||||
SQLITE_API const void *sqlite3_column_blob(sqlite3_stmt *stmt, int iCol) { return 0; }
|
||||
SQLITE_API double sqlite3_column_double(sqlite3_stmt *stmt, int iCol) { return 0; }
|
||||
SQLITE_API int sqlite3_column_int(sqlite3_stmt *stmt, int iCol) { return 0; }
|
||||
SQLITE_API sqlite3_int64 sqlite3_column_int64(sqlite3_stmt *stmt, int iCol) { return 0; }
|
||||
SQLITE_API const unsigned char *sqlite3_column_text(sqlite3_stmt *stmt, int iCol) { return 0; }
|
||||
SQLITE_API const void *sqlite3_column_text16(sqlite3_stmt *stmt, int iCol) { return 0; }
|
||||
SQLITE_API sqlite3_value *sqlite3_column_value(sqlite3_stmt *stmt, int iCol) { return 0; }
|
||||
SQLITE_API int sqlite3_column_bytes(sqlite3_stmt *stmt, int iCol) { return 0; }
|
||||
SQLITE_API int sqlite3_column_bytes16(sqlite3_stmt *stmt, int iCol) { return 0; }
|
||||
SQLITE_API int sqlite3_column_type(sqlite3_stmt *stmt, int iCol) { return 0; }
|
||||
SQLITE_API int sqlite3_finalize(sqlite3_stmt *pStmt) { return 0; }
|
||||
SQLITE_API int sqlite3_reset(sqlite3_stmt *pStmt) { return 0; }
|
||||
SQLITE_API int sqlite3_create_function(
|
||||
sqlite3 *db,
|
||||
const char *zFunctionName,
|
||||
int nArg,
|
||||
int eTextRep,
|
||||
void *pApp,
|
||||
void (*xFunc)(sqlite3_context *sctx,int i,sqlite3_value**),
|
||||
void (*xStep)(sqlite3_context *sctx,int i,sqlite3_value**),
|
||||
void (*xFinal)(sqlite3_context *sctx)
|
||||
) { return 0; }
|
||||
SQLITE_API int sqlite3_create_function16(
|
||||
sqlite3 *db,
|
||||
const void *zFunctionName,
|
||||
int nArg,
|
||||
int eTextRep,
|
||||
void *pApp,
|
||||
void (*xFunc)(sqlite3_context *sctx,int i,sqlite3_value**),
|
||||
void (*xStep)(sqlite3_context *sctx,int i,sqlite3_value**),
|
||||
void (*xFinal)(sqlite3_context *sctx)
|
||||
) { return 0; }
|
||||
SQLITE_API int sqlite3_create_function_v2(
|
||||
sqlite3 *db,
|
||||
const char *zFunctionName,
|
||||
int nArg,
|
||||
int eTextRep,
|
||||
void *pApp,
|
||||
void (*xFunc)(sqlite3_context *sctx,int i,sqlite3_value**),
|
||||
void (*xStep)(sqlite3_context *sctx,int i,sqlite3_value**),
|
||||
void (*xFinal)(sqlite3_context *sctx),
|
||||
void(*xDestroy)(void*)
|
||||
) { return 0; }
|
||||
SQLITE_API int sqlite3_create_window_function(
|
||||
sqlite3 *db,
|
||||
const char *zFunctionName,
|
||||
int nArg,
|
||||
int eTextRep,
|
||||
void *pApp,
|
||||
void (*xStep)(sqlite3_context *sctx,int i,sqlite3_value**),
|
||||
void (*xFinal)(sqlite3_context *sctx),
|
||||
void (*xValue)(sqlite3_context *sctx),
|
||||
void (*xInverse)(sqlite3_context *sctx,int i,sqlite3_value**),
|
||||
void(*xDestroy)(void*)
|
||||
) { return 0; }
|
||||
SQLITE_API SQLITE_DEPRECATED int sqlite3_aggregate_count(sqlite3_context *sctx) { return 0; }
|
||||
SQLITE_API SQLITE_DEPRECATED int sqlite3_expired(sqlite3_stmt *stmt) { return 0; }
|
||||
SQLITE_API SQLITE_DEPRECATED int sqlite3_transfer_bindings(sqlite3_stmt *stmt, sqlite3_stmt *stmt1) { return 0; }
|
||||
SQLITE_API SQLITE_DEPRECATED int sqlite3_global_recover(void) { return 0; }
|
||||
SQLITE_API SQLITE_DEPRECATED void sqlite3_thread_cleanup(void) { }
|
||||
SQLITE_API SQLITE_DEPRECATED int sqlite3_memory_alarm(void(*cb)(void *v,sqlite3_int64,int i),
|
||||
void *v,sqlite3_int64 i64) { return 0; }
|
||||
SQLITE_API const void *sqlite3_value_blob(sqlite3_value *s_val) { return 0; }
|
||||
SQLITE_API double sqlite3_value_double(sqlite3_value *s_val) { return 0; }
|
||||
SQLITE_API int sqlite3_value_int(sqlite3_value *s_val) { return 0; }
|
||||
SQLITE_API sqlite3_int64 sqlite3_value_int64(sqlite3_value *s_val) { return 0; }
|
||||
SQLITE_API void *sqlite3_value_pointer(sqlite3_value *s_val, const char *s) { return 0; }
|
||||
SQLITE_API const unsigned char *sqlite3_value_text(sqlite3_value *s_val) { return 0; }
|
||||
SQLITE_API const void *sqlite3_value_text16(sqlite3_value *s_val) { return 0; }
|
||||
SQLITE_API const void *sqlite3_value_text16le(sqlite3_value *s_val) { return 0; }
|
||||
SQLITE_API const void *sqlite3_value_text16be(sqlite3_value *s_val) { return 0; }
|
||||
SQLITE_API int sqlite3_value_bytes(sqlite3_value *s_val) { return 0; }
|
||||
SQLITE_API int sqlite3_value_bytes16(sqlite3_value *s_val) { return 0; }
|
||||
SQLITE_API int sqlite3_value_type(sqlite3_value *s_val) { return 0; }
|
||||
SQLITE_API int sqlite3_value_numeric_type(sqlite3_value *s_val) { return 0; }
|
||||
SQLITE_API int sqlite3_value_nochange(sqlite3_value *s_val) { return 0; }
|
||||
SQLITE_API unsigned int sqlite3_value_subtype(sqlite3_value *s_val) { return 0; }
|
||||
SQLITE_API sqlite3_value *sqlite3_value_dup(const sqlite3_value *s_val) { return 0; }
|
||||
SQLITE_API void *sqlite3_aggregate_context(sqlite3_context *sctx, int nBytes) { return 0; }
|
||||
SQLITE_API void *sqlite3_user_data(sqlite3_context *sctx) { return 0; }
|
||||
SQLITE_API sqlite3 *sqlite3_context_db_handle(sqlite3_context *sctx) { return 0; }
|
||||
SQLITE_API void *sqlite3_get_auxdata(sqlite3_context *sctx, int N) { return 0; }
|
||||
SQLITE_API void sqlite3_result_blob64(sqlite3_context *sctx,const void *v,
|
||||
sqlite3_uint64 u64,void(*cb)(void*)) { }
|
||||
SQLITE_API void sqlite3_result_text64(sqlite3_context *sctx, const char *s,sqlite3_uint64 u64,
|
||||
void(*cb)(void*), unsigned char encoding) { }
|
||||
SQLITE_API int sqlite3_result_zeroblob64(sqlite3_context *sctx, sqlite3_uint64 n) { return 0; }
|
||||
SQLITE_API int sqlite3_create_collation(
|
||||
sqlite3 *db,
|
||||
const char *zName,
|
||||
int eTextRep,
|
||||
void *pArg,
|
||||
int(*xCompare)(void*,int,const void*,int,const void*)
|
||||
) { return 0; }
|
||||
SQLITE_API int sqlite3_create_collation_v2(
|
||||
sqlite3 *db,
|
||||
const char *zName,
|
||||
int eTextRep,
|
||||
void *pArg,
|
||||
int(*xCompare)(void *v,int i,const void*,int,const void*),
|
||||
void(*xDestroy)(void*)
|
||||
) { return 0; }
|
||||
SQLITE_API int sqlite3_create_collation16(
|
||||
sqlite3 *db,
|
||||
const void *zName,
|
||||
int eTextRep,
|
||||
void *pArg,
|
||||
int(*xCompare)(void*,int,const void*,int,const void*)
|
||||
) { return 0; }
|
||||
SQLITE_API int sqlite3_collation_needed(
|
||||
sqlite3 *db,
|
||||
void *v,
|
||||
void(*cb)(void *v,sqlite3 *db,int eTextRep,const char*)
|
||||
) { return 0; }
|
||||
SQLITE_API int sqlite3_collation_needed16(
|
||||
sqlite3 *db,
|
||||
void *v,
|
||||
void(*cb)(void *v,sqlite3 *db,int eTextRep,const void*)
|
||||
) { return 0; }
|
||||
SQLITE_API int sqlite3_key(
|
||||
sqlite3 *db,
|
||||
const void *pKey, int nKey
|
||||
) { return 0; }
|
||||
SQLITE_API int sqlite3_key_v2(
|
||||
sqlite3 *db,
|
||||
const char *zDbName,
|
||||
const void *pKey, int nKey
|
||||
) { return 0; }
|
||||
SQLITE_API int sqlite3_rekey(
|
||||
sqlite3 *db,
|
||||
const void *pKey, int nKey
|
||||
) { return 0; }
|
||||
SQLITE_API int sqlite3_rekey_v2(
|
||||
sqlite3 *db,
|
||||
const char *zDbName,
|
||||
const void *pKey, int nKey
|
||||
) { return 0; }
|
||||
SQLITE_API void sqlite3_activate_see(
|
||||
const char *zPassPhrase
|
||||
) { }
|
||||
SQLITE_API void sqlite3_activate_cerod(
|
||||
const char *zPassPhrase
|
||||
) { }
|
||||
SQLITE_API int sqlite3_sleep(int i) { return 0; }
|
||||
SQLITE_API SQLITE_EXTERN char *sqlite3_temp_directory;
|
||||
SQLITE_API SQLITE_EXTERN char *sqlite3_data_directory;
|
||||
SQLITE_API int sqlite3_win32_set_directory(
|
||||
unsigned long type,
|
||||
void *zValue
|
||||
) { return 0; }
|
||||
SQLITE_API int sqlite3_win32_set_directory8(unsigned long type, const char *zValue) { return 0; }
|
||||
SQLITE_API int sqlite3_win32_set_directory16(unsigned long type, const void *zValue) { return 0; }
|
||||
SQLITE_API int sqlite3_get_autocommit(sqlite3 *db) { return 0; }
|
||||
SQLITE_API sqlite3 *sqlite3_db_handle(sqlite3_stmt *stmt) { return 0; }
|
||||
SQLITE_API const char *sqlite3_db_filename(sqlite3 *db, const char *zDbName) { return 0; }
|
||||
SQLITE_API int sqlite3_db_readonly(sqlite3 *db, const char *zDbName) { return 0; }
|
||||
SQLITE_API sqlite3_stmt *sqlite3_next_stmt(sqlite3 *pDb, sqlite3_stmt *pStmt) { return 0; }
|
||||
SQLITE_API void *sqlite3_commit_hook(sqlite3 *db, int(*cb)(void*), void *v) { return 0; }
|
||||
SQLITE_API void *sqlite3_rollback_hook(sqlite3 *db, void(*cb)(void *), void *v) { return 0; }
|
||||
SQLITE_API void *sqlite3_update_hook(
|
||||
sqlite3 *db,
|
||||
void(*cb)(void *,int ,char const *,char const *,sqlite3_int64 i64),
|
||||
void *v
|
||||
) { return 0; }
|
||||
SQLITE_API int sqlite3_enable_shared_cache(int i) { return 0; }
|
||||
SQLITE_API int sqlite3_release_memory(int i) { return 0; }
|
||||
SQLITE_API int sqlite3_db_release_memory(sqlite3 *db) { return 0; }
|
||||
SQLITE_API sqlite3_int64 sqlite3_soft_heap_limit64(sqlite3_int64 N) { return 0; }
|
||||
SQLITE_API SQLITE_DEPRECATED void sqlite3_soft_heap_limit(int N) { }
|
||||
SQLITE_API int sqlite3_table_column_metadata(
|
||||
sqlite3 *db,
|
||||
const char *zDbName,
|
||||
const char *zTableName,
|
||||
const char *zColumnName,
|
||||
char const **pzDataType,
|
||||
char const **pzCollSeq,
|
||||
int *pNotNull,
|
||||
int *pPrimaryKey,
|
||||
int *pAutoinc
|
||||
) { return 0; }
|
||||
SQLITE_API int sqlite3_load_extension(
|
||||
sqlite3 *db,
|
||||
const char *zFile,
|
||||
const char *zProc,
|
||||
char **pzErrMsg
|
||||
) { return 0; }
|
||||
SQLITE_API int sqlite3_enable_load_extension(sqlite3 *db, int onoff) { return 0; }
|
||||
SQLITE_API int sqlite3_auto_extension(void(*xEntryPoint)(void)) { return 0; }
|
||||
SQLITE_API int sqlite3_cancel_auto_extension(void(*xEntryPoint)(void)) { return 0; }
|
||||
SQLITE_API int sqlite3_create_module(
|
||||
sqlite3 *db,
|
||||
const char *zName,
|
||||
const sqlite3_module *p,
|
||||
void *pClientData
|
||||
) { return 0; }
|
||||
SQLITE_API int sqlite3_create_module_v2(
|
||||
sqlite3 *db,
|
||||
const char *zName,
|
||||
const sqlite3_module *p,
|
||||
void *pClientData,
|
||||
void(*xDestroy)(void*)
|
||||
) { return 0; }
|
||||
SQLITE_API int sqlite3_declare_vtab(sqlite3 *db, const char *zSQL) { return 0; }
|
||||
SQLITE_API int sqlite3_overload_function(sqlite3 *db, const char *zFuncName, int nArg) { return 0; }
|
||||
SQLITE_API int sqlite3_blob_open(
|
||||
sqlite3 *db,
|
||||
const char *zDb,
|
||||
const char *zTable,
|
||||
const char *zColumn,
|
||||
sqlite3_int64 iRow,
|
||||
int flags,
|
||||
sqlite3_blob **ppBlob
|
||||
) { return 0; }
|
||||
SQLITE_API int sqlite3_blob_reopen(sqlite3_blob *ppBlob, sqlite3_int64 i64) { return 0; }
|
||||
SQLITE_API int sqlite3_blob_close(sqlite3_blob *ppBlob) { return 0; }
|
||||
SQLITE_API int sqlite3_blob_bytes(sqlite3_blob *ppBlob) { return 0; }
|
||||
SQLITE_API int sqlite3_blob_read(sqlite3_blob *ppBlob, void *Z, int N, int iOffset) { return 0; }
|
||||
SQLITE_API int sqlite3_blob_write(sqlite3_blob *ppBlob, const void *z, int n, int iOffset) { return 0; }
|
||||
SQLITE_API sqlite3_vfs *sqlite3_vfs_find(const char *zVfsName) { return 0; }
|
||||
SQLITE_API int sqlite3_vfs_register(sqlite3_vfs *s_vfs, int makeDflt) { return 0; }
|
||||
SQLITE_API int sqlite3_vfs_unregister(sqlite3_vfs *s_vfs) { return 0; }
|
||||
SQLITE_API sqlite3_mutex *sqlite3_mutex_alloc(int i) { return 0; }
|
||||
SQLITE_API int sqlite3_mutex_try(sqlite3_mutex *smtx) { return 0; }
|
||||
SQLITE_API int sqlite3_mutex_held(sqlite3_mutex *smtx) { return 0; }
|
||||
SQLITE_API int sqlite3_mutex_notheld(sqlite3_mutex *smtx) { return 0; }
|
||||
SQLITE_API sqlite3_mutex *sqlite3_db_mutex(sqlite3 *db) { return 0; }
|
||||
SQLITE_API int sqlite3_file_control(sqlite3 *db, const char *zDbName, int op, void *v) { return 0; }
|
||||
SQLITE_API int sqlite3_test_control(int op, ...) { return 0; }
|
||||
SQLITE_API int sqlite3_keyword_count(void) { return 0; }
|
||||
SQLITE_API int sqlite3_keyword_name(int i,const char **s,int *ii) { return 0; }
|
||||
SQLITE_API int sqlite3_keyword_check(const char *s,int i) { return 0; }
|
||||
SQLITE_API sqlite3_str *sqlite3_str_new(sqlite3 *db) { return 0; }
|
||||
SQLITE_API char *sqlite3_str_finish(sqlite3_str *s_str) { return 0; }
|
||||
SQLITE_API int sqlite3_str_errcode(sqlite3_str *s_str) { return 0; }
|
||||
SQLITE_API int sqlite3_str_length(sqlite3_str *s_str) { return 0; }
|
||||
SQLITE_API char *sqlite3_str_value(sqlite3_str *s_str) { return 0; }
|
||||
SQLITE_API int sqlite3_status(int op, int *pCurrent, int *pHighwater, int resetFlag) { return 0; }
|
||||
SQLITE_API int sqlite3_status64(
|
||||
int op,
|
||||
sqlite3_int64 *pCurrent,
|
||||
sqlite3_int64 *pHighwater,
|
||||
int resetFlag
|
||||
) { return 0; }
|
||||
SQLITE_API int sqlite3_db_status(sqlite3 *db, int op, int *pCur, int *pHiwtr, int resetFlg) { return 0; }
|
||||
SQLITE_API int sqlite3_stmt_status(sqlite3_stmt *stmt, int op,int resetFlg) { return 0; }
|
||||
SQLITE_API sqlite3_backup *sqlite3_backup_init(
|
||||
sqlite3 *pDest,
|
||||
const char *zDestName,
|
||||
sqlite3 *pSource,
|
||||
const char *zSourceName
|
||||
) { return 0; }
|
||||
SQLITE_API int sqlite3_backup_step(sqlite3_backup *p, int nPage) { return 0; }
|
||||
SQLITE_API int sqlite3_backup_finish(sqlite3_backup *p) { return 0; }
|
||||
SQLITE_API int sqlite3_backup_remaining(sqlite3_backup *p) { return 0; }
|
||||
SQLITE_API int sqlite3_backup_pagecount(sqlite3_backup *p) { return 0; }
|
||||
SQLITE_API int sqlite3_unlock_notify(
|
||||
sqlite3 *pBlocked,
|
||||
void (*xNotify)(void **apArg, int nArg),
|
||||
void *pNotifyArg
|
||||
) { return 0; }
|
||||
SQLITE_API int sqlite3_stricmp(const char *s, const char *ss) { return 0; }
|
||||
SQLITE_API int sqlite3_strnicmp(const char *s, const char *ss, int i) { return 0; }
|
||||
SQLITE_API int sqlite3_strglob(const char *zGlob, const char *zStr) { return 0; }
|
||||
SQLITE_API int sqlite3_strlike(const char *zGlob, const char *zStr, unsigned int cEsc) { return 0; }
|
||||
SQLITE_API void *sqlite3_wal_hook(
|
||||
sqlite3 *db,
|
||||
int(*cb)(void *,sqlite3 *db,const char *s,int i),
|
||||
void *v
|
||||
) { return 0; }
|
||||
SQLITE_API int sqlite3_wal_autocheckpoint(sqlite3 *db, int N) { return 0; }
|
||||
SQLITE_API int sqlite3_wal_checkpoint(sqlite3 *db, const char *zDb) { return 0; }
|
||||
SQLITE_API int sqlite3_wal_checkpoint_v2(
|
||||
sqlite3 *db,
|
||||
const char *zDb,
|
||||
int eMode,
|
||||
int *pnLog,
|
||||
int *pnCkpt
|
||||
) { return 0; }
|
||||
SQLITE_API int sqlite3_vtab_config(sqlite3 *db, int op, ...) { return 0; }
|
||||
SQLITE_API int sqlite3_vtab_on_conflict(sqlite3 *db) { return 0; }
|
||||
SQLITE_API int sqlite3_vtab_nochange(sqlite3_context *sctx) { return 0; }
|
||||
SQLITE_API SQLITE_EXPERIMENTAL const char *sqlite3_vtab_collation(sqlite3_index_info *info,int i) { return 0; }
|
||||
SQLITE_API int sqlite3_stmt_scanstatus(
|
||||
sqlite3_stmt *pStmt,
|
||||
int idx,
|
||||
int iScanStatusOp,
|
||||
void *pOut
|
||||
) { return 0; }
|
||||
SQLITE_API int sqlite3_db_cacheflush(sqlite3 *db) { return 0; }
|
||||
SQLITE_API void *sqlite3_preupdate_hook(
|
||||
sqlite3 *db,
|
||||
void(*xPreUpdate)(
|
||||
void *pCtx,
|
||||
sqlite3 *db,
|
||||
int op,
|
||||
char const *zDb,
|
||||
char const *zName,
|
||||
sqlite3_int64 iKey1,
|
||||
sqlite3_int64 iKey2
|
||||
),
|
||||
void *v
|
||||
) { return 0; }
|
||||
SQLITE_API int sqlite3_preupdate_old(sqlite3 *db, int i, sqlite3_value **s_val) { return 0; }
|
||||
SQLITE_API int sqlite3_preupdate_count(sqlite3 *db) { return 0; }
|
||||
SQLITE_API int sqlite3_preupdate_depth(sqlite3 *db) { return 0; }
|
||||
SQLITE_API int sqlite3_preupdate_new(sqlite3 *db, int i, sqlite3_value **s_val) { return 0; }
|
||||
SQLITE_API int sqlite3_system_errno(sqlite3 *db) { return 0; }
|
||||
SQLITE_API SQLITE_EXPERIMENTAL int sqlite3_snapshot_get(
|
||||
sqlite3 *db,
|
||||
const char *zSchema,
|
||||
sqlite3_snapshot **ppSnapshot
|
||||
) { return 0; }
|
||||
SQLITE_API SQLITE_EXPERIMENTAL int sqlite3_snapshot_open(
|
||||
sqlite3 *db,
|
||||
const char *zSchema,
|
||||
sqlite3_snapshot *pSnapshot
|
||||
) { return 0; }
|
||||
SQLITE_API SQLITE_EXPERIMENTAL void sqlite3_snapshot_free(sqlite3_snapshot *s_sn) { }
|
||||
SQLITE_API SQLITE_EXPERIMENTAL int sqlite3_snapshot_cmp(
|
||||
sqlite3_snapshot *p1,
|
||||
sqlite3_snapshot *p2
|
||||
) { return 0; }
|
||||
SQLITE_API SQLITE_EXPERIMENTAL int sqlite3_snapshot_recover(sqlite3 *db, const char *zDb) { return 0; }
|
||||
SQLITE_API unsigned char *sqlite3_serialize(
|
||||
sqlite3 *db,
|
||||
const char *zSchema,
|
||||
sqlite3_int64 *piSize,
|
||||
unsigned int mFlags
|
||||
) { return 0; }
|
||||
SQLITE_API int sqlite3_deserialize(
|
||||
sqlite3 *db,
|
||||
const char *zSchema,
|
||||
unsigned char *pData,
|
||||
sqlite3_int64 szDb,
|
||||
sqlite3_int64 szBuf,
|
||||
unsigned mFlags
|
||||
) { return 0; }
|
||||
SQLITE_API int sqlite3_rtree_geometry_callback(
|
||||
sqlite3 *db,
|
||||
const char *zGeom,
|
||||
int (*xGeom)(sqlite3_rtree_geometry*, int i, sqlite3_rtree_dbl*,int*),
|
||||
void *pContext
|
||||
) { return 0; }
|
||||
SQLITE_API int sqlite3_rtree_query_callback(
|
||||
sqlite3 *db,
|
||||
const char *zQueryFunc,
|
||||
int (*xQueryFunc)(sqlite3_rtree_query_info*),
|
||||
void *pContext,
|
||||
void (*xDestructor)(void*)
|
||||
) { return 0; }
|
||||
//SQLITE_API int sqlite3session_create(
|
||||
// sqlite3 *db,
|
||||
// const char *zDb,
|
||||
// sqlite3_session **ppSession
|
||||
//) { return 0; }
|
||||
//SQLITE_API int sqlite3session_enable(sqlite3_session *pSession, int bEnable) { return 0; }
|
||||
//SQLITE_API int sqlite3session_indirect(sqlite3_session *pSession, int bIndirect) { return 0; }
|
||||
//SQLITE_API int sqlite3session_attach(
|
||||
// sqlite3_session *pSession,
|
||||
// const char *zTab
|
||||
//) { return 0; }
|
||||
//SQLITE_API void sqlite3session_table_filter(
|
||||
// sqlite3_session *pSession,
|
||||
// int(*xFilter)(
|
||||
// void *pCtx,
|
||||
// const char *zTab
|
||||
// ),
|
||||
// void *pCtx
|
||||
//) { return 0; }
|
||||
//SQLITE_API int sqlite3session_changeset(
|
||||
// sqlite3_session *pSession,
|
||||
// int *pnChangeset,
|
||||
// void **ppChangeset
|
||||
//) { return 0; }
|
||||
//SQLITE_API int sqlite3session_diff(
|
||||
// sqlite3_session *pSession,
|
||||
// const char *zFromDb,
|
||||
// const char *zTbl,
|
||||
// char **pzErrMsg
|
||||
//) { return 0; }
|
||||
//SQLITE_API int sqlite3session_patchset(
|
||||
// sqlite3_session *pSession,
|
||||
// int *pnPatchset,
|
||||
// void **ppPatchset
|
||||
//) { return 0; }
|
||||
//SQLITE_API int sqlite3session_isempty(sqlite3_session *pSession) { return 0; }
|
||||
//SQLITE_API int sqlite3changeset_start(
|
||||
// sqlite3_changeset_iter **pp,
|
||||
// int nChangeset,
|
||||
// void *pChangeset
|
||||
//) { return 0; }
|
||||
//SQLITE_API int sqlite3changeset_next(sqlite3_changeset_iter *pIter) { return 0; }
|
||||
//SQLITE_API int sqlite3changeset_op(
|
||||
// sqlite3_changeset_iter *pIter,
|
||||
// const char **pzTab,
|
||||
// int *pnCol,
|
||||
// int *pOp,
|
||||
// int *pbIndirect
|
||||
//) { return 0; }
|
||||
//SQLITE_API int sqlite3changeset_pk(
|
||||
// sqlite3_changeset_iter *pIter,
|
||||
// unsigned char **pabPK,
|
||||
// int *pnCol
|
||||
//) { return 0; }
|
||||
//SQLITE_API int sqlite3changeset_old(
|
||||
// sqlite3_changeset_iter *pIter,
|
||||
// int iVal,
|
||||
// sqlite3_value **ppValue
|
||||
//) { return 0; }
|
||||
//SQLITE_API int sqlite3changeset_new(
|
||||
// sqlite3_changeset_iter *pIter,
|
||||
// int iVal,
|
||||
// sqlite3_value **ppValue
|
||||
//) { return 0; }
|
||||
//SQLITE_API int sqlite3changeset_conflict(
|
||||
// sqlite3_changeset_iter *pIter,
|
||||
// int iVal,
|
||||
// sqlite3_value **ppValue
|
||||
//) { return 0; }
|
||||
//SQLITE_API int sqlite3changeset_fk_conflicts(
|
||||
// sqlite3_changeset_iter *pIter,
|
||||
// int *pnOut
|
||||
//) { return 0; }
|
||||
//SQLITE_API int sqlite3changeset_finalize(sqlite3_changeset_iter *pIter) { return 0; }
|
||||
//SQLITE_API int sqlite3changeset_invert(
|
||||
// int nIn, const void *pIn,
|
||||
// int *pnOut, void **ppOut
|
||||
//) { return 0; }
|
||||
//SQLITE_API int sqlite3changeset_concat(
|
||||
// int nA,
|
||||
// void *pA,
|
||||
// int nB,
|
||||
// void *pB,
|
||||
// int *pnOut,
|
||||
// void **ppOut
|
||||
//) { return 0; }
|
||||
//SQLITE_API int sqlite3changegroup_new(sqlite3_changegroup **pp) { return 0; }
|
||||
//SQLITE_API int sqlite3changegroup_add(sqlite3_changegroup* scg, int nData, void *pData) { return 0; }
|
||||
//SQLITE_API int sqlite3changegroup_output(
|
||||
// sqlite3_changegroup* scg,
|
||||
// int *pnData,
|
||||
// void **ppData
|
||||
//) { return 0; }
|
||||
//SQLITE_API int sqlite3changeset_apply(
|
||||
// sqlite3 *db,
|
||||
// int nChangeset,
|
||||
// void *pChangeset,
|
||||
// int(*xFilter)(
|
||||
// void *pCtx,
|
||||
// const char *zTab
|
||||
// ),
|
||||
// int(*xConflict)(
|
||||
// void *pCtx,
|
||||
// int eConflict,
|
||||
// sqlite3_changeset_iter *p
|
||||
// ),
|
||||
// void *pCtx
|
||||
//) { return 0; }
|
||||
//SQLITE_API int sqlite3changeset_apply_v2(
|
||||
// sqlite3 *db,
|
||||
// int nChangeset,
|
||||
// void *pChangeset,
|
||||
// int(*xFilter)(
|
||||
// void *pCtx,
|
||||
// const char *zTab
|
||||
// ),
|
||||
// int(*xConflict)(
|
||||
// void *pCtx,
|
||||
// int eConflict,
|
||||
// sqlite3_changeset_iter *p
|
||||
// ),
|
||||
// void *pCtx,
|
||||
// void **ppRebase, int *pnRebase,
|
||||
// int flags
|
||||
//) { return 0; }
|
||||
//SQLITE_API int sqlite3rebaser_create(sqlite3_rebaser **ppNew) { return 0; }
|
||||
//SQLITE_API int sqlite3rebaser_configure(
|
||||
// sqlite3_rebaser*,
|
||||
// int nRebase, const void *pRebase
|
||||
//) { return 0; }
|
||||
//SQLITE_API int sqlite3rebaser_rebase(
|
||||
// sqlite3_rebaser*,
|
||||
// int nIn, const void *pIn,
|
||||
// int *pnOut, void **ppOut
|
||||
//) { return 0; }
|
||||
//SQLITE_API int sqlite3changeset_apply_strm(
|
||||
// sqlite3 *db,
|
||||
// int (*xInput)(void *pIn, void *pData, int *pnData),
|
||||
// void *pIn,
|
||||
// int(*xFilter)(
|
||||
// void *pCtx,
|
||||
// const char *zTab
|
||||
// ),
|
||||
// int(*xConflict)(
|
||||
// void *pCtx,
|
||||
// int eConflict,
|
||||
// sqlite3_changeset_iter *p
|
||||
// ),
|
||||
// void *pCtx
|
||||
//) { return 0; }
|
||||
//SQLITE_API int sqlite3changeset_apply_v2_strm(
|
||||
// sqlite3 *db,
|
||||
// int (*xInput)(void *pIn, void *pData, int *pnData),
|
||||
// void *pIn,
|
||||
// int(*xFilter)(
|
||||
// void *pCtx,
|
||||
// const char *zTab
|
||||
// ),
|
||||
// int(*xConflict)(
|
||||
// void *pCtx,
|
||||
// int eConflict,
|
||||
// sqlite3_changeset_iter *p
|
||||
// ),
|
||||
// void *pCtx,
|
||||
// void **ppRebase, int *pnRebase,
|
||||
// int flags
|
||||
//) { return 0; }
|
||||
//SQLITE_API int sqlite3changeset_concat_strm(
|
||||
// int (*xInputA)(void *pIn, void *pData, int *pnData),
|
||||
// void *pInA,
|
||||
// int (*xInputB)(void *pIn, void *pData, int *pnData),
|
||||
// void *pInB,
|
||||
// int (*xOutput)(void *pOut, const void *pData, int nData),
|
||||
// void *pOut
|
||||
//) { return 0; }
|
||||
//SQLITE_API int sqlite3changeset_invert_strm(
|
||||
// int (*xInput)(void *pIn, void *pData, int *pnData),
|
||||
// void *pIn,
|
||||
// int (*xOutput)(void *pOut, const void *pData, int nData),
|
||||
// void *pOut
|
||||
//) { return 0; }
|
||||
//SQLITE_API int sqlite3changeset_start_strm(
|
||||
// sqlite3_changeset_iter **pp,
|
||||
// int (*xInput)(void *pIn, void *pData, int *pnData),
|
||||
// void *pIn
|
||||
//) { return 0; }
|
||||
//SQLITE_API int sqlite3session_changeset_strm(
|
||||
// sqlite3_session *pSession,
|
||||
// int (*xOutput)(void *pOut, const void *pData, int nData),
|
||||
// void *pOut
|
||||
//) { return 0; }
|
||||
//SQLITE_API int sqlite3session_patchset_strm(
|
||||
// sqlite3_session *pSession,
|
||||
// int (*xOutput)(void *pOut, const void *pData, int nData),
|
||||
// void *pOut
|
||||
//) { return 0; }
|
||||
//SQLITE_API int sqlite3changegroup_add_strm(sqlite3_changegroup* scg,
|
||||
// int (*xInput)(void *pIn, void *pData, int *pnData),
|
||||
// void *pIn
|
||||
//) { return 0; }
|
||||
//SQLITE_API int sqlite3changegroup_output_strm(sqlite3_changegroup* scg,
|
||||
// int (*xOutput)(void *pOut, const void *pData, int nData),
|
||||
// void *pOut
|
||||
//) { return 0; }
|
||||
//SQLITE_API int sqlite3rebaser_rebase_strm(
|
||||
// sqlite3_rebaser *pRebaser,
|
||||
// int (*xInput)(void *pIn, void *pData, int *pnData),
|
||||
// void *pIn,
|
||||
// int (*xOutput)(void *pOut, const void *pData, int nData),
|
||||
// void *pOut
|
||||
//) { return 0; }
|
||||
SQLITE_API void sqlite3_set_last_insert_rowid(sqlite3 *db,sqlite3_int64 i64) {}
|
||||
SQLITE_API void sqlite3_interrupt(sqlite3 *db) {}
|
||||
SQLITE_API void sqlite3_free_table(char **result) {}
|
||||
SQLITE_API void sqlite3_free(void *v) {}
|
||||
SQLITE_API void sqlite3_randomness(int N, void *P) {}
|
||||
SQLITE_API void sqlite3_progress_handler(sqlite3 *db, int i, int(*cb)(void*), void *v) {}
|
||||
SQLITE_API void sqlite3_value_free(sqlite3_value *s_val) {}
|
||||
SQLITE_API void sqlite3_set_auxdata(sqlite3_context *sctx, int N, void *v, void(*cb)(void*)) {}
|
||||
SQLITE_API void sqlite3_result_blob(sqlite3_context *sctx, const void *v, int i, void(*cb)(void*)) {}
|
||||
SQLITE_API void sqlite3_result_double(sqlite3_context *sctx, double df) {}
|
||||
SQLITE_API void sqlite3_result_error(sqlite3_context *sctx, const char *s, int i) {}
|
||||
SQLITE_API void sqlite3_result_error16(sqlite3_context *sctx, const void *v, int i) {}
|
||||
SQLITE_API void sqlite3_result_error_toobig(sqlite3_context *sctx) {}
|
||||
SQLITE_API void sqlite3_result_error_nomem(sqlite3_context *sctx) {}
|
||||
SQLITE_API void sqlite3_result_error_code(sqlite3_context *sctx, int i) {}
|
||||
SQLITE_API void sqlite3_result_int(sqlite3_context *sctx, int i) {}
|
||||
SQLITE_API void sqlite3_result_int64(sqlite3_context *sctx, sqlite3_int64 i64) {}
|
||||
SQLITE_API void sqlite3_result_null(sqlite3_context *sctx) {}
|
||||
SQLITE_API void sqlite3_result_text(sqlite3_context *sctx, const char *s, int i, void(*cb)(void*)) {}
|
||||
SQLITE_API void sqlite3_result_text16(sqlite3_context *sctx, const void *v, int i, void(*cb)(void*)) {}
|
||||
SQLITE_API void sqlite3_result_text16le(sqlite3_context *sctx, const void *v, int i,void(*cb)(void*)) {}
|
||||
SQLITE_API void sqlite3_result_text16be(sqlite3_context *sctx, const void *v, int i,void(*cb)(void*)) {}
|
||||
SQLITE_API void sqlite3_result_value(sqlite3_context *sctx, sqlite3_value *s_val) {}
|
||||
SQLITE_API void sqlite3_result_pointer(sqlite3_context *sctx, void *v,const char *s,void(*cb)(void*)) {}
|
||||
SQLITE_API void sqlite3_result_zeroblob(sqlite3_context *sctx, int n) {}
|
||||
SQLITE_API void sqlite3_result_subtype(sqlite3_context *sctx,unsigned int i) {}
|
||||
SQLITE_API void sqlite3_reset_auto_extension(void) {}
|
||||
SQLITE_API void sqlite3_mutex_free(sqlite3_mutex *smtx) {}
|
||||
SQLITE_API void sqlite3_mutex_enter(sqlite3_mutex *smtx) {}
|
||||
SQLITE_API void sqlite3_mutex_leave(sqlite3_mutex *smtx) {}
|
||||
SQLITE_API void sqlite3_str_appendf(sqlite3_str *s_str, const char *zFormat, ...) {}
|
||||
SQLITE_API void sqlite3_str_vappendf(sqlite3_str *s_str, const char *zFormat, va_list va) {}
|
||||
SQLITE_API void sqlite3_str_append(sqlite3_str *s_str, const char *zIn, int N) {}
|
||||
SQLITE_API void sqlite3_str_appendall(sqlite3_str *s_str, const char *zIn) {}
|
||||
SQLITE_API void sqlite3_str_appendchar(sqlite3_str *s_str, int N, char C) {}
|
||||
SQLITE_API void sqlite3_str_reset(sqlite3_str *s_str) {}
|
||||
SQLITE_API void sqlite3_log(int iErrCode, const char *zFormat, ...) {}
|
||||
SQLITE_API void sqlite3_stmt_scanstatus_reset(sqlite3_stmt *stmt) {}
|
||||
//SQLITE_API void sqlite3session_delete(sqlite3_session *pSession) {}
|
||||
//SQLITE_API void sqlite3changegroup_delete(sqlite3_changegroup*) {}
|
||||
//SQLITE_API void sqlite3rebaser_delete(sqlite3_rebaser *p) {}
|
@ -1,19 +1,11 @@
|
||||
#pragma once
|
||||
|
||||
#include <sqlite3.h>
|
||||
#include <sys/stat.h>
|
||||
#include <map>
|
||||
#include <string>
|
||||
#include <string_view>
|
||||
#include <functional>
|
||||
|
||||
#define db_err(e) db_err_cmd(e, )
|
||||
#define db_err_cmd(e, cmd) if (e) { \
|
||||
LOGE("sqlite3_exec: %s\n", e); \
|
||||
sqlite3_free(e); \
|
||||
cmd;\
|
||||
}
|
||||
|
||||
template <class T, size_t num>
|
||||
class db_data_base {
|
||||
public:
|
||||
@ -160,4 +152,6 @@ bool validate_manager(std::string &pkg, int userid, struct stat *st);
|
||||
void exec_sql(int client);
|
||||
char *db_exec(const char *sql);
|
||||
char *db_exec(const char *sql, const db_row_cb &fn);
|
||||
bool db_err(char *e);
|
||||
|
||||
#define db_err_cmd(e, cmd) if (db_err(e)) { cmd; }
|
||||
|
@ -19,12 +19,8 @@
|
||||
#define MODULEUPGRADE SECURE_DIR "/modules_update"
|
||||
#define DATABIN SECURE_DIR "/magisk"
|
||||
#define MAGISKDB SECURE_DIR "/magisk.db"
|
||||
#define BOOTCOUNT SECURE_DIR "/.boot_count"
|
||||
#define MANAGERAPK DATABIN "/magisk.apk"
|
||||
|
||||
// Legacy crap
|
||||
#define LEGACYCORE MODULEROOT "/.core"
|
||||
|
||||
constexpr const char *applet_names[] = { "su", "resetprop", "magiskhide", nullptr };
|
||||
|
||||
// Multi-call entrypoints
|
||||
|
@ -138,7 +138,7 @@ protected:
|
||||
void early_mount() override;
|
||||
public:
|
||||
RootFSInit(char *argv[], cmdline *cmd) : MagiskInit(argv, cmd) {
|
||||
persist_dir = "/dev/.magisk/mirror/persist/magisk";
|
||||
persist_dir = "/dev/mnt/persist/magisk";
|
||||
}
|
||||
|
||||
void start() override {
|
||||
|
@ -94,7 +94,7 @@ static bool read_dt_fstab(cmdline *cmd, const char *name) {
|
||||
char path[128];
|
||||
int fd;
|
||||
sprintf(path, "%s/fstab/%s/dev", cmd->dt_dir, name);
|
||||
if ((fd = xopen(path, O_RDONLY | O_CLOEXEC)) >= 0) {
|
||||
if ((fd = open(path, O_RDONLY | O_CLOEXEC)) >= 0) {
|
||||
read(fd, path, sizeof(path));
|
||||
close(fd);
|
||||
// Some custom treble use different names, so use what we read
|
||||
@ -119,26 +119,6 @@ if (!is_lnk("/" #name) && read_dt_fstab(cmd, #name)) { \
|
||||
mount_list.emplace_back("/" #name); \
|
||||
}
|
||||
|
||||
void RootFSInit::early_mount() {
|
||||
full_read("/init", self.buf, self.sz);
|
||||
|
||||
LOGD("Reverting /init\n");
|
||||
root = xopen("/", O_RDONLY | O_CLOEXEC);
|
||||
rename("/.backup/init", "/init");
|
||||
|
||||
// Mount sbin overlay for persist, but move it and add to cleanup list
|
||||
mount_sbin();
|
||||
xmount("/sbin", "/dev", nullptr, MS_MOVE, nullptr);
|
||||
mount_list.emplace_back("/dev");
|
||||
mount_list.emplace_back("/dev/.magisk/mirror/persist");
|
||||
mount_list.emplace_back("/dev/.magisk/mirror/cache");
|
||||
|
||||
mount_root(system);
|
||||
mount_root(vendor);
|
||||
mount_root(product);
|
||||
mount_root(odm);
|
||||
}
|
||||
|
||||
static void switch_root(const string &path) {
|
||||
LOGD("Switch root to %s\n", path.data());
|
||||
vector<string> mounts;
|
||||
@ -164,6 +144,45 @@ static void switch_root(const string &path) {
|
||||
chroot(".");
|
||||
}
|
||||
|
||||
static void mount_persist(const char *dev_base, const char *mnt_base) {
|
||||
string mnt_point = mnt_base + "/persist"s;
|
||||
strcpy(partname, "persist");
|
||||
sprintf(block_dev, "%s/persist", dev_base);
|
||||
if (setup_block(false) < 0) {
|
||||
// Fallback to cache
|
||||
strcpy(partname, "cache");
|
||||
sprintf(block_dev, "%s/cache", dev_base);
|
||||
if (setup_block(false) < 0) {
|
||||
// Try NVIDIA's BS
|
||||
strcpy(partname, "CAC");
|
||||
if (setup_block(false) < 0)
|
||||
return;
|
||||
}
|
||||
xsymlink("./cache", mnt_point.data());
|
||||
mnt_point = mnt_base + "/cache"s;
|
||||
}
|
||||
xmkdir(mnt_point.data(), 0755);
|
||||
xmount(block_dev, mnt_point.data(), "ext4", 0, nullptr);
|
||||
}
|
||||
|
||||
void RootFSInit::early_mount() {
|
||||
full_read("/init", self.buf, self.sz);
|
||||
|
||||
LOGD("Reverting /init\n");
|
||||
root = xopen("/", O_RDONLY | O_CLOEXEC);
|
||||
rename("/.backup/init", "/init");
|
||||
|
||||
mount_root(system);
|
||||
mount_root(vendor);
|
||||
mount_root(product);
|
||||
mount_root(odm);
|
||||
|
||||
xmkdir("/dev/mnt", 0755);
|
||||
mount_persist("/dev/block", "/dev/mnt");
|
||||
mount_list.emplace_back("/dev/mnt/persist");
|
||||
mount_list.emplace_back("/dev/mnt/cache");
|
||||
}
|
||||
|
||||
void SARBase::backup_files() {
|
||||
if (access("/overlay.d", F_OK) == 0)
|
||||
cp_afc("/overlay.d", "/dev/overlay.d");
|
||||
@ -250,23 +269,5 @@ void mount_sbin() {
|
||||
xmkdir(MIRRDIR, 0);
|
||||
xmkdir(BLOCKDIR, 0);
|
||||
|
||||
// Mount persist partition
|
||||
strcpy(partname, "persist");
|
||||
strcpy(block_dev, BLOCKDIR "/persist");
|
||||
const char *mnt_point = MIRRDIR "/persist";
|
||||
if (setup_block(false) < 0) {
|
||||
// Fallback to cache
|
||||
strcpy(partname, "cache");
|
||||
strcpy(block_dev, BLOCKDIR "/cache");
|
||||
if (setup_block(false) < 0) {
|
||||
// Try NVIDIA's BS
|
||||
strcpy(partname, "CAC");
|
||||
if (setup_block(false) < 0)
|
||||
return;
|
||||
}
|
||||
mnt_point = MIRRDIR "/cache";
|
||||
xsymlink("./cache", MIRRDIR "/persist");
|
||||
}
|
||||
xmkdir(mnt_point, 0755);
|
||||
xmount(block_dev, mnt_point, "ext4", 0, nullptr);
|
||||
mount_persist(BLOCKDIR, MIRRDIR);
|
||||
}
|
||||
|
@ -182,12 +182,6 @@ bool MagiskInit::patch_sepolicy(const char *file) {
|
||||
return patch_init;
|
||||
}
|
||||
|
||||
constexpr const char wrapper[] =
|
||||
"#!/system/bin/sh\n"
|
||||
"export LD_LIBRARY_PATH=\"$LD_LIBRARY_PATH:/apex/com.android.runtime/" LIBNAME "\"\n"
|
||||
"exec /sbin/magisk.bin \"$0\" \"$@\"\n"
|
||||
;
|
||||
|
||||
static void sbin_overlay(const raw_data &self, const raw_data &config) {
|
||||
mount_sbin();
|
||||
|
||||
@ -199,17 +193,8 @@ static void sbin_overlay(const raw_data &self, const raw_data &config) {
|
||||
fd = xopen("/sbin/magiskinit", O_WRONLY | O_CREAT, 0755);
|
||||
xwrite(fd, self.buf, self.sz);
|
||||
close(fd);
|
||||
if (access("/system/apex", F_OK) == 0) {
|
||||
LOGD("APEX detected, use wrapper\n");
|
||||
dump_magisk("/sbin/magisk.bin", 0755);
|
||||
patch_socket_name("/sbin/magisk.bin");
|
||||
fd = xopen("/sbin/magisk", O_WRONLY | O_CREAT, 0755);
|
||||
xwrite(fd, wrapper, sizeof(wrapper) - 1);
|
||||
close(fd);
|
||||
} else {
|
||||
dump_magisk("/sbin/magisk", 0755);
|
||||
patch_socket_name("/sbin/magisk");
|
||||
}
|
||||
dump_magisk("/sbin/magisk", 0755);
|
||||
patch_socket_name("/sbin/magisk");
|
||||
|
||||
// Create applet symlinks
|
||||
char path[64];
|
||||
@ -221,46 +206,35 @@ static void sbin_overlay(const raw_data &self, const raw_data &config) {
|
||||
xsymlink("./magiskinit", "/sbin/supolicy");
|
||||
}
|
||||
|
||||
static void recreate_sbin(const char *mirror) {
|
||||
int src = xopen(mirror, O_RDONLY | O_CLOEXEC);
|
||||
int dest = xopen("/sbin", O_RDONLY | O_CLOEXEC);
|
||||
DIR *fp = fdopendir(src);
|
||||
char buf[256];
|
||||
bool use_bind_mount = true;
|
||||
for (dirent *entry; (entry = xreaddir(fp));) {
|
||||
static void recreate_sbin(const char *mirror, bool use_bind_mount) {
|
||||
auto dp = xopen_dir(mirror);
|
||||
int src = dirfd(dp.get());
|
||||
char buf[4096];
|
||||
for (dirent *entry; (entry = xreaddir(dp.get()));) {
|
||||
if (entry->d_name == "."sv || entry->d_name == ".."sv)
|
||||
continue;
|
||||
string sbin_path = "/sbin/"s + entry->d_name;
|
||||
struct stat st;
|
||||
fstatat(src, entry->d_name, &st, AT_SYMLINK_NOFOLLOW);
|
||||
if (S_ISLNK(st.st_mode)) {
|
||||
xreadlinkat(src, entry->d_name, buf, sizeof(buf));
|
||||
xsymlinkat(buf, dest, entry->d_name);
|
||||
xsymlink(buf, sbin_path.data());
|
||||
} else {
|
||||
char sbin_path[256];
|
||||
sprintf(buf, "%s/%s", mirror, entry->d_name);
|
||||
sprintf(sbin_path, "/sbin/%s", entry->d_name);
|
||||
|
||||
if (use_bind_mount) {
|
||||
auto mode = st.st_mode & 0777;
|
||||
// Create dummy
|
||||
if (S_ISDIR(st.st_mode))
|
||||
xmkdir(sbin_path, st.st_mode & 0777);
|
||||
xmkdir(sbin_path.data(), mode);
|
||||
else
|
||||
close(xopen(sbin_path, O_CREAT | O_WRONLY | O_CLOEXEC, st.st_mode & 0777));
|
||||
close(xopen(sbin_path.data(), O_CREAT | O_WRONLY | O_CLOEXEC, mode));
|
||||
|
||||
if (xmount(buf, sbin_path, nullptr, MS_BIND, nullptr)) {
|
||||
// Bind mount failed, fallback to symlink
|
||||
remove(sbin_path);
|
||||
use_bind_mount = false;
|
||||
} else {
|
||||
continue;
|
||||
}
|
||||
xmount(buf, sbin_path.data(), nullptr, MS_BIND, nullptr);
|
||||
} else {
|
||||
xsymlink(buf, sbin_path.data());
|
||||
}
|
||||
|
||||
xsymlink(buf, sbin_path);
|
||||
}
|
||||
}
|
||||
close(src);
|
||||
close(dest);
|
||||
}
|
||||
|
||||
#define ROOTMIR MIRRDIR "/system_root"
|
||||
@ -304,7 +278,7 @@ void SARBase::patch_rootdir() {
|
||||
xmount(ROOTBLK, ROOTMIR, "erofs", MS_RDONLY, nullptr);
|
||||
|
||||
// Recreate original sbin structure
|
||||
recreate_sbin(ROOTMIR "/sbin");
|
||||
recreate_sbin(ROOTMIR "/sbin", true);
|
||||
|
||||
// Patch init
|
||||
raw_data init;
|
||||
@ -491,7 +465,7 @@ int magisk_proxy_main(int argc, char *argv[]) {
|
||||
sbin_overlay(self, config);
|
||||
|
||||
// Create symlinks pointing back to /root
|
||||
recreate_sbin("/root");
|
||||
recreate_sbin("/root", false);
|
||||
|
||||
setenv("REMOUNT_ROOT", "1", 1);
|
||||
execv("/sbin/magisk", argv);
|
||||
|
@ -73,6 +73,7 @@ private:
|
||||
uint8_t outbuf[CHUNK];
|
||||
|
||||
int write(const void *buf, size_t len, int flush) {
|
||||
int ret = 0;
|
||||
strm.next_in = (Bytef *) buf;
|
||||
strm.avail_in = len;
|
||||
do {
|
||||
@ -91,9 +92,9 @@ private:
|
||||
LOGW("gzip %s failed (%d)\n", mode ? "encode" : "decode", code);
|
||||
return -1;
|
||||
}
|
||||
bwrite(outbuf, sizeof(outbuf) - strm.avail_out);
|
||||
ret += bwrite(outbuf, sizeof(outbuf) - strm.avail_out);
|
||||
} while (strm.avail_out == 0);
|
||||
return len;
|
||||
return ret;
|
||||
}
|
||||
};
|
||||
|
||||
@ -147,6 +148,7 @@ private:
|
||||
char outbuf[CHUNK];
|
||||
|
||||
int write(const void *buf, size_t len, int flush) {
|
||||
int ret = 0;
|
||||
strm.next_in = (char *) buf;
|
||||
strm.avail_in = len;
|
||||
do {
|
||||
@ -165,9 +167,9 @@ private:
|
||||
LOGW("bzip2 %s failed (%d)\n", mode ? "encode" : "decode", code);
|
||||
return -1;
|
||||
}
|
||||
bwrite(outbuf, sizeof(outbuf) - strm.avail_out);
|
||||
ret += bwrite(outbuf, sizeof(outbuf) - strm.avail_out);
|
||||
} while (strm.avail_out == 0);
|
||||
return len;
|
||||
return ret;
|
||||
}
|
||||
};
|
||||
|
||||
@ -229,6 +231,7 @@ private:
|
||||
uint8_t outbuf[CHUNK];
|
||||
|
||||
int write(const void *buf, size_t len, lzma_action flush) {
|
||||
int ret = 0;
|
||||
strm.next_in = (uint8_t *) buf;
|
||||
strm.avail_in = len;
|
||||
do {
|
||||
@ -239,9 +242,9 @@ private:
|
||||
LOGW("LZMA %s failed (%d)\n", mode ? "encode" : "decode", code);
|
||||
return -1;
|
||||
}
|
||||
bwrite(outbuf, sizeof(outbuf) - strm.avail_out);
|
||||
ret += bwrite(outbuf, sizeof(outbuf) - strm.avail_out);
|
||||
} while (strm.avail_out == 0);
|
||||
return len;
|
||||
return ret;
|
||||
}
|
||||
};
|
||||
|
||||
@ -272,7 +275,7 @@ public:
|
||||
}
|
||||
|
||||
int write(const void *buf, size_t len) override {
|
||||
auto ret = len;
|
||||
int ret = 0;
|
||||
auto inbuf = reinterpret_cast<const uint8_t *>(buf);
|
||||
if (!outbuf)
|
||||
read_header(inbuf, len);
|
||||
@ -288,7 +291,7 @@ public:
|
||||
}
|
||||
len -= read;
|
||||
inbuf += read;
|
||||
bwrite(outbuf, write);
|
||||
ret += bwrite(outbuf, write);
|
||||
} while (len != 0 || write != 0);
|
||||
return ret;
|
||||
}
|
||||
@ -323,9 +326,9 @@ public:
|
||||
}
|
||||
|
||||
int write(const void *buf, size_t len) override {
|
||||
auto ret = len;
|
||||
int ret = 0;
|
||||
if (!outbuf)
|
||||
write_header();
|
||||
ret += write_header();
|
||||
if (len == 0)
|
||||
return 0;
|
||||
auto inbuf = reinterpret_cast<const uint8_t *>(buf);
|
||||
@ -339,7 +342,7 @@ public:
|
||||
}
|
||||
len -= read;
|
||||
inbuf += read;
|
||||
bwrite(outbuf, write);
|
||||
ret += bwrite(outbuf, write);
|
||||
} while (len != 0);
|
||||
return ret;
|
||||
}
|
||||
@ -358,7 +361,7 @@ private:
|
||||
|
||||
static constexpr size_t BLOCK_SZ = 1 << 22;
|
||||
|
||||
void write_header() {
|
||||
int write_header() {
|
||||
LZ4F_preferences_t prefs {
|
||||
.autoFlush = 1,
|
||||
.compressionLevel = 9,
|
||||
@ -372,7 +375,7 @@ private:
|
||||
outCapacity = LZ4F_compressBound(BLOCK_SZ, &prefs);
|
||||
outbuf = new uint8_t[outCapacity];
|
||||
size_t write = LZ4F_compressBegin(ctx, outbuf, outCapacity, &prefs);
|
||||
bwrite(outbuf, write);
|
||||
return bwrite(outbuf, write);
|
||||
}
|
||||
};
|
||||
|
||||
@ -380,15 +383,15 @@ class LZ4_decoder : public cpr_stream {
|
||||
public:
|
||||
explicit LZ4_decoder(stream_ptr &&base)
|
||||
: cpr_stream(std::move(base)), out_buf(new char[LZ4_UNCOMPRESSED]),
|
||||
buffer(new char[LZ4_COMPRESSED]), init(false), block_sz(0), buf_off(0) {}
|
||||
buf(new char[LZ4_COMPRESSED]), init(false), block_sz(0), buf_off(0) {}
|
||||
|
||||
~LZ4_decoder() override {
|
||||
delete[] out_buf;
|
||||
delete[] buffer;
|
||||
delete[] buf;
|
||||
}
|
||||
|
||||
int write(const void *in, size_t size) override {
|
||||
auto ret = size;
|
||||
int ret = 0;
|
||||
auto inbuf = static_cast<const char *>(in);
|
||||
if (!init) {
|
||||
// Skip magic
|
||||
@ -396,42 +399,48 @@ public:
|
||||
size -= 4;
|
||||
init = true;
|
||||
}
|
||||
int write;
|
||||
size_t consumed;
|
||||
do {
|
||||
for (int consumed; size != 0;) {
|
||||
if (block_sz == 0) {
|
||||
block_sz = *((unsigned *) inbuf);
|
||||
inbuf += sizeof(unsigned);
|
||||
size -= sizeof(unsigned);
|
||||
if (buf_off + size >= sizeof(block_sz)) {
|
||||
consumed = sizeof(block_sz) - buf_off;
|
||||
memcpy(buf + buf_off, inbuf, consumed);
|
||||
memcpy(&block_sz, buf, sizeof(block_sz));
|
||||
buf_off = 0;
|
||||
} else {
|
||||
consumed = size;
|
||||
memcpy(buf + buf_off, inbuf, size);
|
||||
}
|
||||
inbuf += consumed;
|
||||
size -= consumed;
|
||||
} else if (buf_off + size >= block_sz) {
|
||||
consumed = block_sz - buf_off;
|
||||
memcpy(buffer + buf_off, inbuf, consumed);
|
||||
memcpy(buf + buf_off, inbuf, consumed);
|
||||
inbuf += consumed;
|
||||
size -= consumed;
|
||||
|
||||
write = LZ4_decompress_safe(buffer, out_buf, block_sz, LZ4_UNCOMPRESSED);
|
||||
int write = LZ4_decompress_safe(buf, out_buf, block_sz, LZ4_UNCOMPRESSED);
|
||||
if (write < 0) {
|
||||
LOGW("LZ4HC decompression failure (%d)\n", write);
|
||||
return -1;
|
||||
}
|
||||
bwrite(out_buf, write);
|
||||
ret += bwrite(out_buf, write);
|
||||
|
||||
// Reset
|
||||
buf_off = 0;
|
||||
block_sz = 0;
|
||||
} else {
|
||||
// Copy to internal buffer
|
||||
memcpy(buffer + buf_off, inbuf, size);
|
||||
memcpy(buf + buf_off, inbuf, size);
|
||||
buf_off += size;
|
||||
size = 0;
|
||||
break;
|
||||
}
|
||||
} while (size != 0);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
private:
|
||||
char *out_buf;
|
||||
char *buffer;
|
||||
char *buf;
|
||||
bool init;
|
||||
unsigned block_sz;
|
||||
int buf_off;
|
||||
@ -440,12 +449,13 @@ private:
|
||||
class LZ4_encoder : public cpr_stream {
|
||||
public:
|
||||
explicit LZ4_encoder(stream_ptr &&base)
|
||||
: cpr_stream(std::move(base)), outbuf(new char[LZ4_COMPRESSED]), buf(new char[LZ4_UNCOMPRESSED]),
|
||||
init(false), buf_off(0), in_total(0) {}
|
||||
: cpr_stream(std::move(base)), outbuf(new char[LZ4_COMPRESSED]),
|
||||
buf(new char[LZ4_UNCOMPRESSED]), init(false), buf_off(0), in_total(0) {}
|
||||
|
||||
int write(const void *in, size_t size) override {
|
||||
int ret = 0;
|
||||
if (!init) {
|
||||
bwrite("\x02\x21\x4c\x18", 4);
|
||||
ret += bwrite("\x02\x21\x4c\x18", 4);
|
||||
init = true;
|
||||
}
|
||||
if (size == 0)
|
||||
@ -453,21 +463,18 @@ public:
|
||||
in_total += size;
|
||||
const char *inbuf = (const char *) in;
|
||||
size_t consumed;
|
||||
int write;
|
||||
do {
|
||||
if (buf_off + size >= LZ4_UNCOMPRESSED) {
|
||||
consumed = LZ4_UNCOMPRESSED - buf_off;
|
||||
memcpy(buf + buf_off, inbuf, consumed);
|
||||
inbuf += consumed;
|
||||
size -= consumed;
|
||||
buf_off = LZ4_UNCOMPRESSED;
|
||||
|
||||
write = LZ4_compress_HC(buf, outbuf, LZ4_UNCOMPRESSED, LZ4_COMPRESSED, 9);
|
||||
if (write == 0) {
|
||||
LOGW("LZ4HC compression failure\n");
|
||||
return false;
|
||||
}
|
||||
bwrite(&write, sizeof(write));
|
||||
bwrite(outbuf, write);
|
||||
if (int written = write_block(); written < 0)
|
||||
return -1;
|
||||
else
|
||||
ret += written;
|
||||
|
||||
// Reset buffer
|
||||
buf_off = 0;
|
||||
@ -478,15 +485,12 @@ public:
|
||||
size = 0;
|
||||
}
|
||||
} while (size != 0);
|
||||
return true;
|
||||
return ret;
|
||||
}
|
||||
|
||||
~LZ4_encoder() override {
|
||||
if (buf_off) {
|
||||
int write = LZ4_compress_HC(buf, outbuf, buf_off, LZ4_COMPRESSED, 9);
|
||||
bwrite(&write, sizeof(write));
|
||||
bwrite(outbuf, write);
|
||||
}
|
||||
if (buf_off)
|
||||
write_block();
|
||||
bwrite(&in_total, sizeof(in_total));
|
||||
delete[] outbuf;
|
||||
delete[] buf;
|
||||
@ -498,6 +502,17 @@ private:
|
||||
bool init;
|
||||
int buf_off;
|
||||
unsigned in_total;
|
||||
|
||||
int write_block() {
|
||||
int written = LZ4_compress_HC(buf, outbuf, buf_off, LZ4_COMPRESSED, 9);
|
||||
if (written == 0) {
|
||||
LOGW("LZ4HC compression failure\n");
|
||||
return -1;
|
||||
}
|
||||
bwrite(&written, sizeof(written));
|
||||
bwrite(outbuf, written);
|
||||
return written + sizeof(written);
|
||||
}
|
||||
};
|
||||
|
||||
stream_ptr get_encoder(format_t type, stream_ptr &&base) {
|
||||
|
@ -96,17 +96,7 @@ else
|
||||
fi
|
||||
|
||||
# Magisk stuffs
|
||||
if [ -e /apex ]; then
|
||||
./magiskinit -x magisk /sbin/magisk.bin
|
||||
[ -e /system/lib64 ] && LIB=lib64 || LIB=lib
|
||||
cat <<EOF > /sbin/magisk
|
||||
#!/system/bin/sh
|
||||
export LD_LIBRARY_PATH="\$LD_LIBRARY_PATH:/apex/com.android.runtime/$LIB"
|
||||
exec /sbin/magisk.bin "\$0" "\$@"
|
||||
EOF
|
||||
else
|
||||
./magiskinit -x magisk /sbin/magisk
|
||||
fi
|
||||
./magiskinit -x magisk /sbin/magisk
|
||||
chmod 755 /sbin/magisk
|
||||
ln -s ./magisk /sbin/su
|
||||
ln -s ./magisk /sbin/resetprop
|
||||
|
@ -11,8 +11,6 @@ import static android.os.Build.VERSION.SDK_INT;
|
||||
|
||||
public class DynAPK {
|
||||
|
||||
private static final int STUB_VERSION = 6;
|
||||
|
||||
// Indices of the object array
|
||||
private static final int STUB_VERSION_ENTRY = 0;
|
||||
private static final int CLASS_COMPONENT_MAP = 1;
|
||||
@ -64,7 +62,7 @@ public class DynAPK {
|
||||
}
|
||||
|
||||
public static class Data {
|
||||
public int version = STUB_VERSION;
|
||||
public int version;
|
||||
public Map<String, String> classToComponent;
|
||||
}
|
||||
}
|
||||
|
@ -6,6 +6,8 @@ import java.util.Map;
|
||||
import static com.topjohnwu.magisk.DynAPK.Data;
|
||||
|
||||
public class Mapping {
|
||||
private static final int STUB_VERSION = 7;
|
||||
|
||||
private static Map<String, String> map = new HashMap<>();
|
||||
private static Map<String, String> inverseMap;
|
||||
|
||||
@ -29,6 +31,7 @@ public class Mapping {
|
||||
|
||||
public static Data data() {
|
||||
Data data = new Data();
|
||||
data.version = STUB_VERSION;
|
||||
data.classToComponent = inverseMap;
|
||||
return data;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user