<?xml version="1.0"?>
<rdf:RDF
	xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:foaf="http://xmlns.com/foaf/0.1/"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns="http://purl.org/rss/1.0/"
>
<channel rdf:about="http://planet.videolan.org/">
	<title>Planet VideoLAN</title>
	<link>http://planet.videolan.org/</link>
	<description>Planet VideoLAN - http://planet.videolan.org/</description>

	<items>
		<rdf:Seq>
			<rdf:li rdf:resource="https://geoffreymetais.github.io/features/vlc-25" />
			<rdf:li rdf:resource="tag:blog.duraffort.fr,2017-07-25:/post/2017/07/25/Using-requests-with-xmlrpc/" />
			<rdf:li rdf:resource="https://geoffreymetais.github.io/code/key-signing" />
			<rdf:li rdf:resource="tag:blog.duraffort.fr,2017-05-05:/post/2017/05/05/A-common-mistake-with-jinja2/" />
		</rdf:Seq>
	</items>
</channel>

<item rdf:about="https://geoffreymetais.github.io/features/vlc-25">
	<title>Geoffrey Métais: Announcing VLC 2.5 release!</title>
	<link>https://geoffreymetais.github.io/features/vlc-25/</link>
	<content:encoded>&lt;p&gt;VLC is back on Play Store! Version 2.0 is more than 1 year old and will leave room for 2.5 which brings very interesting evolutions!
&lt;!--summary--&gt;&lt;/p&gt;

&lt;p&gt;VLC for Android releases have been trapped in VLC 3.0 preparation and big media library refactoring black holes.
So, there hasn’t been any update for 13 months, but development is still active and cool new stuff is coming!&lt;/p&gt;

