<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Ulvi Jabbarli on Medium]]></title>
        <description><![CDATA[Stories by Ulvi Jabbarli on Medium]]></description>
        <link>https://medium.com/@ulvi-jabbarli?source=rss-efc2a9b1bdc1------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*cNFLpBDtflQ0bwjmPGDI-g.jpeg</url>
            <title>Stories by Ulvi Jabbarli on Medium</title>
            <link>https://medium.com/@ulvi-jabbarli?source=rss-efc2a9b1bdc1------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 28 Nov 2026 21:39:14 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@ulvi-jabbarli/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[SSL pinning in Android apps]]></title>
            <link>https://ulvi-jabbarli.medium.com/ssl-pinning-in-android-apps-995f5b9c568?source=rss-efc2a9b1bdc1------2</link>
            <guid isPermaLink="false">https://medium.com/p/995f5b9c568</guid>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[security]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[android]]></category>
            <dc:creator><![CDATA[Ulvi Jabbarli]]></dc:creator>
            <pubDate>Tue, 16 Mar 2021 20:35:24 GMT</pubDate>
            <atom:updated>2021-03-27T10:58:03.659Z</atom:updated>
            <content:encoded><![CDATA[<h3>Android-SSL pinning guide</h3><h4>Implementation of SSL pinning in Android applications</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*sT_mrPLx-9asKvcr" /></figure><h4>What is pinning?</h4><p>Pinning is an optional mechanism to improve the security of a service or site that relies on SSL Certificates. Pinning allows you to associate a host with their expected cryptographic identity that should be accepted by users. Cryptographic identity is a file that can prove the identity of a server/host through cryptography.</p><p>Once a cryptography identity is known or seen for a host, it is associated or “pinned” to the host. If more than one identity is acceptable by the host, then the program holds these identities as a “pinset” and matches one of the elements in that “pinset”.</p><p>To summarize, an SSL connection tells the client to establish an encrypted connection with any identity that matches that host. Pinning tells the client a <strong>specific identity</strong> to accept when establishing a secure connection.</p><h4>What should be pinned?</h4><p>The first thing to decide is what should be pinned. For this choice, we have two options:</p><ul><li>Certificate pinning</li><li>Public key pinning</li></ul><p>If we choose public keys, we have two additional choices: pin the <strong><em>subjectPublicKeyInfo</em></strong> or pin one of the concrete types such as <strong><em>RSAPublicKey</em></strong> or <strong><em>DSAPublicKey</em></strong>.</p><p><strong><em>Certificate</em></strong></p><p>The certificate is the easiest to pin. You can fetch the certificate out of the band for the website. When the certificate expires, you would update your application. Assuming your application has no bugs or security defects, the application would be updated every year or two.</p><p>There is a downside to pinning a certificate. If the site rotates its certificate on a regular basis, then your application would need to be updated regularly. For example, Google rotates its certificates, so you will need to update your application about once a month (if it depended on Google services). Even though Google rotates its certificates, the underlying public keys (within the certificate) remain static.</p><p><strong><em>Public Key</em></strong></p><p>Public key pinning is more flexible but a little trickier due to the extra steps necessary to extract the public key from a certificate. As with a certificate, the program checks the extracted public key with its embedded copy of the public key.</p><p>There are two downsides to public key pinning:</p><ol><li>It’s harder to work with keys (versus certificates) since you usually must extract the key from the certificate. Extraction is a minor inconvenience in Java and .Net, buts it’s uncomfortable in Cocoa/CocoaTouch and OpenSSL.</li><li>The key is static and may violate key rotation policies.</li></ol><p><strong>Hashing</strong></p><p>Apart from the choices above, it’s also acceptable to use a hash of the information (or other transforms). In fact, the original sample programs were written using digested certificates and public keys. The samples were changed to allow a programmer to inspect the objects with tools like <em>dumpasn1</em> and other <em>ASN.1</em> decoders.</p><p>Hashing also provides three additional benefits:</p><ol><li>Hashing allows you to anonymize a certificate or public key. This might be important if your application is concerned about leaking information during decompilation and re-engineering.</li><li>A digested certificate fingerprint is often available as a native API for many libraries, so it’s convenient to use.</li><li>An organization might want to supply a reserve (or back-up) identity in case the primary identity is compromised. Hashing ensures your adversaries do not see the reserved certificate or public key in advance of its use.</li></ol><h4>Pinning in Android</h4><p>There are several ways to implement Certificate Pinning in Android projects.</p><ul><li>Using <a href="https://docs.oracle.com/javase/7/docs/api/javax/net/ssl/X509TrustManager.html">Trust Manager</a> (Old Way: compare over entire certificate)</li><li>OkHttp and <a href="https://square.github.io/okhttp/3.x/okhttp/okhttp3/CertificatePinner.html">CertificatePinner</a></li><li><a href="https://github.com/moxie0/AndroidPinning">Android Pinning library</a></li><li>Network Security Config + TrustKit Android Library</li></ul><p>Since Android N, the preferred way for implementing pinning is by leveraging Android’s <a href="https://developer.android.com/training/articles/security-config.html">Network Security Configuration(NSC)</a> feature, which lets apps customize their network security settings in a safe, declarative configuration file without modifying app code.</p><p>If devices running a version of Android that is earlier than N need to be supported, a backport of the Network Security Configuration pinning functionality is available via <a href="https://github.com/datatheorem/TrustKit-Android">the TrustKit Android Library</a>. Apart from that, TrustKit has a reporting config in which we can set a reporting URL for pin validation reports.</p><p>TrustKit Android works by extending the Android N Network Security Configuration in two ways:</p><ul><li>It provides support for the &lt;pin-set&gt; (for SSL pinning) and &lt;debug-overrides&gt; the functionality of the Network Security Configuration to earlier versions of Android, down to API level 17. This allows Apps that support versions of Android earlier than N to implement SSL pinning in a way that is future-proof.</li><li>It adds the ability to send reports when pinning validation failed for a specific connection.</li></ul><h4><strong>Getting SSL Pins</strong></h4><p>Before adding SSL Pinning to our App, first, we need to investigate and choose which domains and public keys need to be pinned. We will use the base64-encoded <strong>SHA-256</strong> of a certificate’s <strong>Subject Public Key Info</strong> as an SSL Pin here which compares the <strong>hash</strong> (often called a <em>pin</em>) of the public key instead of comparing the entire certificate.</p><p>There are several ways to get a hashed pin from a certificate. One of them is obtaining the public key hash of your server’s certificate using a handful of OpenSSL commands. Below you can find a list of steps for that:</p><ul><li>Acquire the certificate of your server. This can be done by either asking for it from your backend developer colleagues, or by simply downloading it from a browser (eg. if your server has a public website).</li></ul><pre>openssl s_client -connect your-server.com:443 -showcerts &lt; /dev/null | openssl x509 -outform der &gt; server_cert.der</pre><ul><li>When you have the certificate, you need to extract and optionally save its public key in a PEM format.</li></ul><pre>openssl x509 -inform der -in server_cert.der -pubkey -noout &gt; server_cert_public_key.pem</pre><ul><li>After having the certificate, you can hash it with whatever hashing algorithm you prefer (only make sure that it is a secure algorithm). I used SHA256 to hash our key. After calculating the hash, I simply encoded it with Base64 encoding, to make it easier to store, and read.</li></ul><pre>cat server_cert_public_key.pem | openssl rsa -pubin -outform der | openssl dgst -sha256 -binary | openssl enc -base64</pre><p>The output of the commands listed above is the hash of your server’s public key, which can now be added to your application.</p><p>To obtain the pin for the host we are talking to we will use<a href="https://www.ssllabs.com/ssltest/analyze.html"> SSL Labs</a></p><ol><li>Type <strong>your-domain.com</strong> for the <strong>Hostname</strong> field and click <strong>Submit</strong></li><li>On the next page select one of the servers</li><li>You will see the certificates listed; each certificate has an <strong>Additional Certificate</strong> — which is a <strong>backup</strong>. Each entry has a <strong>Pin SHA256</strong> value. Those are the hashes of the public keys that we will add to the app.</li></ol><h4>Implementation with NSC + TrustKit in Android</h4><ul><li>Add TrustKit to your project’s <em>build.gradle</em>:</li></ul><pre>implementation ‘com.datatheorem.android.trustkit:trustkit:&lt;version&gt;&#39;</pre><ul><li>Configuring a Pinning Policy - Deploying SSL pinning in the App requires initializing TrustKit with a pinning policy (domains, pins, and additional settings). The policy is wrapped in the official Android N Network Security Configuration i.e :</li></ul><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/c2c7a072e213646e01bda5a6ffe9e81e/href">https://medium.com/media/c2c7a072e213646e01bda5a6ffe9e81e/href</a></iframe><ul><li>The path to the XML policy should then be specified <a href="https://developer.android.com/training/articles/security-config.html#manifest">in the App’s manifest</a> in order to enable it as the App’s Network Security Configuration on Android N:</li></ul><pre>&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;<br>&lt;manifest ... &gt;<br>    &lt;application android:networkSecurityConfig=&quot;@xml/network_security_config&quot;<br>                    ... &gt;<br>        ...<br>    &lt;/application&gt;<br>&lt;/manifest&gt;</pre><ul><li>Then, TrustKit should be initialized with the same path:</li></ul><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/b77b38b46e16a790e633d2f65b598a3b/href">https://medium.com/media/b77b38b46e16a790e633d2f65b598a3b/href</a></iframe><p>Once TrustKit has been initialized and the client or connection’s SSLSocketFactory has been set, it will verify the server&#39;s certificate chain against the configured pinning policy whenever an HTTPS connection is initiated. If a report URI has been configured, the App will also send reports to the specified URI whenever a pin validation failure occurred.</p><p>You can also create and register local broadcast receivers to receive the same certificate pinning error reports that would be sent to the report_uris.</p><blockquote><strong>Note!</strong>: <a href="https://github.com/datatheorem/TrustKit-Android#limitations">TrustKit Limitations</a></blockquote><p>For consumers of TrustKit’s OkHttpHelper solutions, redirects must be disabled as Pinning will currently only work properly on the initial request and not any redirects.</p><h4><strong>Network Security testing tools</strong></h4><p>There are some useful tools and guides that you can use to analyze and verify the security of networks in your app:</p><ul><li>Google has a network security testing tool to help you spot cleartext traffic or other connection vulnerabilities in your app. Visit <a href="https://github.com/google/nogotofail"><strong>nogotofail</strong></a> for more info.</li><li>For additional security tools, check out the <a href="https://developer.android.com/training/safetynet/attestation"><strong>SafetyNet API</strong></a>. It includes safe browsing, integrity, and reCAPTCHA API to protect your app from spammers, phishing URLs, and other malicious traffic.</li><li>Lastly, there is the <a href="https://mobile-security.gitbook.io/mobile-security-testing-guide/android-testing-guide/0x05g-testing-network-communication"><strong>Android Network APIs</strong></a> guide which is part of the <a href="https://mobile-security.gitbook.io/mobile-security-testing-guide/"><strong>Mobile Security Testing Guide</strong></a></li></ul><ul><li><a href="https://cheatsheetseries.owasp.org/cheatsheets/Pinning_Cheat_Sheet.html#android">Pinning - OWASP Cheat Sheet Series</a></li><li><a href="https://owasp.org/www-community/controls/Certificate_and_Public_Key_Pinning">Certificate and Public Key Pinning</a></li><li><a href="https://www.raywenderlich.com/10056112-securing-network-data-tutorial-for-android#toc-anchor-004">Securing Network Data Tutorial for Android</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=995f5b9c568" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Android tətbiqetmələrin deploymentinin Github Actions + Fastlane  istifadə edərək Firebase App…]]></title>
            <link>https://ulvi-jabbarli.medium.com/android-t%C9%99tbiqetm%C9%99l%C9%99rin-deploymentinin-github-actions-fastlane-istifad%C9%99-ed%C9%99r%C9%99k-firebase-app-ee0d14112630?source=rss-efc2a9b1bdc1------2</link>
            <guid isPermaLink="false">https://medium.com/p/ee0d14112630</guid>
            <category><![CDATA[github-actions]]></category>
            <category><![CDATA[firebase]]></category>
            <category><![CDATA[android]]></category>
            <category><![CDATA[app-distribution]]></category>
            <category><![CDATA[fastlane]]></category>
            <dc:creator><![CDATA[Ulvi Jabbarli]]></dc:creator>
            <pubDate>Tue, 03 Nov 2020 21:57:48 GMT</pubDate>
            <atom:updated>2020-11-03T21:57:48.593Z</atom:updated>
            <content:encoded><![CDATA[<h3>Android tətbiqetmələrin deploymentinin Github Actions + Fastlane 🚀 istifadə edərək Firebase App Distribution ilə avtomatlaşdırılması</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*o165uO_-_Y9oH7uz_CXyEQ.png" /></figure><p>Ümumən olduğu kimi, “<strong>Code </strong>→<strong> Compile </strong>→<strong> Deployment”</strong> prosesi Mobile developerlər üçün də kifayət qədər vaxt gərəkdirən və hər yeni bir funksiya əlavə olunan zaman təkrarlanan bir prosesdir.</p><p>Bu məqalədə <a href="https://docs.github.com/en/free-pro-team@latest/actions">GitHub Actions</a> və <a href="https://fastlane.tools/">Fastlane</a> istifadə edərək Android tətbiqetmələr üçün bu prosesin <a href="https://firebase.google.com/docs/app-distribution">Firebase App Distribution</a> ilə <em>testing </em>mühitində avtomatlaşdırılmasına baxacağıq.</p><p>Məqalənin sonunda, testerlərin hər hansı bir funksionallığı test etməsi üçün, həmin funksionallığın kodlarını yazıb uyğun branch-a yükləməyiniz kifayət edəcəkdir.</p><p>İlk öncə, istifadə edəcəyimiz <em>tool</em>-lar haqqında ümumi məlumata nəzər salaq.</p><h4><strong>Firebase App Distribution nədir?</strong></h4><ul><li><a href="https://firebase.google.com/docs/app-distribution">Firebase App Distribution</a> tətbiqetmələrin <em>pre-release</em> versiyalarının testerlərə təqdim edilməsini rahatlaşdıran platformadır.</li><li>Eyni zamanda, Android və iOS <em>pre-release</em> versiyalarının eyni yerdən idarə edilməsi və nəticələrin dəyərləndirilməsi imkanın təqdim edir.</li><li>Platforma üzərindən testerlər və tester qruplarını yaradılması, onların hər bir versiya üzrə statuslarının izlənilməsi də mümkündür.</li><li>Əgər, tətbiqetmənizdə <a href="https://firebase.google.com/docs/crashlytics"><strong>Crashlytics </strong></a>istifadə etmisinizsə, versiyaların <strong>Crashlytics</strong>-in nəticələri üzərindən stabilliyini izləmək imkanınız olacaq.</li></ul><h4>Fastlane nədir?</h4><p><a href="https://fastlane.tools/">Fastlane</a> <em>development </em>və <em>release </em>proseslərinin avtomatlaşdırılmasını asanlaşdıran açıq-qaynaqlı <em>automation tool</em>-dur. Həm Android həm də iOS tətbiqetmələrinə inteqrasiya edilə bilən <em>fastlane</em> aşağıdakı avtomatlaşdırma imkanlarını təqdim edir.</p><ul><li>Ekran görüntülərinin yaradılması</li><li><em>Beta</em> versiyanın testerlərə təqdim edilməsi</li><li>Tətbiqin App store-lara yüklənməsi</li><li><a href="https://docs.fastlane.tools/codesigning/getting-started/"><em>Code Signing</em></a></li></ul><h4>Github Actions nədir?</h4><p><a href="https://docs.github.com/en/free-pro-team@latest/actions">Github Actions</a> proqram təminatının əməliyyatlar ardıcıllığını (<em>software workflow: build, test, deploy, etc.</em>) avtomatlaşdıran <strong>CI/CD</strong> <em>tool</em>-lardan biridir. Buna oxşar bir neçə - Jenkins, CircleCI, TeamCity, TravisCI kimi tool-lar mövcuddur. Amma, Github Actions <em>repo</em>-lara asanlıqla inteqrasiya oluna bilməsinə görə alternativlərindən xüsusilə seçilir.</p><p>İstifadə edəcəyimiz alətlər barəsində qısa informasiyadan sonra praktiki hissəyə keçək.</p><p><strong><em>Qeyd</em></strong><em>: ⚠️</em></p><p><em>Əgər etməmisinizsə, ilk olaraq </em><a href="https://firebase.google.com/docs/android/setup#console"><em>Firebase-i Android proyektinizə əlavə edin</em></a><em> və paneldə uyğun platforma (iOS&amp;Android) üçün App yaradaraq proyektinizə konfiqurasiya edin.</em></p><h4>Fastlane-ın konfiqurasiyası</h4><ul><li>İlk öncə, əgər sistemdə əvvəlcədən quraşdırılmayıbsa, <a href="https://www.ruby-lang.org/en/downloads/">Ruby</a>-ni yükləmək lazımdır.</li><li>Ardından proyektin əasə folderində Gemfile adlı fayl yaradaraq aşağıdakı konfiqurasiyanı daxil edin</li></ul><pre>source “https://rubygems.org&quot; </pre><pre>gem “fastlane”</pre><ul><li>Daha sonra, əsas folderdə sudo gem install fastlane -NV command-ı run edərək <strong>Fastlane</strong>-ı yükləyirik</li><li>Son olaraq <strong>Fastlane</strong>-ın konfiqurasiyası üçün fastlane init command-ı run edib, təlimatlara uyğun olaraq proyekt ilə bağlı məlumatları daxil edirik.</li></ul><p><strong>Fastlane</strong>-ın konfiqurasiyası hazırdır. Proyektin əsas folderinə keçid edərək yeni yaradılmış fastlane folderini və daxilindəki Appfile və Fastfile fayllarını görə bilərsiz.</p><ul><li>Appfile — proyekti əhatə edən bütün konfiqurasiyaları təyin edir.</li><li>Fastfile — Fastlane vastiəsi ilə run olunacaq avtomatlaşdırılmış əməliyyatları (“<em>lanes”</em>) təyin edir.</li></ul><h4>Firebase plugin-in yüklənməsi</h4><p>Müxtəlif mövcud identifikasiya seçimlərindən istifadə edərək <em>plugin</em>-in yüklənməsinə <a href="https://firebase.google.com/docs/app-distribution/android/distribute-fastlane">burdan</a> baxa bilərsiz. Biz <strong><em>Firebase service account credentials</em></strong> vasitəsi ilə identifikasiyanı istifadə edəcəyik.</p><ul><li>İlk olaraq, <strong>Firebase App Distribution </strong><em>plugin</em>-in yüklənməsi üçün aşağıdakı command-ı run edirik.</li></ul><pre>fastlane add_plugin <strong><em>firebase_app_distribution</em></strong></pre><ul><li><em>Plugin </em>yüklənəndən sonra proyektin əsas folderinin bir neçə yeni fayl ilə birlikdə yeniləndiyini görə bilərsiz.</li></ul><p><strong>Firebase Service Credentials-ın konfiqurasiyası</strong></p><p><strong>Firebase Service Credentials</strong> fastlane<em>-</em>ın identifikasiyası üçün gərəklidir. Detallı olaraq <a href="https://firebase.google.com/docs/app-distribution/android/distribute-fastlane#service-acc-fastlane">burdan</a> baxa bilərsiz. Qısa olaraq, aşağıdakı əməliyyatları təkrarlayaraq konfiqurasiyanı edə bilərsiz.</p><ul><li><a href="https://console.cloud.google.com/projectselector2/iam-admin/serviceaccounts"><em>Google Cloud Platform console</em></a><em> → Select your project → Create a new service account.</em></li><li>Açılan pəncərədə <em>Service Account</em> ilə bağlı məlumatları <em>(name, description)</em> daxil edirik.</li><li>Yaradılan hesab-a <strong>“Firebase App Distribution Admin” </strong>rolunu təyin edib <em>Done </em>edirik.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OTain_wfHUuj0-5YfTNARA.png" /></figure><ul><li>Daha sonra <em>Service Account</em> üçün <strong><em>JSON key</em> </strong>fayl<strong> </strong>yaradırıq. Bu fayl, proyektinizin <strong>Firebase App Distribution</strong> panelinə <em>administrator access</em> verə biləcəyi üçün məxfi saxlanılmalıdır.</li><li><strong><em>JSON key</em> </strong>faylını proyektin əsas folderində saxlayın.<em>(Bu nümunədə mən həmin faylı </em><em>firebase_credentials.json olaraq adlandırdım)</em></li></ul><h4>Firebase App ID-in konfiqurasiyaya əlavə edilməsi</h4><p>Aşağıdakı əməliyyatlar ardıcıllığını yerinə yetirərək App ID -i əldə edə bilərik.</p><ul><li><a href="https://console.firebase.google.com/"><em>Firebase Console</em></a><em> → Open Your app project → Open Project Settings ⚙️ → Find your app there → Copy App ID from there.</em></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/925/1*n7t6jGSEI1JradzyJUv_IQ.png" /><figcaption>Firebase Project App ID</figcaption></figure><ul><li>İndi isə, App ID -ni sistem dəyişəni olaraq təyin edirik:</li></ul><pre>set PRONOTE_FIREBASE_APP_ID=<strong><em>YOUR_APP_ID</em></strong></pre><h4>Firebase App Distribution-un konfiqurasiyası</h4><p><strong>Firebase App Distribution</strong> müxtəlif növ konfiqurasiya seçimlərini dəstəkləyir. Bunlara <em>testers, tester groups, release notes</em> və.s aiddir. Bütün konfiqurasiya imkanlarına <a href="https://firebase.google.com/docs/app-distribution/android/distribute-fastlane#step_3_set_up_your_fastfile_and_distribute_your_app">burdan</a> baxa bilərsiz.</p><p>Bu proyektdə biz <em>tester groups </em>və <em>release notes </em>konfiqurasiyalarından istifadə edəcəyik.</p><ul><li>Proyektin əsas folderində FirebaseAppDistributionConfig folderi yaradırıq.</li><li>Bu folderin daxilində isə groups.txt faylını yaradırıq.</li></ul><p>Bu faylda tətbiqetməni test edəcək olan tester qruplarının ID -ləri aşağıdakı şəkildə qeyd olunur:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/c00626205727303151de40d72c2d801a/href">https://medium.com/media/c00626205727303151de40d72c2d801a/href</a></iframe><p>Bu tester qrupları <strong>Firebase App Distribution</strong>-un panelində yaradılır və idarə edilir.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*89ZFLPHSYpaE9PRcS-f9yw.png" /></figure><ul><li>Eyni folderdə release_notes.txt adlı yeni fayl yaradırıq.</li></ul><p>Bu faylda mövcud versiya ilə bağlı <em>release notes </em>qeyd olunur. Bu faylda yazılan məlumatlar proyektin yeni versiyası ilə birlikdə testerlərə təqdim olunur. Faylda aşağıdakı şəkildə versiya haqqında məlumatı daxil edə bilərik.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/cb09cc1c075ca3e8954b5d096662f982/href">https://medium.com/media/cb09cc1c075ca3e8954b5d096662f982/href</a></iframe><p>App Distribution üçün gərəkli bütün konfiqurasiyalarımız hazırdır.</p><h4>Distribution lane-in yaradılması</h4><p>Fastfile daxilində müxtəlif əməliyyatları yerinə yetirən tasklar <em>(lane) </em>təyin edə bilərik. İndi isə həmin faylı açaraq distribute adlı <em>lane </em>yaradaq.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/0262a6308ca0344ed3dc90cdfc75fa74/href">https://medium.com/media/0262a6308ca0344ed3dc90cdfc75fa74/href</a></iframe><p>Yazdığımız <em>lane</em>-da, yüklədiyimiz <em>plugin </em>vasitəsi ilə <strong>Fastlane</strong>-da mövcud olan firebase_app_distribution -dan istifadə edərək tətbiqetməmizin <em>distribution</em>-unu yerinə yetiririk.</p><p>Burada,GCP-dan yüklədiyimiz firebase_credentials.json faylını service_credentials_file olaraq istifadə edirik.</p><p>Artıq, <em>distribution </em>üçün yazdığımız <strong><em>lane</em></strong><em> </em>hazırdır. Lokal olaraq test edə bilərik.</p><p>Hər hansı bir <em>lane</em>-i işə salmaq üçün fastlane &lt;LANE_NAME&gt; <em>command-</em>ı<em> </em>run etmək lazımdır.</p><p>Yazdığımız distribute lane-ı lokal olaraq test etmək üçün proyektin əsas folderində fastlane distribute <em>command-</em>ı<em> </em>run edirik.</p><p>Hər şeyin doğru şəkildə işlədiyindən əmin olandan sonra, <strong>Firebase App Distribution </strong>panelinə keçid edərək tətbiqetmənin yeni versiyasının yaradılaraq testerlərə təqdim edildiyini görə bilərsiz.</p><p>Məqalənin bu hissəsinə qədər, <strong>Fastlane </strong>-dan istifadə edərək tətbiqetməmizin yeni versiyalarını <strong>Firebase App Distribution </strong>üzərindən testerlərə göndərilməsini tətbiq etdik.</p><p>İndi isə bu prosesin avtomatlaşdırılmasın edək.</p><h4>GitHub Actions konfiqurasiyası</h4><p>Fastlane vasitəsilə yazdığımız distribute <em>lane</em>-də gördüyünüz kimi, <em>lane</em>-in konfiqurasiyasında <strong>Firebase Credentials</strong> faylı və PRONOTE_FIREBASE_APP_ID dəyişənindən istifadə edirik. Proyektin kodlarını public olaraq paylaşmadığımız halda bu dəyişən və credentials faylını kodlarla biryerde saxlamaq olar. Amma, əgər proyektin kodların public olaraq paylaşırıqsa, bu zaman bu kimi konfiqurasiya faylı və dəyişənlərini məxfi saxlamaq lazımdır.</p><p>Bunun üçün <strong>GitHub Actions Secret</strong> istifadə edəcəyik. <strong>Github Actions Secret</strong> bizə məxfi saxlanılmalı məlumatları <em>Name→Value </em>şəklində saxlamağa imkan verir. Credentials faylını bu şəkildə saxlamaq üçün əvvəlcə faylı <a href="https://en.wikipedia.org/wiki/Base64">Base64</a> ilə encode etmək lazımdır.</p><p>Bunun üçün aşağıdakı <em>command</em>-ı run etmək lazımdır:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/6d40ae43ff43d6d68e8a01b2dd8a1413/href">https://medium.com/media/6d40ae43ff43d6d68e8a01b2dd8a1413/href</a></iframe><p><em>Command </em>run olandan sonra yaradılmış firebase_credentials.b64 faylını görə bilərsiz. İndi isə, bu faylın daxilindəki text-i kopyalayaraq <strong>Github Actions Secret</strong>-də yeni <em>secret </em>dəyişən olaraq əlavə edirik.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/994/1*xXK642cbSJAof-reWAE2FA.png" /><figcaption>Adding firebase_credentials to GitHub Secrets</figcaption></figure><p>Əlavə etdikdən sonra biz artıq <strong>GitHub Actions</strong> daxilində <strong>Firebase Service Credentials</strong>-ın <em>encoded </em>dəyərini <em>decode </em>edərək firebase_credentials.json faylını yarada bilərik.</p><p>İndi isə, davam edərək bütün məxfi saxlanılmalı dəyişənləri və faylları eyni qaydada <strong>GitHub Actions Secret</strong>-ə yükləyək.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/849/1*FokFCWkrSLH2trB82FS5yg.png" /><figcaption>Github secrets of repository</figcaption></figure><p>Bütün Secret -lər əlavə edildiyinə görə, artıq automation workflow -nu yarada bilərik.</p><p><strong>GitHub Actions Workflow-un yaradılması</strong></p><ul><li>İlk olaraq, proyektin ../.github/workflows folderi daxilində distribute.yml <em>workflow </em>faylını yaradıb ilkin konfiqurasiyaları daxil edirik.</li></ul><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/e8aa1f21a730ee9ca4226923577f9cb1/href">https://medium.com/media/e8aa1f21a730ee9ca4226923577f9cb1/href</a></iframe><p>İlkin konfiqurasiyalara əsasən, dev <em>branch</em>-a yeni kod <em>push </em>olunan zaman, avtomatik olaraq, Distribute <em>workflow </em>işə düşəcək.</p><ul><li>Lokalda olduğu kimi <em>workflow </em>üçün də <strong>Ruby</strong>-i yükləməyimiz gərəkir.</li></ul><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/9d1d409c417636d09e8763c156129cfe/href">https://medium.com/media/9d1d409c417636d09e8763c156129cfe/href</a></iframe><ul><li>Bildiyiniz kimi Firebase-in identifikasiyası üçün <strong>Firebase Service Credentials</strong> istifadə edirdik və <em>credentials </em>faylının <em>encoded </em>versiyasın <strong>GitHub Secrets</strong>-ə əlavə etmişdik. <em>Workflow </em>daxilində bu fayldan istifadə etmək üçün faylın <em>encoded </em>versiyasını <em>decode </em>edərək firebase_credentials.json faylını yenidən yaradırıq.</li></ul><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/d85ea9dfd288381f6b0f5546df2f5b15/href">https://medium.com/media/d85ea9dfd288381f6b0f5546df2f5b15/href</a></iframe><ul><li>Son olaraq isə PRONOTE_FIREBASE_APP_ID -ni sistem <em>(enviroment)</em> dəyişəni olaraq təyin edib, distribute <em>lane</em>-i işə salacaq <em>command-</em>ı <em>workflow</em>-ya əlavə edirik.</li></ul><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/c31768cea11f35a21f813370bd669614/href">https://medium.com/media/c31768cea11f35a21f813370bd669614/href</a></iframe><p>Və budur! Bütün konfiqurasiyalarımız hazırdır. Nəticəni görmək üçün sadəcə dev <em>branch</em>-a <em>push </em>etmək kifayətidir.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tlIDP-ABrFkxZKN2iwIQ4Q.png" /></figure><p>Tətbiqetmənin yeni versiyası avtomatik olaraq testerlərə göndərildi. <em>Distribute </em>olunmuş yeni versiyanı <strong>Firebase App Distribution</strong> panelinə keçid edərək görə bilərsiz.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eOnJ0JfIf-rPap4Ox0NOzA.png" /></figure><p>Oxuduğunuz üçün təşəkkür edirəm. Ümid edirəm faydalı olar. 🙂</p><p>Məqalədə referans olunan bütün konfiqurasiyalar aşağıdakı <em>repo</em>-da tətbiq edilib.</p><p><a href="https://github.com/ulvij/Pronote">ulvij/Pronote</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ee0d14112630" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>