Hardened runtime for Java and Mojave

后端 未结 3 1825
星月不相逢
星月不相逢 2021-01-02 03:18

I currently distribute a Java application, packaged and signed using pkgbuild on macOS.

Recently, Apple warns developers:

\"In an upcoming rel

3条回答
  •  独厮守ぢ
    2021-01-02 03:39

    Here is a simple shell script that will codesign the .so, .dylib and .jnilib within a jar file

    usage: codesign_jar_script.sh filename.jar

    jar tf $1 | grep '\.so\|\.dylib\|\.jnilib'  > filelist.txt
    
    IDENTITY="your_signing_identity"
    
    echo $IDENTITY
    
    while read f
    do
        jar xf $1 $f
        codesign --force -s "$IDENTITY" -v $f
        jar uf $1 $f
        rm -rf $f
    done < filelist.txt
    

提交回复
热议问题