&lt;p&gt;This post will focus on features, implementations will be detailed in other blog posts (like the &lt;a href=&quot;https://geoffreymetais.github.io/code/diffutil/&quot;&gt;DiffUtil&lt;/a&gt; intro).&lt;/p&gt;



    &lt;h4 class=&quot;nav__title&quot;&gt;&lt;i class=&quot;fa fa-gears&quot;&gt;&lt;/i&gt; Incoming features&lt;/h4&gt;
&lt;ul class=&quot;toc__menu&quot; id=&quot;markdown-toc&quot;&gt;
  &lt;li&gt;&lt;a href=&quot;https://geoffreymetais.github.io/features/vlc-25/#ux-evolutions&quot; id=&quot;markdown-toc-ux-evolutions&quot;&gt;UX evolutions&lt;/a&gt;    &lt;ul&gt;
      &lt;li&gt;&lt;a href=&quot;https://geoffreymetais.github.io/features/vlc-25/#new-dynamic-ui&quot; id=&quot;markdown-toc-new-dynamic-ui&quot;&gt;New dynamic UI&lt;/a&gt;&lt;/li&gt;
      &lt;li&gt;&lt;a href=&quot;https://geoffreymetais.github.io/features/vlc-25/#new-audio-player-style&quot; id=&quot;markdown-toc-new-audio-player-style&quot;&gt;New Audio Player Style&lt;/a&gt;&lt;/li&gt;
      &lt;li&gt;&lt;a href=&quot;https://geoffreymetais.github.io/features/vlc-25/#picture-in-picture-mode&quot; id=&quot;markdown-toc-picture-in-picture-mode&quot;&gt;Picture-In-Picture mode&lt;/a&gt;&lt;/li&gt;
      &lt;li&gt;&lt;a href=&quot;https://geoffreymetais.github.io/features/vlc-25/#android-tv&quot; id=&quot;markdown-toc-android-tv&quot;&gt;Android TV&lt;/a&gt;&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://geoffreymetais.github.io/features/vlc-25/#android-auto&quot; id=&quot;markdown-toc-android-auto&quot;&gt;Android Auto&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://geoffreymetais.github.io/features/vlc-25/#chrome-os-support&quot; id=&quot;markdown-toc-chrome-os-support&quot;&gt;Chrome OS support&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://geoffreymetais.github.io/features/vlc-25/#360-videos-support&quot; id=&quot;markdown-toc-360-videos-support&quot;&gt;360° Videos support&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://geoffreymetais.github.io/features/vlc-25/#search&quot; id=&quot;markdown-toc-search&quot;&gt;Search&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://geoffreymetais.github.io/features/vlc-25/#miscellaneous-new-features&quot; id=&quot;markdown-toc-miscellaneous-new-features&quot;&gt;Miscellaneous new features&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://geoffreymetais.github.io/features/vlc-25/#under-the-hood&quot; id=&quot;markdown-toc-under-the-hood&quot;&gt;Under the hood&lt;/a&gt;    &lt;ul&gt;
      &lt;li&gt;&lt;a href=&quot;https://geoffreymetais.github.io/features/vlc-25/#medialibrary&quot; id=&quot;markdown-toc-medialibrary&quot;&gt;MediaLibrary&lt;/a&gt;&lt;/li&gt;
      &lt;li&gt;&lt;a href=&quot;https://geoffreymetais.github.io/features/vlc-25/#playback-performance--formats-support&quot; id=&quot;markdown-toc-playback-performance--formats-support&quot;&gt;Playback performance &amp;amp; formats support&lt;/a&gt;&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://geoffreymetais.github.io/features/vlc-25/#future&quot; id=&quot;markdown-toc-future&quot;&gt;Future&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

  


&lt;p&gt;For now, let me introduce you to the new VLC for Android.&lt;/p&gt;

&lt;p&gt;Minimum Android version is now &lt;strong&gt;Gingerbread&lt;/strong&gt;.&lt;br /&gt;
FroYo support has been abandonned, these devices cannot access Google Play Store anymore.&lt;/p&gt;

&lt;h1 id=&quot;ux-evolutions&quot;&gt;UX evolutions&lt;/h1&gt;

&lt;h2 id=&quot;new-dynamic-ui&quot;&gt;New dynamic UI&lt;/h2&gt;

&lt;p&gt;Video cards have been refactored, we now show you video details over its cover picture. This is a nicer presentation and gives room for displaying more videos at once.&lt;/p&gt;

&lt;p&gt;Audio lists have been slightly lifted too.
Others lists view have been reworked, like audio media, browsers and history. We got rid of cardview pattern, and got back to a more flat and clean design.&lt;/p&gt;

&lt;p&gt;You can now select multiple items at the same time, to start a playlist for example.&lt;/p&gt;

&lt;p&gt;Sort options have been spread to Audio and Browser sections.&lt;/p&gt;

&lt;p&gt;Info page has also been redesigned with a fancy collapse effect for thumbnail or cover.&lt;/p&gt;

&lt;p&gt;According to Material design principles, application has also become a bit more dynamic.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;https://geoffreymetais.github.io/assets/images/v2.5/video_sort.gif&quot; alt=&quot;video grid&quot; class=&quot;align-center&quot; /&gt;&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;https://geoffreymetais.github.io/assets/images/v2.5/dynamic_ui.gif&quot; alt=&quot;songs scrolling&quot; class=&quot;align-center&quot; /&gt;&lt;/p&gt;

&lt;h2 id=&quot;new-audio-player-style&quot;&gt;New Audio Player Style&lt;/h2&gt;

&lt;p&gt;Audio player background is now a blurred version of current art cover if available.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;https://geoffreymetais.github.io/assets/images/v2.5/player_list.png&quot; alt=&quot;player list&quot; /&gt;
&lt;img src=&quot;https://geoffreymetais.github.io/assets/images/v2.5/player_cover.png&quot; alt=&quot;player cover&quot; /&gt;&lt;/p&gt;

&lt;h2 id=&quot;picture-in-picture-mode&quot;&gt;Picture-In-Picture mode&lt;/h2&gt;

&lt;p&gt;VLC implements PiP support for Oreo devices and even Nougat Android TVs. You can activate it from video advanced options during playback.&lt;/p&gt;

&lt;p&gt;We also added an option to automatically continue video playback in PiP or background mode (audio only) while multitasking.&lt;br /&gt;
Go in VLC settings to activate it and video playback will switch to PiP when you’ll press HOME button.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;https://geoffreymetais.github.io/assets/images/v2.5/pip.png&quot; alt=&quot;player cover&quot; class=&quot;align-center&quot; /&gt;&lt;/p&gt;

&lt;h2 id=&quot;android-tv&quot;&gt;Android TV&lt;/h2&gt;

&lt;p&gt;TV interface had its own minor lifting too.
Background is filled with blurred covers and colors are warmer. Also I made long media titles scroll, I heard your (justified) frustration :)&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;https://geoffreymetais.github.io/assets/images/v2.5/tv_main.png&quot; alt=&quot;video grid&quot; class=&quot;align-center&quot; /&gt;&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;https://geoffreymetais.github.io/assets/images/v2.5/tv_music_player.png&quot; alt=&quot;audio player&quot; class=&quot;align-center&quot; /&gt;&lt;/p&gt;

