当前位置:操作系统 > 安卓/Android >>

自动获取android应用的apk版本包名权限

 

更新应用需要 需要包名 权限 版本等信息。

 

$xmlFile = "AndroidManifest.xml";

$power = array ("android.permission.ACCESS_CHECKIN_PROPERTIES", "android.permission.ACCESS_COARSE_LOCATION", "android.permission.ACCESS_FINE_LOCATION", "android.permission.ACCESS_LOCATION_EXTRA_COMMANDS", "android.permission.ACCESS_MOCK_LOCATION", "android.permission.ACCESS_NETWORK_STATE", "android.permission.ACCESS_SURFACE_FLINGER", "android.permission.ACCESS_WIFI_STATE", "android.permission.ACCOUNT_MANAGER", "android.permission.AUTHENTICATE_ACCOUNTS", "android.permission.BATTERY_STATS", "android.permission.BIND_APPWIDGET", "android.permission.BIND_DEVICE_ADMIN", "android.permission.BIND_INPUT_METHOD", "android.permission.BIND_REMOTEVIEWS", "android.permission.BIND_WALLPAPER", "android.permission.BLUETOOTH", "android.permission.BLUETOOTH_ADMIN", "android.permission.BRICK", "android.permission.BROADCAST_PACKAGE_REMOVED", "android.permission.BROADCAST_SMS", "android.permission.BROADCAST_STICKY", "android.permission.BROADCAST_WAP_PUSH", "android.permission.CALL_PHONE", "android.permission.CALL_PRIVILEGED", "android.permission.CAMERA", "android.permission.CHANGE_COMPONENT_ENABLED_STATE", "android.permission.CHANGE_CONFIGURATION", "android.permission.CHANGE_NETWORK_STATE", "android.permission.CHANGE_WIFI_MULTICAST_STATE", "android.permission.CHANGE_WIFI_STATE", "android.permission.CLEAR_APP_CACHE", "android.permission.CLEAR_APP_USER_DATA", "android.permission.CWJ_GROUP", "android.permission.CELL_PHONE_MASTER_EX", "android.permission.CONTROL_LOCATION_UPDATES", "android.permission.DELETE_CACHE_FILES", "android.permission.DELETE_PACKAGES", "android.permission.DEVICE_POWER", "android.permission.DIAGNOSTIC", "android.permission.DISABLE_KEYGUARD", "android.permission.DUMP", "android.permission.EXPAND_STATUS_BAR", "android.permission.FACTORY_TEST", "android.permission.FLASHLIGHT", "android.permission.FORCE_BACK", "android.permission.GET_ACCOUNTS", "android.permission.GET_PACKAGE_SIZE", "android.permission.GET_TASKS", "android.permission.GLOBAL_SEARCH", "android.permission.HARDWARE_TEST", "android.permission.INJECT_EVENTS", "android.permission.INSTALL_LOCATION_PROVIDER", "android.permission.INSTALL_PACKAGES", "android.permission.INTERNAL_SYSTEM_WINDOW", "android.permission.INTERNET", "android.permission.KILL_BACKGROUND_PROCESSES", "android.permission.MANAGE_ACCOUNTS", "android.permission.MANAGE_APP_TOKENS", "android.permission.MTWEAK_USER", "android.permission.MTWEAK_FORUM", "android.permission.MASTER_CLEAR", "android.permission.MODIFY_AUDIO_SETTINGS", "android.permission.MODIFY_PHONE_STATE", "android.permission.MOUNT_FORMAT_FILESYSTEMS", "android.permission.MOUNT_UNMOUNT_FILESYSTEMS", "android.permission.NFC", "android.permission.PERSISTENT_ACTIVITY", "android.permission.PROCESS_OUTGOING_CALLS", "android.permission.READ_CALENDAR", "android.permission.READ_CONTACTS", "android.permission.READ_FRAME_BUFFER", "com.android.browser.permission.READ_HISTORY_BOOKMARKS", "android.permission.READ_INPUT_STATE", "android.permission.READ_LOGS", "android.permission.READ_PHONE_STATE", "android.permission.READ_SMS", "android.permission.READ_SYNC_SETTINGS", "android.permission.READ_SYNC_STATS", "android.permission.REBOOT", "android.permission.RECEIVE_BOOT_COMPLETED", "android.permission.RECEIVE_MMS", "android.permission.RECEIVE_SMS", "android.permission.RECEIVE_WAP_PUSH", "android.permission.RECORD_AUDIO", "android.permission.REORDER_TASKS", "android.permission.RESTART_PACKAGES", "android.permission.SEND_SMS", "android.permission.SET_ACTIVITY_WATCHER", "com.android.alarm.permission.SET_ALARM", "android.permission.SET_ALWAYS_FINISH", "android.permission.SET_ANIMATION_SCALE", "android.permission.SET_DEBUG_APP", "android.permission.SET_ORIENTATION", "android.permission.SET_PREFERRED_APPLICATIONS", "android.permission.SET_PROCESS_LIMIT", "android.permission.SET_TIME", "android.permission.SET_TIME_ZONE", "android.permission.SET_WALLPAPER", "android.permission.SET_WALLPAPER_HINTS", "android.permission.SIGNAL_PERSISTENT_PROCESSES", "android.permission.STATUS_BAR", "android.permission.SUBSCRIBED_FEEDS_READ", "android.permission.SUBSCRIBED_FEEDS_WRITE", "android.permission.SYSTEM_ALERT_WINDOW", "android.permission.UPDATE_DEVICE_STATS", "android.permission.USE_CREDENTIALS", "android.permission.USE_SIP", "android.permission.VIBRATE", "android.permission.WAKE_LOCK", "android.permission.WRITE_APN_SETTINGS", "android.permission.WRITE_CALENDAR", "android.permission.WRITE_CONTACTS", "android.permission.WRITE_EXTERNAL_STORAGE", "android.permission.WRITE_GSERVICES", "com.android.browser.permission.WRITE_HISTORY_BOOKMARKS", "android.permission.WRITE_SECURE_SETTINGS", "android.permission.WRITE_SETTINGS", "android.permission.WRITE_SMS", "android.permission.WRITE_SYNC_SETTINGS" );

$arr = array ();

$arr1 = array ();

$result = array ();

$zip = zip_open ( $zip_dir );

if (is_resource ( $zip )) {

while ( ($zip_entry = zip_read ( $zip )) != false ) {

$file = basename ( zip_entry_name ( $zip_entry ) );

if ($file == $xmlFile) {

//echo "The file " . $file . " was extracted to dir " . $zip_dir . "\n<br>";

if (zip_entry_open ( $zip, $zip_entry )) {

echo "xmlFile Contents:\n";

$buf = zip_entry_read ( $zip_entry, zip_entry_filesize ( $zip_entry ) );

$arr = str_split ( $buf );

$i = 0;

foreach ( $arr as $key => $value ) {

if ((ctype_alnum ( $value ) || $value == '_') || ($value === '.')) {

$arr1 [$i] = $value;

$i ++;

}

}

 

$subject = array_reduce ( $arr1, "myfunction" );

foreach ( $power as $k ) {

if (strpos ( $subject, $k )) {

$result [] = $k;

}

}

return $result;

zip_entry_close ( $zip_entry );

}

}

}

zip_close ( $zip );

} else {

echo ("fail to resourse");

}

 

 

作者:guoxingjun5251223

补充:移动开发 , Android ,
CopyRight © 2022 站长资源库 编程知识问答 zzzyk.com All Rights Reserved
部分文章来自网络,