iOS中使用entitlement
文件来描述可执行文件的权限,例如,当我们在Xcode中勾选了推送的权限,就会看到生成了一个entitlement
文件,里面包含下面内容
1 2
| <key>aps-environment</key> <string>development</string>
|
如果勾选了Sign With Apple
,会出现
1 2 3 4
| <key>com.apple.developer.applesignin</key> <array> <string>Default</string> </array>
|
只有配置了对应的权限声明,并签名到可执行文件中,程序才有权限执行对应的功能,例如如果我们没有加上Sign With Apple
,则苹果登录相关的接口会失败
Entitlement
iOS中可执行文件会包含entitlement来声明可执行文件有用哪些权限,默认的iOS开发的应用程序的权限有限,例如只能访问沙盒数据,不能访问系统目录,不能访问其他App,而系统程序却可以,主要差别在于可执行文件签名的权限,系统程序拥有更高的权限,例如SpringBoard
签名
在Mac上,我们可以通过ldid
工具,对可执行文件的权限重新签名,也可以导出可执行文件的entitlement
描述
0. 安装ldid
1. 导出entitlement描述
使用ldid
,导出可执行文件SpringBoard
的权限到SpringBoard.entitlements
1
| ldid -e SpringBoard > SpringBoard.entitlements
|
2. 重新签名entitlement
把权限SpringBoard.entitlements
签名到可执行文件TestTool
中
1
| ldid -SSpringBoard.entitlements TestTool
|
此时,TestTool
就拥有跟SpringBoard
一样的执行权限
3. 使用codesign签名
除ldid
外,也可以通过codesign
进行签名,codesign
就有一个entitlement参数
1
| codesign -d --entitlements TestTool.entitlements TestTool
|
实践
1. 导出SpringBoard程序的权限
SpringBoard
应用位于/System/Library/CoreServices/SpringBoard.app
,我们先把他拷贝出来
1
| scp root@xx.xx.xx.xx:/System/Library/CoreServices/SpringBoard.app/SpringBoard ~/Desktop/SpringBoard
|
通过上面的ldid
命令导出得到entitlement,如下
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648
| <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>allow-obliterate-device</key> <true/> <key>application-identifier</key> <string>com.apple.springboard</string> <key>aps-connection-initiate</key> <true/> <key>backupd-connection-initiate</key> <true/> <key>checklessPersistentURLTranslation</key> <true/> <key>com.apple.BTServer.allowRestrictedServices</key> <true/> <key>com.apple.BTServer.programmaticPairing</key> <true/> <key>com.apple.CallHistory.sync.allow</key> <true/> <key>com.apple.CommCenter.fine-grained</key> <array> <string>spi</string> <string>preferences-reset</string> <string>voice</string> <string>identity</string> <string>phone</string> <string>carrier-settings</string> </array> <key>com.apple.CompanionLink</key> <true/> <key>com.apple.Contacts.database-allow</key> <true/> <key>com.apple.CoreRoutine.LocationOfInterest</key> <true/> <key>com.apple.MobileInternetSharing.allow</key> <true/> <key>com.apple.QuartzCore.cache-asynchronous</key> <true/> <key>com.apple.QuartzCore.displayable-context</key> <true/> <key>com.apple.QuartzCore.global-capture</key> <true/> <key>com.apple.QuartzCore.secure-capture</key> <true/> <key>com.apple.QuartzCore.secure-mode</key> <true/> <key>com.apple.SystemConfiguration.SCDynamicStore-write-access</key> <true/> <key>com.apple.SystemConfiguration.SCPreferences-write-access</key> <array> <string>com.apple.AutoWake.xml</string> <string>preferences.plist</string> <string>com.apple.radios.plist</string> </array> <key>com.apple.accounts.appleaccount.fullaccess</key> <true/> <key>com.apple.assistant.client</key> <true/> <key>com.apple.authkit.writer.internal</key> <true/> <key>com.apple.avfoundation.allow-identifying-output-device-details</key> <true/> <key>com.apple.avfoundation.allow-still-image-capture-shutter-sound-manipulation</key> <true/> <key>com.apple.avfoundation.allow-system-wide-context</key> <true/> <key>com.apple.avfoundation.allows-access-to-device-list</key> <true/> <key>com.apple.avfoundation.allows-set-output-device</key> <true/> <key>com.apple.backboard.client</key> <true/> <key>com.apple.backboard.display.archive</key> <true/> <key>com.apple.backboard.displaybrightness</key> <true/> <key>com.apple.backboardd.cancelsTouchesInHostedContent</key> <true/> <key>com.apple.backboardd.hostCanRequireTouchesFromHostedContent</key> <true/> <key>com.apple.backboardd.lastUserEventTime</key> <true/> <key>com.apple.backboardd.launchapplications</key> <true/> <key>com.apple.backboardd.touchDeliveryObservation</key> <true/> <key>com.apple.backboardd.virtualDisplay</key> <true/> <key>com.apple.bluetooth.system</key> <true/> <key>com.apple.bulletinboard</key> <true/> <key>com.apple.bulletinboard.dataprovider</key> <true/> <key>com.apple.bulletinboard.observer</key> <true/> <key>com.apple.bulletinboard.serverconduit</key> <true/> <key>com.apple.bulletinboard.settings</key> <true/> <key>com.apple.bulletinboard.systemstate</key> <true/> <key>com.apple.bulletinboard.utilities</key> <true/> <key>com.apple.cards.all-access</key> <true/> <key>com.apple.coreaudio.CanRecordPastData</key> <true/> <key>com.apple.coreaudio.allow-amr-decode</key> <true/> <key>com.apple.coreaudio.allow-opus-codec</key> <true/> <key>com.apple.coreaudio.allow-speex-codec</key> <true/> <key>com.apple.coreduetd.allow</key> <true/> <key>com.apple.coreduetd.batterysaver.allow</key> <true/> <key>com.apple.coreduetd.context</key> <true/> <key>com.apple.coremedia.allow-pre-wiring-pixel-buffers</key> <true/> <key>com.apple.coremedia.allow-protected-content-playback</key> <true/> <key>com.apple.coremedia.virtualdisplaysession</key> <true/> <key>com.apple.developer.extension-host.widget-extension</key> <true/> <key>com.apple.developer.homekit</key> <true/> <key>com.apple.developer.ubiquity-kvstore-identifier</key> <string>com.apple.springboard</string> <key>com.apple.duet.activityscheduler.allow</key> <true/> <key>com.apple.duet.expertcenter.consumer</key> <true/> <key>com.apple.fileprovider.enumerate</key> <true/> <key>com.apple.fileprovider.fetch-url</key> <true/> <key>com.apple.frontboard.app-badge-value-access</key> <true/> <key>com.apple.frontboard.launchapplications</key> <true/> <key>com.apple.frontboard.shutdown</key> <true/> <key>com.apple.frontboardservices.display-layout-monitor</key> <true/> <key>com.apple.geoservices.navigation_info</key> <true/> <key>com.apple.homekit.private-spi-access</key> <true/> <key>com.apple.iapd.accessibility</key> <true/> <key>com.apple.icloud.findmydeviced.access</key> <true/> <key>com.apple.icloud.fmfd.access</key> <true/> <key>com.apple.idle-timer-services</key> <true/> <key>com.apple.imagent</key> <true/> <key>com.apple.imagent.av</key> <true/> <key>com.apple.imagent.chat</key> <true/> <key>com.apple.intents.extension.discovery</key> <true/> <key>com.apple.intents.uiextension.discovery</key> <true/> <key>com.apple.itunesstored.private</key> <true/> <key>com.apple.keystore.device</key> <true/> <key>com.apple.keystore.lockassertion</key> <true/> <key>com.apple.keystore.stash.access</key> <true/> <key>com.apple.launchservices.clearadvertisingid</key> <true/> <key>com.apple.locationd.activity</key> <true/> <key>com.apple.locationd.authorizeapplications</key> <true/> <key>com.apple.locationd.effective_bundle</key> <true/> <key>com.apple.locationd.place_inference</key> <true/> <key>com.apple.locationd.prompt_behavior</key> <true/> <key>com.apple.locationd.region_proxy_service</key> <true/> <key>com.apple.locationd.status</key> <true/> <key>com.apple.locationd.usage_oracle</key> <true/> <key>com.apple.locationd.vehicle_data</key> <true/> <key>com.apple.logind.client.entitlement</key> <true/> <key>com.apple.lsapplicationproxy.deviceidentifierforvendor</key> <true/> <key>com.apple.managedconfiguration.mdmd-access</key> <true/> <key>com.apple.managedconfiguration.profiled-access</key> <true/> <key>com.apple.mediastream.mstreamd-access</key> <true/> <key>com.apple.messages.composeclient</key> <true/> <key>com.apple.mkb.usersession.info</key> <true/> <key>com.apple.mkb.usersession.loginwindow</key> <true/> <key>com.apple.mobile.deleted.AllowFreeSpace</key> <true/> <key>com.apple.mobile.keybagd.UserManager.logoutcritical</key> <true/> <key>com.apple.mobilemail.mailservices</key> <true/> <key>com.apple.multitasking.systemappassertions</key> <true/> <key>com.apple.multitasking.termination</key> <true/> <key>com.apple.nfcd.hwmanager</key> <true/> <key>com.apple.nfcd.seshat</key> <true/> <key>com.apple.notificationcenter.widgetcontrollerhascontent</key> <true/> <key>com.apple.osanalytics.otatasking-service-access</key> <true/> <key>com.apple.payment.configuration</key> <true/> <key>com.apple.payment.presentation</key> <true/> <key>com.apple.private.CallHistory.read</key> <true/> <key>com.apple.private.CoreAuthentication.SPI</key> <true/> <key>com.apple.private.InstallCoordination.allowed</key> <true/> <key>com.apple.private.MobileContainerManager.otherIdLookup</key> <true/> <key>com.apple.private.MobileGestalt.AllowedProtectedKeys</key> <array> <string>InverseDeviceID</string> </array> <key>com.apple.private.SafariServices.PasswordPicker.setRemoteAppProperties</key> <true/> <key>com.apple.private.StarBoard.session</key> <string>YES</string> <key>com.apple.private.WebClips.read-write</key> <true/> <key>com.apple.private.accounts.allaccounts</key> <true/> <key>com.apple.private.airdrop.settings</key> <true/> <key>com.apple.private.appleaccount.app-hidden-from-icloud-settings</key> <true/> <key>com.apple.private.applecredentialmanager.allow</key> <true/> <key>com.apple.private.appstored</key> <array> <string>Repair</string> <string>TestFlightFeedback</string> </array> <key>com.apple.private.attentionawareness</key> <true/> <key>com.apple.private.attentionawareness.poll</key> <true/> <key>com.apple.private.bmk.allow</key> <true/> <key>com.apple.private.calendar.allow-suggestions</key> <true/> <key>com.apple.private.canGetAppLinkInfo</key> <true/> <key>com.apple.private.canModifyAppLinkPermissions</key> <true/> <key>com.apple.private.carkit</key> <true/> <key>com.apple.private.carkit.app</key> <true/> <key>com.apple.private.carkit.dnd</key> <true/> <key>com.apple.private.clouddocs.can-grant-access-to-document</key> <true/> <key>com.apple.private.contactsui</key> <true/> <key>com.apple.private.corerecents</key> <true/> <key>com.apple.private.coreservices.canopenactivity</key> <true/> <key>com.apple.private.coreservices.lsuseractivityd.bestappsuggestion</key> <true/> <key>com.apple.private.corespotlight.internal</key> <true/> <key>com.apple.private.corespotlight.search.internal</key> <true/> <key>com.apple.private.dmd.policy</key> <true/> <key>com.apple.private.donotdisturb.behavior.resolution.client-identifiers</key> <array> <string>com.apple.springboard.SBNCSoundController</string> <string>com.apple.springboard.SBNCScreenController</string> <string>com.apple.springboard.SBNotificationBannerDestination</string> <string>com.apple.springboard.SBNotificationLegacyCarDestination</string> <string>com.apple.springboard.SBDashBoardCombinedListViewController</string> <string>com.apple.springboard.SBBulletinSpokenObserverGateway</string> </array> <key>com.apple.private.donotdisturb.mode.assertion.client-identifiers</key> <array> <string>com.apple.donotdisturb.control-center.module</string> <string>com.apple.springboard.donotdisturb.notifications</string> </array> <key>com.apple.private.donotdisturb.mode.assertion.user-requested.client-identifiers</key> <array> <string>com.apple.donotdisturb.control-center.module</string> <string>com.apple.springboard.donotdisturb.notifications</string> </array> <key>com.apple.private.donotdisturb.settings.request.client-identifiers</key> <array> <string>com.apple.springboard.donotdisturb.notifications</string> </array> <key>com.apple.private.donotdisturb.settings.updates.client-identifiers</key> <array> <string>com.apple.springboard.donotdisturb.notifications</string> </array> <key>com.apple.private.donotdisturb.state.request.client-identifiers</key> <array> <string>com.apple.springboard.SBStatusBarStateAggregator</string> <string>com.apple.springboard.SBDashBoardCombinedListViewController</string> <string>com.apple.donotdisturb.control-center.module</string> <string>com.apple.springboard.donotdisturb.notifications</string> <string>com.apple.springboard.donotdisturb.awdmetrics</string> <string>com.apple.springboard.dashboard.bedtime</string> <string>com.apple.accessibility.visual.alerts</string> </array> <key>com.apple.private.donotdisturb.state.updates.client-identifiers</key> <array> <string>com.apple.springboard.SBStatusBarStateAggregator</string> <string>com.apple.springboard.SBDashBoardCombinedListViewController</string> <string>com.apple.donotdisturb.control-center.module</string> <string>com.apple.springboard.donotdisturb.notifications</string> <string>com.apple.springboard.donotdisturb.awdmetrics</string> <string>com.apple.springboard.dashboard.bedtime</string> <string>com.apple.accessibility.visual.alerts</string> </array> <key>com.apple.private.externalaccessory.showallaccessories</key> <true/> <key>com.apple.private.game-center</key> <array> <string>Account</string> <string>Games</string> </array> <key>com.apple.private.game-center.bypass-authentication</key> <true/> <key>com.apple.private.healthkit</key> <true/> <key>com.apple.private.healthkit.read_authorization_override</key> <array> <string>HKCategoryTypeIdentifierSleepAnalysis</string> </array> <key>com.apple.private.healthkit.source_override</key> <string>com.apple.mobiletimer</string> <key>com.apple.private.healthkit.write_authorization_override</key> <array> <string>HKCategoryTypeIdentifierSleepAnalysis</string> </array> <key>com.apple.private.hid.client.event-dispatch</key> <true/> <key>com.apple.private.hid.client.service-protected</key> <true/> <key>com.apple.private.hid.manager.client</key> <true/> <key>com.apple.private.homekit</key> <true/> <key>com.apple.private.icfcallserver</key> <true/> <key>com.apple.private.ids.idsquery</key> <true/> <key>com.apple.private.ids.messaging</key> <array> <string>com.apple.private.alloy.bulletinboard</string> <string>com.apple.private.alloy.donotdisturb</string> <string>com.apple.madrid</string> <string>com.apple.private.alloy.siri.phrasespotter</string> </array> <key>com.apple.private.ids.messaging.urgent-priority</key> <array> <string>com.apple.private.alloy.bulletinboard</string> <string>com.apple.private.alloy.donotdisturb</string> <string>com.apple.private.alloy.siri.phrasespotter</string> </array> <key>com.apple.private.ids.registration-reset</key> <true/> <key>com.apple.private.imavcore.imavagent</key> <true/> <key>com.apple.private.imcore.imdpersistence.database-access</key> <true/> <key>com.apple.private.imcore.imremoteurlconnection</key> <true/> <key>com.apple.private.imcore.spi.database-access</key> <true/> <key>com.apple.private.in-app-payments</key> <true/> <key>com.apple.private.iokit.powersource-control</key> <true/> <key>com.apple.private.kernel.darkboot</key> <true/> <key>com.apple.private.kernel.jetsam</key> <true/> <key>com.apple.private.librarian.can-get-application-info</key> <true/> <key>com.apple.private.lockdown.finegrained-get</key> <array> <string>NULL/ActivationState</string> <string>NULL/BrickState</string> <string>NULL/SBLockdownEverRegisteredKey</string> <string>com.apple.xcode.developerdomain/DeveloperStatus</string> <string>NULL/BuildExpireTime</string> </array> <key>com.apple.private.lockdown.finegrained-remove</key> <array> <string>com.apple.mobile.iTunes.store/AppleID</string> <string>com.apple.mobile.data_sync/Contacts</string> <string>com.apple.mobile.data_sync/Calendars</string> <string>com.apple.mobile.data_sync/Bookmarks</string> <string>com.apple.mobile.data_sync/Mail Accounts</string> </array> <key>com.apple.private.mis.online_auth_agent</key> <true/> <key>com.apple.private.mobileinstall.allowedSPI</key> <array> <string>UninstallForLaunchServices</string> <string>SetCapabilities</string> <string>Lookup</string> </array> <key>com.apple.private.mobilesafari.searchengine</key> <true/> <key>com.apple.private.mobilestoredemo.enabledemo</key> <array> <string>Manage</string> </array> <key>com.apple.private.mobiletimerd</key> <true/> <key>com.apple.private.network.socket-delegate</key> <true/> <key>com.apple.private.networkextension.configuration</key> <true/> <key>com.apple.private.persona.read</key> <true/> <key>com.apple.private.photos.service.demo</key> <true/> <key>com.apple.private.replay-kit</key> <true/> <key>com.apple.private.screen-time</key> <true/> <key>com.apple.private.security.container-manager</key> <true/> <key>com.apple.private.security.storage.Photos</key> <true/> <key>com.apple.private.suggestions.contacts</key> <true/> <key>com.apple.private.suggestions.events</key> <true/> <key>com.apple.private.system-keychain</key> <true/> <key>com.apple.private.tcc.allow</key> <array> <string>kTCCServiceAddressBook</string> <string>kTCCServiceCalendar</string> <string>kTCCServiceReminders</string> <string>kTCCServicePhotos</string> <string>kTCCServicePhotosAdd</string> <string>kTCCServiceMediaLibrary</string> <string>kTCCServiceMicrophone</string> <string>kTCCServiceCamera</string> <string>kTCCServiceWillow</string> <string>kTCCServiceFaceID</string> </array> <key>com.apple.private.tcc.manager</key> <true/> <key>com.apple.private.tty.settings</key> <true/> <key>com.apple.private.ubiquity-kvstore-access</key> <array> <string>com.apple.weather</string> <string>com.apple.stocks</string> <string>com.apple.backboardd</string> <string>com.apple.Accessibility</string> <string>com.apple.Accessibility.SwitchControl</string> <string>com.apple.Accessibility.TouchAccommodations</string> <string>com.apple.AssistiveTouch</string> <string>com.apple.HearingAids</string> <string>com.apple.SpeakSelection</string> <string>com.apple.VoiceOverTouch</string> <string>com.apple.ZoomTouch</string> </array> <key>com.apple.private.usernotifications.bundle-identifiers</key> <array> <string>com.apple.donotdisturb</string> <string>com.apple.mobiletimer</string> <string>com.apple.usernotifications.example</string> </array> <key>com.apple.private.vfs.open-by-id</key> <true/> <key>com.apple.private.xpc.launchd.app-server</key> <true/> <key>com.apple.proactive.ActionPrediction.predictions</key> <true/> <key>com.apple.proactive.AppPrediction.predictions</key> <true/> <key>com.apple.purplebuddy.budd.access</key> <true/> <key>com.apple.remotenotification.access</key> <true/> <key>com.apple.remotenotification.preferences</key> <true/> <key>com.apple.rootless.storage.proactivepredictions</key> <true/> <key>com.apple.runningboard.hereditarygrantoriginator</key> <true/> <key>com.apple.runningboard.primitiveattribute</key> <true/> <key>com.apple.runningboard.process-state</key> <true/> <key>com.apple.runningboard.request.identity</key> <true/> <key>com.apple.runningboard.terminatemanagedprocesses</key> <true/> <key>com.apple.runningboard.underlyingassertion</key> <true/> <key>com.apple.securebackupd.access</key> <true/> <key>com.apple.security.application-groups</key> <array> <string>group.com.apple.weather</string> <string>group.com.apple.stocks</string> </array> <key>com.apple.security.enterprise-volume-access</key> <true/> <key>com.apple.security.exception.mach-lookup.global-name</key> <array> <string>com.apple.siri.activation.service</string> <string>com.apple.springboard.SBRendererService</string> <string>com.apple.appstored.xpc</string> <string>com.apple.appstored.xpc.request</string> </array> <key>com.apple.security.system-container</key> <true/> <key>com.apple.security.system-groups</key> <array> <string>systemgroup.com.apple.sharedpclogging</string> <string>systemgroup.com.apple.regulatory_images</string> </array> <key>com.apple.sharing.Client</key> <true/> <key>com.apple.sharing.CoordinatedAlerts</key> <true/> <key>com.apple.sharing.Diagnostics</key> <true/> <key>com.apple.sharing.Session</key> <true/> <key>com.apple.siri.VoiceShortcuts.xpc</key> <true/> <key>com.apple.siri.activation.service</key> <true/> <key>com.apple.siri.client_lite</key> <true/> <key>com.apple.siri.external_request</key> <true/> <key>com.apple.sos.trigger</key> <true/> <key>com.apple.springboard-ui.client</key> <true/> <key>com.apple.springboard.activateRemoteAlert</key> <true/> <key>com.apple.springboard.activateawayviewplugins</key> <true/> <key>com.apple.springboard.allowallcallurls</key> <true/> <key>com.apple.springboard.application-removability.proxy</key> <true/> <key>com.apple.springboard.lockScreenContentAssertion</key> <true/> <key>com.apple.springboard.multiwindow.triggerShowAllWindows</key> <true/> <key>com.apple.springboard.opensensitiveurl</key> <true/> <key>com.apple.springboard.openurlswhenlocked</key> <true/> <key>com.apple.springboard.setbadgestring</key> <true/> <key>com.apple.springboard.shortcutitems.fullaccess</key> <true/> <key>com.apple.springboard.statusbarstyleoverrides</key> <true/> <key>com.apple.springboard.statusbarstyleoverrides.coordinator</key> <array> <string>UIStatusBarStyleOverrideAutoAirPlayReady</string> <string>UIStatusBarStyleOverrideAutoAirPlayPlaying</string> </array> <key>com.apple.symptom_analytics.query</key> <true/> <key>com.apple.symptom_analytics.refresh</key> <true/> <key>com.apple.symptoms.NetworkOfInterest</key> <true/> <key>com.apple.telephonyutilities.callservicesd</key> <array> <string>access-calls</string> <string>modify-calls</string> <string>access-call-providers</string> <string>access-moments</string> </array> <key>com.apple.timed</key> <true/> <key>com.apple.tzlink.allow</key> <true/> <key>com.apple.ui-services-discovery</key> <true/> <key>com.apple.videoconference.allow-conferencing</key> <true/> <key>com.apple.visualvoicemail.client</key> <true/> <key>com.apple.voiceservices.tts.customvoice</key> <true/> <key>com.apple.voicetrigger.voicetriggerservice</key> <true/> <key>com.apple.watchlist.private</key> <true/> <key>com.apple.wifi.manager-access</key> <true/> <key>com.apple.wipedevice</key> <true/> <key>fairplay-client</key> <string>1172857363</string> <key>keychain-access-groups</key> <array> <string>apple</string> <string>com.apple.preferences</string> </array> <key>vm-pressure-level</key> <true/> </dict> </plist>
|
可以看到,包含的权限非常多,苹果并没有给出这些权限的说明,通常我们直接用就行了,这里有一篇文章做一些整理iOS Entitlement分析
1. 导出默认iOS应用程序的权限文件
新建一个iOS工程,开启推送和Sign With Apple
,编译,得到xxx.app
,拿到可执行文件xxx
,使用ldid
导出得到
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
| <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>aps-environment</key> <string>development</string> <key>com.apple.developer.applesignin</key> <array> <string>Default</string> </array> <key>com.apple.developer.team-identifier</key> <string>9PCJKE8K5A</string> <key>get-task-allow</key> <true/> </dict> </plist>
|
其中get-task-allow
为允许其他进程(如调试器)附加到您的应用程序。我们自己编译的App可以进行调试,而商店下载的App没有该选项
相比之下,默认的App权限少得可怜,我们可以吧SpringBoard的权限SpringBoard.entitlement
签名到我们的程序XXX
中,这样就可以有更多的操作权限了,例如访问沙盒外的路径
1
| ldid -SSpringBoard.entitlement XXX
|
引用