&lt;h1 id=&quot;android-auto&quot;&gt;Android Auto&lt;/h1&gt;

&lt;p&gt;This release will bring Android Auto compatibility.&lt;br /&gt;
You’ll be able to use VLC as your travel music player with easy browsing into you audio library, with the minimum possible distraction from driving.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;https://geoffreymetais.github.io/assets/images/v2.5/auto_playing.png&quot; alt=&quot;auto player&quot; class=&quot;align-center&quot; /&gt;&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;https://geoffreymetais.github.io/assets/images/v2.5/auto_menu.png&quot; alt=&quot;auto menu&quot; class=&quot;align-center&quot; /&gt;&lt;/p&gt;

&lt;p&gt;VLC also supports voice actions on Android Auto:&lt;br /&gt;
You can ask “&lt;em&gt;play Daft Punk&lt;/em&gt; (with VLC)” and Google Assistant will recognize whether it’s an artist, an album or a song you’re asking for and command VLC to play it.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;https://geoffreymetais.github.io/assets/images/v2.5/auto_voice_landscape.gif&quot; alt=&quot;auto voice&quot; class=&quot;align-center&quot; /&gt;&lt;/p&gt;

&lt;h1 id=&quot;chrome-os-support&quot;&gt;Chrome OS support&lt;/h1&gt;

&lt;p&gt;VLC has been tested and adapted for latest Chrome OS running Android apps. You now have an awesome media application ready for your chromebook!&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;https://geoffreymetais.github.io/assets/images/v2.5/chromeos.png&quot; alt=&quot;Chrome OS&quot; class=&quot;align-center&quot; /&gt;&lt;/p&gt;

&lt;h1 id=&quot;360-videos-support&quot;&gt;360° Videos support&lt;/h1&gt;

&lt;p&gt;VLC now supports 360° videos, you can change viewpoint by swiping or with remote control arrows.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;https://geoffreymetais.github.io/assets/images/v2.5/360.png&quot; alt=&quot;video 360&quot; class=&quot;align-center&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Cardboard/VR mode is not available yet but we are working on it.&lt;/p&gt;

&lt;h1 id=&quot;search&quot;&gt;Search&lt;/h1&gt;

&lt;p&gt;Search has been split in two modes:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;First step, the text you type in triggers a &lt;strong&gt;filtering&lt;/strong&gt; in the current view. Exactly like in current playlist view.&lt;/li&gt;
  &lt;li&gt;If you want to do a global search, click on the &lt;code class=&quot;highlighter-rouge&quot;&gt;SEARCH IN ALL MEDIALIBRARY&lt;/code&gt; button to show the new search view. This will bring detailed results grouped by video/artist/album/songs/genres/playlist.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;img src=&quot;https://geoffreymetais.github.io/assets/images/v2.5/search.gif&quot; alt=&quot;search global&quot; class=&quot;align-center&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Bonus:
VLC is now compatible with voice search.&lt;br /&gt;
Asking Google Now &lt;em&gt;“Search Artic Monkeys in VLC”&lt;/em&gt; will trigger a &lt;em&gt;Arctic Monkeys&lt;/em&gt; search and show you this new search result screen.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;https://geoffreymetais.github.io/assets/images/v2.5/voice_search.gif&quot; alt=&quot;search voice&quot; class=&quot;align-center&quot; /&gt;&lt;/p&gt;

&lt;h1 id=&quot;miscellaneous-new-features&quot;&gt;Miscellaneous new features&lt;/h1&gt;

