<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
 
 <title>rusty shutter</title>
 <link href="http://lhzhang.com/atom.xml" rel="self"/>
 <link href="http://lhzhang.com"/>
 <updated>2021-12-22T13:07:18+00:00</updated>
 <id>http://lhzhang.com/</id>
 <author>
   <name>wayne</name>
 </author>

 
 <entry>
   <title>2021</title>
   <link href="http://lhzhang.com/2021/12/22/2021.html"/>
   <updated>2021-12-22T00:00:00+00:00</updated>
   <id>urn:uuid:d79832ae-e7b6-4ce0-956e-470b8f6e4e51</id>
   <content type="html">&lt;p&gt;&lt;img src=&quot;/media/files/2021/12/22/baseball.jpg&quot; alt=&quot;baseball&quot; /&gt;&lt;/p&gt;

&lt;p&gt;本来想出了所有胶片机器，结果不小心遇到了心仪的 Rolleiflex。&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>在 macOS App Store 外发布 app</title>
   <link href="http://lhzhang.com/2021/05/21/distribute-app-outside-the-mac-app-store.html"/>
   <updated>2021-05-21T00:00:00+00:00</updated>
   <id>urn:uuid:5ffc76b5-af15-4f9c-a237-74d5f9fb7212</id>
   <content type="html">&lt;p&gt;这些天离职交接，于是趁着无聊把之前做的 app (&lt;a href=&quot;https://osara.lhzhang.com&quot;&gt;Osara&lt;/a&gt;) 整理了一下&lt;a href=&quot;https://www.producthunt.com/posts/osara&quot;&gt;发了出来&lt;/a&gt;。因为用了 Accessibility API 所以只能在 App Store 外发布，踩了些坑，随手整理了一下。&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;
    &lt;p&gt;&lt;a href=&quot;https://help.apple.com/xcode/mac/current/#/dev033e997ca&quot;&gt;生成 Binary&lt;/a&gt;&lt;/p&gt;

    &lt;ul&gt;
      &lt;li&gt;用 &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Developer ID&lt;/code&gt; 证书签名&lt;/li&gt;
      &lt;li&gt;Archive&lt;/li&gt;
    &lt;/ul&gt;

    &lt;div class=&quot;language-sh highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt; &lt;span class=&quot;nv&quot;&gt;DERIVED_FILES_DIR&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;$(&lt;/span&gt;xcodebuild &lt;span class=&quot;nt&quot;&gt;-showBuildSettings&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-scheme&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;Scheme] &lt;span class=&quot;nt&quot;&gt;-project&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;Xcode Project] | &lt;span class=&quot;nb&quot;&gt;grep &lt;/span&gt;DERIVED_FILES_DIR | &lt;span class=&quot;nb&quot;&gt;sed&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'s/.*=\ *//g'&lt;/span&gt;&lt;span class=&quot;si&quot;&gt;)&lt;/span&gt;
 xcodebuild &lt;span class=&quot;nt&quot;&gt;-scheme&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;Scheme] &lt;span class=&quot;nt&quot;&gt;-project&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;Xcode Project File] &lt;span class=&quot;nt&quot;&gt;-configuration&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;Release &lt;span class=&quot;nt&quot;&gt;-derivedDataPath&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;${&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;DERIVED_FILES_DIR&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;}&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-archivePath&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;${&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;ARCHIVE_PATH&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;}&lt;/span&gt; archive&lt;span class=&quot;sb&quot;&gt;`&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;    &lt;/div&gt;

    &lt;ul&gt;
      &lt;li&gt;导出 Archive&lt;/li&gt;
    &lt;/ul&gt;

    &lt;div class=&quot;language-sh highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt; xcodebuild &lt;span class=&quot;nt&quot;&gt;-exportArchive&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-archivePath&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;Archive Path] &lt;span class=&quot;nt&quot;&gt;-exportPath&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;Export Path] &lt;span class=&quot;nt&quot;&gt;-exportOptionsPlist&lt;/span&gt; ExportOptions.plist
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;    &lt;/div&gt;

    &lt;p&gt;这步需要一个 &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;ExportOptions.plist&lt;/code&gt;，介绍这个文件怎么写的文章不多，不过没关系，手动从 Xcode 导出时 Xcode 会为我们生成这个文件，以后命令行复用就可以了。&lt;/p&gt;

    &lt;ul&gt;
      &lt;li&gt;nortize&lt;/li&gt;
    &lt;/ul&gt;

    &lt;p&gt;nortize 的原理是上传 Apple 服务器，Apple 确认这个 build 没有问题时会发行一个 ticket。在第一次打开这个 app 时，Gatekeeper 会去 Apple 服务器验证这个 ticket，如果没有问题就不会弹警告。&lt;/p&gt;

    &lt;blockquote&gt;
      &lt;p&gt;A notarized app is a macOS app that was uploaded to Apple for processing before it was distributed. When you export a notarized app from Xcode, it code signs the app with a Developer ID certificate and staples a ticket from Apple to the app. The ticket confirms that you previously uploaded the app to Apple.&lt;/p&gt;
    &lt;/blockquote&gt;

    &lt;p&gt;这个步骤可以通过 &lt;a href=&quot;https://github.com/akeru-inc/xcnotary&quot;&gt;xcnotary&lt;/a&gt; 自动化。&lt;/p&gt;

    &lt;div class=&quot;language-shell highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt; xcnotary notarize &amp;lt;input path&amp;gt; &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
   &lt;span class=&quot;nt&quot;&gt;--developer-account&lt;/span&gt; &amp;lt;Apple Developer account&amp;gt; &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
   &lt;span class=&quot;nt&quot;&gt;--developer-password-keychain-item&lt;/span&gt; &amp;lt;name of keychain item, see below&amp;gt; &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
   &lt;span class=&quot;o&quot;&gt;[&lt;/span&gt;&lt;span class=&quot;nt&quot;&gt;--provider&lt;/span&gt; &amp;lt;provider short name&amp;gt;]
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;    &lt;/div&gt;

    &lt;p&gt;&lt;em&gt;nortize 需要 app &lt;a href=&quot;https://help.apple.com/xcode/mac/current/#/devf87a2ac8f&quot;&gt;打开&lt;/a&gt; &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Hardened Runtime&lt;/code&gt;，这个可以在 &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;Signing &amp;amp; Capabilities&lt;/code&gt; 打开。&lt;/em&gt;&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;分发 Binary (&lt;a href=&quot;https://appcenter.ms&quot;&gt;AppCenter&lt;/a&gt;)&lt;/p&gt;

    &lt;p&gt;AppCenter 可以支持 macOS app 的 analytics，crash log 收集，同时还可以 host app 的 binary，更赞的是提供了 Sparkle 的支持。然而官方的命令行客户端还在使用老的 binary 上传 api（WTF？），想要自动上传可以参考 &lt;a href=&quot;https://gist.github.com/waynezhang/5a597b1cb883c8324462efed31edaf7e&quot;&gt;gist&lt;/a&gt;。&lt;/p&gt;
  &lt;/li&gt;
  &lt;li&gt;
    &lt;p&gt;Auto Update&lt;/p&gt;

    &lt;p&gt;AppCenter 提供了 Sparkle 的支持，但是并不会为 binary 自动生成 &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;edSignuature&lt;/code&gt;，而如果没有 &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;edSignature&lt;/code&gt; 的话 Sparkle 则不会承认这个 binray。好在 AppCenter 提供了 api 来更新这个签名。&lt;/p&gt;

    &lt;div class=&quot;language-shell highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt; curl &lt;span class=&quot;nt&quot;&gt;-X&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;PATCH&quot;&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;https://api.appcenter.ms/v0.1/apps/&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;${&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;APP&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;/releases/&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;${&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;RELEASE_ID&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;}&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt; &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;-H&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;X-API-Token: &lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$TOKEN&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt; &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;-H&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'Content-Type: application/json; charset=utf-8'&lt;/span&gt; &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
  &lt;span class=&quot;nt&quot;&gt;-d&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;$&quot;{
         &lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\&quot;&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;metadata&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\&quot;&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;: {
         &lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\&quot;&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;ed_signature&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\&quot;&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;: &lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\&quot;&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$SIGNATURE&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\&quot;&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;
       }
 }&quot;&lt;/span&gt;
    
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;    &lt;/div&gt;

    &lt;p&gt;这个 signature 可以利用 Sparkle 提供的 &lt;code class=&quot;language-plaintext highlighter-rouge&quot;&gt;sign_update&lt;/code&gt; 生成。完整 script 可参考 &lt;a href=&quot;https://gist.github.com/waynezhang/2dee342f2d5a213119a9e7f07b678948&quot;&gt;gist&lt;/a&gt;。&lt;/p&gt;
  &lt;/li&gt;
&lt;/ol&gt;
</content>
 </entry>
 
 <entry>
   <title>拧到头摄影师</title>
   <link href="http://lhzhang.com/2019/03/08/it-is-all-about-timing.html"/>
   <updated>2019-03-08T00:00:00+00:00</updated>
   <id>urn:uuid:80599c6f-70ee-44f0-8e34-9eb7ed776fce</id>
   <content type="html">&lt;p&gt;&lt;img src=&quot;/media/files/2019/03/08/daocheng.jpg&quot; alt=&quot;dao cheng&quot; /&gt;&lt;/p&gt;

&lt;p&gt;终于有力气把堆积的底片一口气扫出来了，断断续续拍了几年，一点儿进步都看不到（摊手&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>2017</title>
   <link href="http://lhzhang.com/2017/12/31/i-has-been-so-long.html"/>
   <updated>2017-12-31T00:00:00+00:00</updated>
   <id>urn:uuid:639f1246-586e-4626-80bf-b5d8938e369c</id>
   <content type="html">&lt;p&gt;&lt;img src=&quot;/media/files/2017/12/31/pink-floyd.jpg&quot; alt=&quot;Pink Floyd&quot; /&gt;&lt;/p&gt;

&lt;p&gt;2017 最开心的莫过于看到了 Guns N’ Roses 和 Rogoer Waters 的 live，Led Zeppelin 这辈子怕是看不到了&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>2015</title>
   <link href="http://lhzhang.com/2015/12/31/it-just-begins.html"/>
   <updated>2015-12-31T00:00:00+00:00</updated>
   <id>urn:uuid:de8d598d-6f35-4c7b-ab23-1951062dadfc</id>
   <content type="html">&lt;p&gt;&lt;a href=&quot;https://www.flickr.com/photos/lhzhang/23999442826/in/dateposted-public/&quot;&gt;&lt;img src=&quot;/media/files/2015/12/31/shadow.jpg&quot; alt=&quot;Shadow&quot; /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;完成了读书计划，最爱「1984」&lt;/li&gt;
  &lt;li&gt;去成都吃了火锅，陪家人去了香格里拉，在眉山顶看了 supermoon&lt;/li&gt;
  &lt;li&gt;换了份新工作，有些后悔，早换就好了&lt;/li&gt;
  &lt;li&gt;克服了拖延症，在零点前发了此文&lt;/li&gt;
&lt;/ul&gt;
</content>
 </entry>
 
 <entry>
   <title>Fresh Start</title>
   <link href="http://lhzhang.com/2015/10/15/m-always-waiting.html"/>
   <updated>2015-10-15T00:00:00+00:00</updated>
   <id>urn:uuid:7ee46d88-b3ce-4f1f-bde0-2c753c6f926f</id>
   <content type="html">&lt;p&gt;&lt;img src=&quot;/media/files/2015/10/15/shangrila.jpg&quot; alt=&quot;Shangri-La&quot; /&gt;&lt;/p&gt;

&lt;p&gt;辞掉了做了十年的公司，放松一下下个月一切都要重头开始 @香格里拉&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Tree</title>
   <link href="http://lhzhang.com/2015/05/14/do-no-cry-because-it-ended-smile-because-it-happended.html"/>
   <updated>2015-05-14T00:00:00+00:00</updated>
   <id>urn:uuid:52844cd3-de95-411e-83f1-4e4051ce0c7d</id>
   <content type="html">&lt;p&gt;&lt;a href=&quot;https://www.flickr.com/photos/lhzhang/17601296422/&quot;&gt;&lt;img src=&quot;/media/files/2015/05/14/tree.jpg&quot; alt=&quot;&quot; /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;实在是很喜欢这张底片的样子，就省去了反色的步骤。&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>Fishing</title>
   <link href="http://lhzhang.com/2015/04/14/so-the-decision-has-been-made.html"/>
   <updated>2015-04-14T00:00:00+00:00</updated>
   <id>urn:uuid:9a45410a-47a1-45f9-bd9c-f6e3b97651e2</id>
   <content type="html">&lt;p&gt;&lt;a href=&quot;https://www.flickr.com/photos/lhzhang/16435428423/&quot;&gt;&lt;img src=&quot;/media/files/2015/04/14/fishing.jpg&quot; alt=&quot;&quot; /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;爬过两次富士山，但是从山下远眺这么多年还是头一次，可惜雾有些重。&lt;/p&gt;

&lt;hr /&gt;

&lt;p&gt;耳机离家出走，所以今年的生日除了新的三脚架又有了新的耳机。祝走掉的那条幸福吧。&lt;br /&gt;
删照片比起烧照片的仪式感真是差太多了。&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>untitled</title>
   <link href="http://lhzhang.com/2015/03/02/na.html"/>
   <updated>2015-03-02T00:00:00+00:00</updated>
   <id>urn:uuid:050de99c-7597-49a3-9281-9ca84fccbb5b</id>
   <content type="html">&lt;p&gt;&lt;a href=&quot;https://www.flickr.com/photos/lhzhang/16134724228/&quot;&gt;&lt;img src=&quot;/media/files/2015/03/01/pic.jpg&quot; alt=&quot;&quot; /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;取名真是件麻烦的事情&lt;/p&gt;
</content>
 </entry>
 
 <entry>
   <title>羊卓雍措</title>
   <link href="http://lhzhang.com/2014/12/18/gonna-get-out-of-comfort-zone.html"/>
   <updated>2014-12-18T00:00:00+00:00</updated>
   <id>urn:uuid:af62c8d3-84d7-4c48-bb29-4fef13220ff1</id>
   <content type="html">&lt;p&gt;&lt;a href=&quot;https://www.flickr.com/photos/lhzhang/15858965898/&quot;&gt;&lt;img src=&quot;/media/files/2014/12/18/yamdroktso.jpg&quot; alt=&quot;YamdrokTso&quot; /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;大家都是出去旅行放松一下好继续努力工作，我则是相反，旅行回来就更不想上班了 = =&lt;br /&gt;
不小心弄没了几乎全部 120 的底片，难过了一阵子还是端正了心态，旅行重要的是阅历不是拍照啊（虽然还是很难过&lt;br /&gt;
anyway，我也算是在喜马拉雅上丢过手机的人了&lt;/p&gt;

&lt;hr /&gt;

&lt;p&gt;很多年都没有做过年终总结了，今年好像也没啥好总结的，&lt;em&gt;NOTHING BAD, NOTHING GOOD&lt;/em&gt;&lt;/p&gt;
</content>
 </entry>
 
 
</feed>
