Skip to content

Commit

Permalink
feat(ios): ability to grant paste from external apps
Browse files Browse the repository at this point in the history
  • Loading branch information
vfadc committed Nov 29, 2024
1 parent 8b5087f commit e770f89
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ enum class GrantLifecycle {
* @property Motion Allow access to motion and fitness data
* @property Reminders Allow access to reminders
* @property Siri Allow use of the app with Siri
* @property UserTracking Allow user tracking
* @property Pasteboard Allow paste from external apps
*/
enum class Permission(val value: String) {
@JsonProperty("all") All("all"),
Expand All @@ -44,4 +46,5 @@ enum class Permission(val value: String) {

//Non-simctl grant permissions
@JsonProperty("user-tracking") UserTracking("kTCCServiceUserTracking"),
@JsonProperty("pasteboard") Pasteboard("kTCCServicePasteboard"),
}
1 change: 1 addition & 0 deletions docs/runner/apple/configure/ios.md
Original file line number Diff line number Diff line change
Expand Up @@ -472,6 +472,7 @@ permissions:
| reminders | Allow access to reminders |
| siri | Allow use of the app with Siri |
| user-tracking | Allow user tracking |
| pasteboard | Allow paste from external apps |

<Tabs>
<TabItem value="before-test-run" label="Before test run">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -412,6 +412,7 @@ permissions:
| reminders | Allow access to reminders |
| siri | Allow use of the app with Siri |
| user-tracking | Allow user tracking |
| pasteboard | Allow paste from external apps |

<Tabs>
<TabItem value="before-test-run" label="Before test run">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -416,6 +416,7 @@ permissions:
| reminders | Allow access to reminders |
| siri | Allow use of the app with Siri |
| user-tracking | Allow user tracking |
| pasteboard | Allow paste from external apps |

<Tabs>
<TabItem value="before-test-run" label="Before test run">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -810,8 +810,8 @@ supportsTranscoding,

suspend fun grant(permission: Permission, bundleId: String): Boolean {
return when (permission) {
Permission.UserTracking -> {
//This might fail on different versions of iOS runtime. Tested on 17.2
Permission.UserTracking, Permission.Pasteboard -> {
//This might fail on different versions of iOS runtime. Tested on 17.2, 18.1
val query =
"replace into access (service, client, client_type, auth_value, auth_reason, auth_version, flags) values ('${permission.value}','$bundleId',0,2,2,1,0);"
binaryEnvironment.sqlite3.query(
Expand Down

0 comments on commit e770f89

Please sign in to comment.