&lt;ul&gt;
  &lt;li&gt;DayNight mode integration&lt;/li&gt;
  &lt;li&gt;Audio boost in video&lt;/li&gt;
  &lt;li&gt;Equalizer custom presets&lt;/li&gt;
  &lt;li&gt;Save and resume position for podcasts &amp;amp; audiobooks&lt;/li&gt;
  &lt;li&gt;Restored double/long click on remote play to skip songs&lt;/li&gt;
  &lt;li&gt;Removed sound lowering on notification&lt;/li&gt;
  &lt;li&gt;Force previous song on audioplayer swipe&lt;/li&gt;
  &lt;li&gt;Fix audioplayer layout for black theme and RTL&lt;/li&gt;
  &lt;li&gt;Save subtitles delay and optionally audio delay for each file.&lt;/li&gt;
  &lt;li&gt;Support for devices with large aspect ratio, like G6 and S8 phones&lt;/li&gt;
&lt;/ul&gt;

&lt;h1 id=&quot;under-the-hood&quot;&gt;Under the hood&lt;/h1&gt;

&lt;h2 id=&quot;medialibrary&quot;&gt;MediaLibrary&lt;/h2&gt;

&lt;p&gt;That’s the most important change in this update, because it affects the whole application, but you should barely notice it…&lt;/p&gt;

&lt;p&gt;VLC now uses &lt;a href=&quot;https://code.videolan.org/videolan/medialibrary&quot;&gt;medialibrary&lt;/a&gt; like VLC for Tizen (other VLC ports will follow).&lt;br /&gt;
It’s a C++ library, written by &lt;a href=&quot;http://www.beauzee.fr/&quot;&gt;Hugo Beauzée-Luyssen&lt;/a&gt;, which parses storages for video/audio files and manages a sqlite database to model your media library (with album, artist, genre classification, etc..). It replaces the old system we had on Android which just saved media files with their metadata, we had no proper structure for media library.&lt;br /&gt;
Categories lists are now faster to show up, we don’t have to generate them at runtime. And this is all native code, which is faster than Java.&lt;br /&gt;
Beside this speed improvement, one of the main benefits of this medialibrary is to provide better &lt;a href=&quot;https://geoffreymetais.github.io/features/vlc-25/#search&quot;&gt;search results&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;For now we are focusing on the first scan performance to make it at least as fast as the previous system.&lt;/p&gt;

&lt;p&gt;So, this library is aimed to be a common module of all VLC ports, wich means all debugging, performance and any improvement will benefit other platforms.&lt;/p&gt;

&lt;p&gt;Next steps for this library will be media scrapping, and network scan:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Medialibrary will get information and illustrations for your media, so we’ll be able to present you a nice collection instead of an uncheerful files list. We will also group media by shows/seasons et genre/release year/whatever&lt;/li&gt;
  &lt;li&gt;You will be able to scan your NAS content to access your media easily.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This will make VLC a fully featured media center!&lt;/p&gt;

&lt;h2 id=&quot;playback-performance--formats-support&quot;&gt;Playback performance &amp;amp; formats support&lt;/h2&gt;

&lt;p&gt;VLC core team worked hard too to bring performance improvements and some new features. Here are some highlights:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;Adaptive (HLS/Dash) &amp;amp; TS playback improved&lt;/li&gt;
  &lt;li&gt;OpenGLES 2.0 is now used to render video (for software decoders &amp;amp; mediacodec)&lt;/li&gt;
  &lt;li&gt;Support for VP8/9/10 in MP4&lt;/li&gt;
  &lt;li&gt;HDMI passthrough&lt;/li&gt;
&lt;/ul&gt;

&lt;h1 id=&quot;future&quot;&gt;Future&lt;/h1&gt;

&lt;p&gt;We also plan to implement a feature to &lt;strong&gt;download media on your device&lt;/strong&gt;, in order to sync your series episodes or songs from your NAS to your device.&lt;/p&gt;

&lt;p&gt;We’d like to support videos playlists like we do with videos grouped by their common name prefix.&lt;/p&gt;

&lt;p&gt;As previously stated, medialibrary will help VLC to turn into a real &lt;strong&gt;media center&lt;/strong&gt; with fancy movies/tv shows presentation, and better artists/albums artworks.&lt;/p&gt;

&lt;p&gt;At last, I started an &lt;strong&gt;extension API&lt;/strong&gt; to help everyone eager to develop android applications that can provide content to VLC, and benefit from VLC Auto and TV implementation.
As a start, we will release (with sources of course) extensions for podcasts subscriptions and Google Drive access.&lt;/p&gt;</content:encoded>
	<dc:date>2017-10-02T00:00:00+00:00</dc:date>
