Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
skiko
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
liuqiang
skiko
Commits
30185cb7
Unverified
Commit
30185cb7
authored
Oct 01, 2021
by
Nikolay Igotti
Committed by
GitHub
Oct 01, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use codesign tool instead of curl (#229)
parent
524b0ad1
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
31 additions
and
2 deletions
+31
-2
build.gradle.kts
skiko/build.gradle.kts
+31
-2
codesign-client-darwin-x64
skiko/tools/codesign-client-darwin-x64
+0
-0
No files found.
skiko/build.gradle.kts
View file @
30185cb7
...
...
@@ -527,7 +527,7 @@ fun sealBinary(sealer: String, lib: File) {
}
fun
remoteSign
(
signHost
:
String
,
lib
:
File
,
out
:
File
)
{
fun
remoteSign
Curl
(
signHost
:
String
,
lib
:
File
,
out
:
File
)
{
println
(
"Remote signing $lib on $signHost"
)
val
user
=
skiko
.
signUser
?:
error
(
"signUser is null"
)
val
token
=
skiko
.
signToken
?:
error
(
"signToken is null"
)
...
...
@@ -559,6 +559,35 @@ fun remoteSign(signHost: String, lib: File, out: File) {
}
}
fun
remoteSignCodesign
(
signHost
:
String
,
lib
:
File
,
out
:
File
)
{
val
user
=
skiko
.
signUser
?:
error
(
"signUser is null"
)
val
token
=
skiko
.
signToken
?:
error
(
"signToken is null"
)
val
cmd
=
"""
SERVICE_ACCOUNT_TOKEN=$token SERVICE_ACCOUNT_NAME=$user \
$projectDir/tools/codesign-client-darwin-x64 ${lib.absolutePath} && \
cp ${lib.absolutePath} ${out.absolutePath}
"""
val
proc
=
ProcessBuilder
(
"bash"
,
"-c"
,
cmd
)
.
redirectOutput
(
ProcessBuilder
.
Redirect
.
PIPE
)
.
redirectError
(
ProcessBuilder
.
Redirect
.
PIPE
)
.
start
()
proc
.
waitFor
(
5
,
TimeUnit
.
MINUTES
)
if
(
proc
.
exitValue
()
!=
0
)
{
val
out
=
proc
.
inputStream
.
bufferedReader
().
readText
()
val
err
=
proc
.
errorStream
.
bufferedReader
().
readText
()
println
(
out
)
println
(
err
)
throw
GradleException
(
"Cannot sign $lib: $err"
)
}
else
{
val
outSize
=
out
.
length
()
if
(
outSize
<
200
*
1024
)
{
val
content
=
out
.
readText
()
println
(
content
)
throw
GradleException
(
"Output is too short $outSize: ${content.take(200)}..."
)
}
}
}
tasks
.
withType
(
LinkSharedLibrary
::
class
.
java
).
configureEach
{
when
(
targetOs
)
{
OS
.
MacOS
->
{
...
...
@@ -689,7 +718,7 @@ val maybeSign by project.tasks.registering {
sealBinary
(
sealer
,
lib
)
}
if
(
skiko
.
signHost
!=
null
)
{
remoteSign
(
skiko
.
signHost
!!
,
lib
,
output
)
remoteSign
Codesign
(
skiko
.
signHost
!!
,
lib
,
output
)
}
else
{
lib
.
copyTo
(
output
,
overwrite
=
true
)
}
...
...
skiko/tools/codesign-client-darwin-x64
0 → 100755
View file @
30185cb7
File added
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment