APK safe function