</item>
<item rdf:about="tag:blog.duraffort.fr,2017-07-25:/post/2017/07/25/Using-requests-with-xmlrpc/">
	<title>Rémi Duraffort: Using requests with xmlrpc</title>
	<link>https://blog.duraffort.fr/post/2017/07/25/Using-requests-with-xmlrpc/</link>
	<content:encoded>&lt;p&gt;Using XML-RPC with Python3 is really simple. Calling &lt;strong&gt;system.version&lt;/strong&gt; on
&lt;strong&gt;http://localhost/RCP2&lt;/strong&gt; is as simple as:&lt;/p&gt;
&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;span class=&quot;kn&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;nn&quot;&gt;xmlrpc.client&lt;/span&gt;

&lt;span class=&quot;n&quot;&gt;proxy&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;xmlrpc&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;client&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;ServerProxy&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&amp;quot;http://localhost/RPC2&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;print&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;proxy&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;system&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;version&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;())&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;


&lt;p&gt;However, the default client is missing many features, like handling proxies.
Using requests for the underlying connection allows …&lt;/p&gt;</content:encoded>
	<dc:date>2017-07-25T08:33:00+00:00</dc:date>
</item>
<item rdf:about="https://geoffreymetais.github.io/code/key-signing">
	<title>Geoffrey Métais: Signing android releases with yubikey</title>
	<link>https://geoffreymetais.github.io/code/key-signing/</link>
	<content:encoded>&lt;p&gt;At VideoLAN, we recently changed our signing procedure to leverage our security keys.
As explained on &lt;a href=&quot;https://developers.yubico.com/PIV/Guides/Android_code_signing.html&quot;&gt;Yubico website&lt;/a&gt;, Android signing is quite easy.&lt;/p&gt;



    &lt;h4 class=&quot;nav__title&quot;&gt;&lt;i class=&quot;fa fa-gears&quot;&gt;&lt;/i&gt; On This Page&lt;/h4&gt;
&lt;ul class=&quot;toc__menu&quot; id=&quot;markdown-toc&quot;&gt;
  &lt;li&gt;&lt;a href=&quot;https://geoffreymetais.github.io/code/key-signing/#setup&quot; id=&quot;markdown-toc-setup&quot;&gt;Setup&lt;/a&gt;    &lt;ul&gt;
      &lt;li&gt;&lt;a href=&quot;https://geoffreymetais.github.io/code/key-signing/#install-dependencies&quot; id=&quot;markdown-toc-install-dependencies&quot;&gt;Install dependencies&lt;/a&gt;&lt;/li&gt;
      &lt;li&gt;&lt;a href=&quot;https://geoffreymetais.github.io/code/key-signing/#prepare-configuration-file&quot; id=&quot;markdown-toc-prepare-configuration-file&quot;&gt;Prepare configuration file&lt;/a&gt;&lt;/li&gt;
      &lt;li&gt;&lt;a href=&quot;https://geoffreymetais.github.io/code/key-signing/#set-up-your-own-management-key&quot; id=&quot;markdown-toc-set-up-your-own-management-key&quot;&gt;Set up your own management key&lt;/a&gt;&lt;/li&gt;
      &lt;li&gt;&lt;a href=&quot;https://geoffreymetais.github.io/code/key-signing/#change-your-pin&quot; id=&quot;markdown-toc-change-your-pin&quot;&gt;Change your PIN&lt;/a&gt;&lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://geoffreymetais.github.io/code/key-signing/#keystore-import&quot; id=&quot;markdown-toc-keystore-import&quot;&gt;Keystore import&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://geoffreymetais.github.io/code/key-signing/#app-signature&quot; id=&quot;markdown-toc-app-signature&quot;&gt;App signature&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://geoffreymetais.github.io/code/key-signing/#scripting&quot; id=&quot;markdown-toc-scripting&quot;&gt;Scripting&lt;/a&gt;&lt;/li&gt;
  &lt;li&gt;&lt;a href=&quot;https://geoffreymetais.github.io/code/key-signing/#jarsigner&quot; id=&quot;markdown-toc-jarsigner&quot;&gt;Jarsigner&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

  


