{"id":16608334,"url":"https://github.com/thp/apkenv","last_synced_at":"2025-07-20T21:36:02.873Z","repository":{"id":5562596,"uuid":"6767711","full_name":"thp/apkenv","owner":"thp","description":"A compatibility layer for applications packaged as .apk. Can run certain Android games on non-Android Linux (glibc and others).","archived":false,"fork":false,"pushed_at":"2024-09-20T07:33:47.000Z","size":19727,"stargazers_count":129,"open_issues_count":2,"forks_count":39,"subscribers_count":24,"default_branch":"master","last_synced_at":"2025-04-08T01:51:19.857Z","etag":null,"topics":["android","game","hooking","maemo","meego","opengles","wrapper"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"CraZySacX/node-jdbc","license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/thp.png","metadata":{"files":{"readme":"README","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.apkenv","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2012-11-19T21:35:39.000Z","updated_at":"2025-04-01T07:57:26.000Z","dependencies_parsed_at":"2025-01-05T10:31:27.244Z","dependency_job_id":null,"html_url":"https://github.com/thp/apkenv","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/thp/apkenv","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thp%2Fapkenv","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thp%2Fapkenv/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thp%2Fapkenv/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thp%2Fapkenv/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/thp","download_url":"https://codeload.github.com/thp/apkenv/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/thp%2Fapkenv/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266204640,"owners_count":23892366,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["android","game","hooking","maemo","meego","opengles","wrapper"],"created_at":"2024-10-12T01:25:52.686Z","updated_at":"2025-07-20T21:36:02.817Z","avatar_url":"https://github.com/thp.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"\napkenv\n======\n\nA compatibility layer for applications packaged as .apk.\n\nSupport website: http://thp.io/2012/apkenv/\n\n\nIf you want to run this no your Desktop Linux machine, see README.osmesa for\nhow to build it with the necessary compatibility libraries. This is now the\ndefault build target.\n\n\nExample module and .apk\n=======================\n\nAn example module is provided in modules/trg2.c - you can use this module as a\nbasis to create your own modules. You can download the .apk that works with\nthis example module from:\n\n    http://thp.io/2011/trg2/\n\n\n\"Installing\" applications\n=========================\n\napkenv now includes a very rudimentary facility to \"install\" an .apk as an\napplication. What it really does is extract the icon from the .apk (this might\nnot work for all .apks - we'd need to read the manifest to get the real file\nname and application name in all cases) and create a launcher icon that starts\napkenv with the apk file as its argument. To use it, type:\n\n   apkenv --install /path/to/your.apk\n\nplease note that installing is not supported on the pandora port yet.\n\n\nsoftfp vs. hardfp\n=================\n\nAndroid is softfp.\nMaemo 5 is softfp.\nMeeGo 1.2 Harmattan is hardfp.\nPandora is softfp.\n\nsoftfp and hardfp differ in the way functions with floating point arguments\nget called. Trying to call a hardfp function with the softfp calling\nconvention will not work and likely result in a crash or worse. To avoid\nthis, you can add an attribute to function declarations to make sure that\nthe function accepts its parameters using the softfp calling convention,\nlike this:\n\n    __attribute__((pcs(\"aapcs\")))\n\nThere's a convenience #define in apkenv.h called \"SOFTFP\" with which you can\ndecorate all functions that are either in a native library (i.e. in\nmodules/) or that will be called from the native library (i.e. in compat/).\nPlease note that in theory this attribute is only required on functions that\npass float values in the arguments, but do it always to save you some\nheadaches.\n\n\nDebugging crashes\n=================\n\nFirst of all, enable debugging in the makefile (set DEBUG=1). Then rebuild\nto get a debug build with lots of debug output. You can then check which\nsymbols get mapped from where at the linker phase (e.g. apkenv x.apk | grep\n'from libc') - in general, most libc functions must be mapped in order to\navoid problems (e.g. stdio functions don't work in Bionic libc, so we have\nto hack around these issues - the same is true for memory (de-)allocation,\netc..).\n\nWhen you have all relevant functions mapped, ltrace'ing apkenv can help you\nfind the library function in which it crashes - this will not list functions\nfrom Bionic libs, but only from your system libraries (another reason why it\nis usually a good idea to map system-level functions).\n\napkenv now also has some more in depth debugging options (see --help), for\nexample tracing calls to bionic libraries (-ta -u), while running an app this\nwill show you which bionic functions are called from the app and if the crash\nhappens soon after one of the bionic functions is called try adding this\nfunction to the hooks, in some cases this has helped us to fix crashes.\n\nDocumentation\n=============\n\nJNI Invocation API\nhttp://docs.oracle.com/javase/1.5.0/docs/guide/jni/spec/invocation.html\n\nJNI Functions\nhttp://docs.oracle.com/javase/1.5.0/docs/guide/jni/spec/functions.html\n\nJNI Types and Data Structures\nhttp://docs.oracle.com/javase/1.5.0/docs/guide/jni/spec/types.html\n\nGCC Function Attributes\nhttp://gcc.gnu.org/onlinedocs/gcc/Function-Attributes.html\n\nARM Hard Float Point: VFP Comparison\nhttp://wiki.debian.org/ArmHardFloatPort/VfpComparison\n\nAndroid MotionEvent\nhttp://developer.android.com/reference/android/view/MotionEvent.html\n\n\nThird Party Code\n================\n\nAll code written by me (thp) for apkenv is licensed under a simplified BSD\nlicense (see LICENSE.apkenv). However, code from third parties might be\nlicensed under a different license, and have different copyright holders:\n\napklib/unzip.{c,h}, apklib/ioapi.{c,h}:\n    The MiniZip project - http://www.winimage.com/zLibDll/minizip.html\n    Copyright (C) 1998-2010 Gilles Vollant (minizip)\n    Copyright (C) 2007-2008 Even Rouault\n    Copyright (C) 2009-2010 Mathias Svensson ( http://result42.com )\n\napklib/ioapi_mem.c:\n    ioapi implementation for accessing .zip files in memory\n    Copyright (C) 1998-2003 Gilles Vollant\n    Copyright (C) 2003 Justin Fletcher\n\nimagelib/stb_image.h:\n    stb_image - v2.27 - public domain image loader - http://nothings.org/stb\n    Copyright (c) 2017 Sean Barrett\n\nlinker/*:\n    The Android Bionic Linker + The Android Bionic C Library\n    Copyright (c) 2005-2008, The Android Open Source Project\n\njni/jni.h:\n    libnativehelper: Support functions for Android's class libraries\n    Copyright (C) 2006 The Android Open Source Project\n\ncompat/hooks.c, compat/pthread_wrapper.c:\n    pthread wrapper implementation based on code from libhybris\n    Copyright (C) 2012 Carsten Munk\n\n\nPandora Port\n============\n\nAll code written by me (crowriot) for apkenv's pandora port is \nlicensed under same conditions as the apkenv itself.\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthp%2Fapkenv","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthp%2Fapkenv","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthp%2Fapkenv/lists"}