&lt;p&gt;With this method, I can now sign the VLC releases on any of my computers without duplicating the keystore file. And keystore password is replaced by my Yubikey PIN.&lt;/p&gt;

&lt;p&gt;Here is the precise process we went through to get this done.&lt;/p&gt;

&lt;h1 id=&quot;setup&quot;&gt;Setup&lt;/h1&gt;

&lt;h3 id=&quot;install-dependencies&quot;&gt;Install dependencies&lt;/h3&gt;
&lt;p class=&quot;notice--info&quot;&gt;I am considering a Debian based distribution with open JDK 8 installed for this post.&lt;/p&gt;

&lt;p&gt;First of all, we need to install the pkcs11 opensc lib and the zipalign tool&lt;/p&gt;
&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;sudo apt-get install opensc-pkcs11 zipalign
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p class=&quot;notice--info&quot;&gt;&lt;code class=&quot;highlighter-rouge&quot;&gt;zipalign&lt;/code&gt; can also be found in &lt;em&gt;android_sdk_path&lt;/em&gt;/build-tools/&lt;em&gt;version&lt;/em&gt;/&lt;/p&gt;

&lt;h3 id=&quot;prepare-configuration-file&quot;&gt;Prepare configuration file&lt;/h3&gt;
&lt;p&gt;Then, we prepare the pkcs11 configuration. Let’s create file &lt;code class=&quot;highlighter-rouge&quot;&gt;pkcs11_java.cfg&lt;/code&gt; and fill it with:&lt;/p&gt;
&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;name = OpenSC-PKCS11
description = SunPKCS11 via OpenSC
library = /usr/lib/x86_64-linux-gnu/opensc-pkcs11.so
slotListIndex = 0
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p class=&quot;notice--info&quot;&gt;Yubico How-To advises &lt;code class=&quot;highlighter-rouge&quot;&gt;slotListIndex = 1&lt;/code&gt;, but I had to set it to 0 to make it work with my Yubikey 4.&lt;/p&gt;

&lt;p&gt;Let’s assume we save it in: &lt;code class=&quot;highlighter-rouge&quot;&gt;~/.pkcs11_java.cfg&lt;/code&gt;&lt;/p&gt;

&lt;h3 id=&quot;set-up-your-own-management-key&quot;&gt;Set up your own management key&lt;/h3&gt;
&lt;p&gt;If you did not set your management key, you have to do it now:&lt;/p&gt;
&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;key=`dd if=/dev/random bs=1 count=24 2&amp;gt;/dev/null | hexdump -v -e '/1 &quot;%02X&quot;'`
echo $key
yubico-piv-tool -a set-mgm-key -n $key
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;h3 id=&quot;change-your-pin&quot;&gt;Change your PIN&lt;/h3&gt;
&lt;p&gt;Same for PIN setting, default one is &lt;em&gt;123456&lt;/em&gt;&lt;/p&gt;
&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;yubico-piv-tool -a change-pin -P 123456 -N &amp;lt;NEW PIN&amp;gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;h1 id=&quot;keystore-import&quot;&gt;Keystore import&lt;/h1&gt;

&lt;p&gt;Now it’s time to import our keystore to the key PIV slot.&lt;/p&gt;
&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;keytool -importkeystore -srckeystore mykeystore.keystore -destkeystore mykeystorey.p12 -srcstoretype jks -deststoretype pkcs12
yubico-piv-tool -s 9a -a import-key -a import-cert -i mykeystorey.p12 -K PKCS12 -k
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;You will be asked to type in the keystore password, then the certificate management key.&lt;/p&gt;

&lt;p class=&quot;notice--info&quot;&gt;Starting from now, you won’t have to type the keystore password anymore but your Yubikey PIN.&lt;/p&gt;

&lt;p&gt;We can check that our key is ready to sign apps:&lt;/p&gt;
&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;keytool -providerClass sun.security.pkcs11.SunPKCS11 -providerArg ~/.pkcs11_java.cfg -keystore NONE -storetype PKCS11 -list -J-Djava.security.debug=sunpkcs11
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p class=&quot;notice--warning&quot;&gt;This is the Yubikey PIN you have to type-in now.&lt;br /&gt;
And don’t forget to touch it if you enabled the ‘touch-to-sign’ option.&lt;/p&gt;

&lt;h1 id=&quot;app-signature&quot;&gt;App signature&lt;/h1&gt;
&lt;p&gt;In build tools 24.0.3 Google has released &lt;a href=&quot;https://developer.android.com/studio/command-line/apksigner.html&quot;&gt;apksigner&lt;/a&gt;, a new signature tool with convenient arguments like &lt;code class=&quot;highlighter-rouge&quot;&gt;--min-sdk-version&lt;/code&gt; to get sure the application signature is correct.&lt;/p&gt;

&lt;p class=&quot;notice--warning&quot;&gt;Until release (26.0.1) apksigner doesn’t handle pkcs11 protocol correctly. So, &lt;strong&gt;you need to use build-tools 26.0.1+&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;We now have to get an &lt;strong&gt;unsigned&lt;/strong&gt; apk, so we must tell gradle to not apply any signing config for release builds&lt;/p&gt;
&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt; buildTypes {
        release {
            signingConfig null
            //…
        }
    }
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;Finally we can sign an apk without our keystore, we just need the Yubikey to be plugged and fire up &lt;em&gt;apksigner&lt;/em&gt;&lt;/p&gt;
&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;ANDROID_SDK_PATH/build-tools/BUILD_TOOLS_VERSION/apksigner sign --ks NONE --ks-pass &quot;pass:$YUBI_PIN&quot; \
--min-sdk-version 9 --provider-class sun.security.pkcs11.SunPKCS11 \
--provider-arg pkcs11_java.cfg --ks-type PKCS11 app.apk
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;We can now verify the package is signed:&lt;/p&gt;
&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;apksigner verify --verbose app.apk
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;&lt;code class=&quot;highlighter-rouge&quot;&gt;verify&lt;/code&gt; accepts &lt;code class=&quot;highlighter-rouge&quot;&gt;--min-sdk-version&lt;/code&gt; and &lt;code class=&quot;highlighter-rouge&quot;&gt;--max-sdk-version&lt;/code&gt; to ensure your users won’t get &lt;code class=&quot;highlighter-rouge&quot;&gt;103&lt;/code&gt; Play Store error code once the app is released.&lt;/p&gt;

&lt;h1 id=&quot;scripting&quot;&gt;Scripting&lt;/h1&gt;

&lt;p&gt;Here is the full bash script I use to sign all my apks at once:&lt;/p&gt;
&lt;div class=&quot;language-bash 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;c&quot;&gt;#! /bin/sh&lt;/span&gt;

&lt;span class=&quot;nb&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;Please enter Yubikey PIN code &quot;&lt;/span&gt;
stty &lt;span class=&quot;nt&quot;&gt;-echo&lt;/span&gt;
&lt;span class=&quot;nb&quot;&gt;trap&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'stty echo'&lt;/span&gt; EXIT
&lt;span class=&quot;nb&quot;&gt;read&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;-p&lt;/span&gt; &lt;span class=&quot;s1&quot;&gt;'PIN: '&lt;/span&gt; YUBI_PIN
stty &lt;span class=&quot;nb&quot;&gt;echo
trap&lt;/span&gt; - EXIT

&lt;span class=&quot;nv&quot;&gt;BT_VERSION&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;26.0.1&quot;&lt;/span&gt;

&lt;span class=&quot;nb&quot;&gt;echo&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\n&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;Signing apks&lt;/span&gt;&lt;span class=&quot;se&quot;&gt;\n&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;for &lt;/span&gt;i &lt;span class=&quot;k&quot;&gt;in&lt;/span&gt; &lt;span class=&quot;sb&quot;&gt;`&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;ls&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;*&lt;/span&gt;.apk&lt;span class=&quot;sb&quot;&gt;`&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;do&lt;/span&gt;
&lt;span class=&quot;nv&quot;&gt;$ANDROID_SDK&lt;/span&gt;/build-tools/&lt;span class=&quot;nv&quot;&gt;$BT_VERSION&lt;/span&gt;/zipalign 4 &lt;span class=&quot;nv&quot;&gt;$i&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$i&lt;/span&gt;.tmp &lt;span class=&quot;o&quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt; mv &lt;span class=&quot;nt&quot;&gt;-vf&lt;/span&gt; &lt;span class=&quot;nv&quot;&gt;$i&lt;/span&gt;.tmp &lt;span class=&quot;nv&quot;&gt;$i&lt;/span&gt;
&lt;span class=&quot;nv&quot;&gt;$ANDROID_SDK&lt;/span&gt;/build-tools/&lt;span class=&quot;nv&quot;&gt;$BT_VERSION&lt;/span&gt;/apksigner sign &lt;span class=&quot;nt&quot;&gt;--ks&lt;/span&gt; NONE &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
        &lt;span class=&quot;nt&quot;&gt;--ks-pass&lt;/span&gt; &lt;span class=&quot;s2&quot;&gt;&quot;pass:&lt;/span&gt;&lt;span class=&quot;nv&quot;&gt;$YUBI_PIN&lt;/span&gt;&lt;span class=&quot;s2&quot;&gt;&quot;&lt;/span&gt; &lt;span class=&quot;nt&quot;&gt;--min-sdk-version&lt;/span&gt; 9 &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
        &lt;span class=&quot;nt&quot;&gt;--max-sdk-version&lt;/span&gt; 26 &lt;span class=&quot;nt&quot;&gt;--provider-class&lt;/span&gt; sun.security.pkcs11.SunPKCS11 &lt;span class=&quot;se&quot;&gt;\&lt;/span&gt;
        &lt;span class=&quot;nt&quot;&gt;--provider-arg&lt;/span&gt; ~/.pkcs11_java.cfg &lt;span class=&quot;nt&quot;&gt;--ks-type&lt;/span&gt; PKCS11 &lt;span class=&quot;nv&quot;&gt;$i&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;done
&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;unset &lt;/span&gt;YUBI_PIN
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h1 id=&quot;jarsigner&quot;&gt;Jarsigner&lt;/h1&gt;

&lt;p&gt;We can also use jarsigner to sign your apk:&lt;/p&gt;
&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;jarsigner -providerClass sun.security.pkcs11.SunPKCS11 -providerArg ~/.pkcs11_java.cfg \
  -keystore NONE -storetype PKCS11 -sigalg SHA1withRSA -digestalg SHA1 \
  app.apk &quot;Certificate for PIV Authentication&quot;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p class=&quot;notice--info&quot;&gt;The &lt;code class=&quot;highlighter-rouge&quot;&gt;-sigalg SHA1withRSA -digestalg SHA1&lt;/code&gt; parameters are needed because we support old devices. If you don’t support Android 4.2 and older you can rip it off.&lt;/p&gt;
&lt;p class=&quot;notice--warning&quot;&gt;With jarsigner, we need to zipalign the apk &lt;strong&gt;after&lt;/strong&gt; signing them.&lt;/p&gt;

&lt;p&gt;And verify the package is signed:&lt;/p&gt;
&lt;div class=&quot;highlighter-rouge&quot;&gt;&lt;div class=&quot;highlight&quot;&gt;&lt;pre class=&quot;highlight&quot;&gt;&lt;code&gt;jarsigner -verify app.apk
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;</content:encoded>
	<dc:date>2017-06-01T00:00:00+00:00</dc:date>
</item>
<item rdf:about="tag:blog.duraffort.fr,2017-05-05:/post/2017/05/05/A-common-mistake-with-jinja2/">
	<title>Rémi Duraffort: A common mistake with jinja2</title>
	<link>https://blog.duraffort.fr/post/2017/05/05/A-common-mistake-with-jinja2/</link>
	<content:encoded>&lt;p&gt;&lt;a href=&quot;http://jinja.pocoo.org/&quot;&gt;Jinja2&lt;/a&gt; is a powerful templating engine for Python.&lt;/p&gt;
&lt;p&gt;Inside &lt;a href=&quot;https://validation.linaro.org&quot;&gt;LAVA&lt;/a&gt;, we use Jinja2 to generate
configuration files for every boards that we support.&lt;/p&gt;
&lt;p&gt;The configuration is generated from a template that does inherit from a base
template.&lt;/p&gt;
&lt;p&gt;For instance, for a &lt;strong&gt;beaglebone-black&lt;/strong&gt; called &lt;strong&gt;bbb-01&lt;/strong&gt;, the template
inheritance tree is the …&lt;/p&gt;</content:encoded>
	<dc:date>2017-05-05T15:21:00+00:00</dc:date>
</item>

</rdf:RDF>
