Skip to content

Contributing to Android

Evgeny edited this page Jul 26, 2024 · 6 revisions

Introduction

Requirements

In case you wanna contribute to Delta you need:

  • basic knowledge of git
  • a fork of this repo
  • an SVG icon
  • an 192x192px PNG icon
  • ComponentInfo(s)? of the target app

Info

We have two methods of adding icons:

  • Auto method is a new method of adding icons. You only need to add PNG and SVG to a specific folder and append the icon name with ComponentInfo(s) to a specific YAML file. These files will be automatically handled by our CI/CD every release. Go to full instruction.
  • Manual method implies editing four XML files and adding icons to two specific folders. Go to full instruction.

We also have such a thing as alternative icons — we mainly use it to move an existing icon to an alternative one after rebranding, but there's nothing stopping you to make alternative icons for any app in different shapes as you wish. You can select an alternative icon for the target app via your icon launcher if it supports that feature.

Description of categories and what they are for:

  • New: for new icons obviously (new icons always must be duplicated there)
  • Alts: for alternative icons
  • Calendar: for calendar icons
  • Folders: for folder icons
  • Google: for Google apps (Chrome, YouTube, etc.)
  • System: for system icons (Camera, Settings, etc.)
  • #: icons whose name starts with a number (or, to be more clear, with an underscore followed by a number, e.g. _2048)
  • A-Z: icons which don't fit in previous categories must be placed in a category based on the first letter of its name

Rules

  • Keep LF line endings in files (CLRF breaks our CI/CD)
  • SVG, PNG and drawable names must be the same
  • Keep filenames in alphanumeric lowercase with underscores
  • If the icon name starts with a number, it must have a leading underscore (e.g. _9gag) and be placed in # category
  • Keep the next naming format of alternative icons: new_icon_alt_x, where x is a number of current alternative version (yes, we have multiple of them, e.g. old_icon_alt_1, old_icon_alt_2, etc.

Contributing

new_icon will be used as the icon name
new_icon_alt_1 will be used as the alternative icon for new_icon
com.example/com.example.MainActivity will be used as the 1st ComponentInfo for new_icon
com.example/com.example.StartActivity will be used as the 2nd ComponentInfo for new_icon

Don't forget to give yourself an entry at the bottom of app/src/main/res/xml/contributors.xml if this is your first contribution!

Auto Method

This method is only for adding new icons or linking ComponentInfo(s) with existing icons!

  1. Add new_icon.svg and new_icon.png to contribs/icons directory

  2. Append the icon name with ComponentInfo(s) to contribs/icons.yml with any of the next formats:

    2.1. The new icon with the ComponentInfo.

    Can be used for linking the ComponentInfo with the existing icon

    # lines omitted for example
    
    new_icon:
        - com.example/com.example.MainActivity

    2.2. The new icon with multiple ComponentInfos:

    Can be used for linking ComponentInfos with the existing icon

    # lines omitted for example
    
    new_icon:
        - com.example/com.example.MainActivity
        - com.example/com.example.StartActivity

    2.3. The icon without the ComponentInfo (the alternative icon):

    # lines omitted for example
    
    new_icon_alt_1: {}

And we're done! Repeat the process for adding new icons.

Manual Method

  1. Add new_icon.svg to resources/vectors directory

  2. Add new_icon.png to app/src/main/res/drawable-nodpi directory

  3. Append the line <item drawable="new_icon" /> in New and named categories (the named category is based on the first letter of the icon name; N in our case) to app/src/main/assets/drawable.xml and app/src/main/res/xml/drawable.xml. How it should look:

        <!-- lines omitted -->
        <category title="New" />
        <!-- lines omitted -->
        <item drawable="latest_entry">
        <item drawable="new_icon" />
        
        <category title="Alts" />
        <!-- lines omitted -->
    
        <category title="N" />
        <!-- lines omitted -->
        <item drawable="latest_entry">
        <item drawable="new_icon" />
        
        <category title="O" />
        <!-- lines omitted -->

    You can edit one file and overwrite another with it to keep them identical.

  4. Append the line <item component="ComponentInfo{com.example/com.example.MainActivity}" drawable="new_icon" /> to app/src/main/assets/appfilter.xml and app/src/main/res/xml/appfilter.xml. How it should look:

        <!-- lines omitted -->
        <item component="ComponentInfo{com.google/com.google.MainActivity}" drawable="latest_entry" />
        <item component="ComponentInfo{com.example/com.example.MainActivity}" drawable="new_icon" />
    </resources>

    You can edit one file and overwrite another with it to keep them identical.

The end. More complicated than Auto method, but it's a base method, you can modify/fix current icons by this method.

Other Cases

Alternative Icons

If the existing icon rebranded, don't overwrite it with a new one, do the following:

old_icon will be used as an existing icon name

old_icon_alt_1 will be used as an alternative icon name for the existing icon name

  1. Determine if alternative icons exist for the target app by checking Alts category in app/src/main/res/xml/drawable.xml. If no alternative icons then start numbering from 1 (e.g. old_icon_alt_1), otherwise continue numbering based on latest alternative icon number (e.g. old_icon_alt_2)

  2. Rename old_icon.svg to old_icon_alt_1.svg in resources/vectors directory (if SVG not found there just skip this step)

  3. Rename old_icon.png to old_icon_alt_1.png in app/src/main/res/drawable-nodpi directory

  4. Add old_icon_alt_1 to Alts category and old_icon to New category in app/src/main/assets/drawable.xml and app/src/main/res/xml/drawable.xml

  5. If the ComponentInfo also changed after rebranding, replace old_icon with old_icon_alt_1 in app/src/main/assets/appfilter.xml and app/src/main/res/xml/appfilter.xml (the alternative icon will be linked with the old ComponentInfos for back compability)

Delta Palette Icon Template for Delta Icon Template Tutorial for Delta

.GPL Palette .ASE Palette

Requests

If you wanna help close icon requests from users, you can take a look at contribs/requests.yml where all requests are stored. The file updates periodically.

ComponentInfo

ComponentInfo is what your launcher uses to know which apps get which icons in icon packs.

You may use these tools to find each app's СomponentInfo(s):

Build

GitHub Actions

Everything described here must be done in your fork

Creating Secrets

Go to Settings → Secrets and Variables and create the following repository secrets:

  • KEYSTORE_BASE64

    MIIKRgIBAzCCCfAGCSqGSIb3DQEHAaCCCeEEggndMIIJ2TCCBbAGCSqGSIb3DQEHAaCCBaEEggWdMIIFmTCCBZUGCyqGSIb3DQEMCgECoIIFQDCCBTwwZgYJKoZIhvcNAQUNMFkwOAYJKoZIhvcNAQUMMCsEFALf2o/enYgJaO2D4otoTSpxWhWtAgInEAIBIDAMBggqhkiG9w0CCQUAMB0GCWCGSAFlAwQBKgQQMpyd3LX1rnoCfCGv+LAQ1wSCBNDoQdq5T9uFBEf2nKKgH1WR1/F7s9AIk9Gs+VVu03Y8ntd7QNDf55HytKZbRFE5cN7Vod5LPm4uiUP5zPVkGgqmX6nfZPRppR1k17X2pYG/lm7n2WUItt35HeIxr6Tbnqr7eLRuCwCZ7kfpJYhmOVZ/MIsylejqjbTqX1ajkVUFeb4J0KVZlq4OXhqMCmHHxaZe41yV/WjfPtbXyP7MCjp47XY4LpTlJ+ad1COwlktMv1oud5UUQfVnQwkcOQZQGoZuuL41cEAeHjR6GpEVnyhR33t9kOPdAPLFVyp22+8TL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3Fk8nOyzRlf1gBdQmIblDqZ9C6PPHSJQiVZCS8hd68np9oiz96ltxSnroEZ7YkoBQSfDMw3nFoDJ6W46/H65HjUmALxikw1wsOkDvT5Z6VGvaAHFc7Ng/38UBx1yNhF+W+IGFnXIhtwaxfKmdtdFjHzS54Q5qPk/HCKVBTlZOZtfEJvQNiE1pthDMPwdYZ8a6PR7gTEiRT9LChHuGh1TZIhk0rkGiUJScj5ix69iGHTi4yKmeHgqonDXeCCdyjf6S9Ox8wQ7x9Kvu53pz8u/hadbR/+Iuc9v1YFES44QmApizYYEUufVCYqlsCD+pBSm41WSpvLYZvBJpO8lQgMPNh+IKU5mbTaMOdF+NMRMdu1tdjBbcjn/HpqCIztNxZqUbcRe4ndNMs7qmDdIDqmkPBxmLnmuJERHNdu2BiCsj+UlVDgVx0H7yNFFAD7RPheekIHMILhb63ngr1uKXYD/zpJj3fNqbOlveN47JydA1pEMPRKmehudmgm5k9oNxgKKDof3J9RMsynUSNUlvG/UWA/9+aeL8vImOMSeYAnQ3idwc8t4y9zzHWmVzdtw9vALo8O5H1IddwSlii4U9kq/3NniWR7JaPEva910vOYDlkcSIoZyLuEx3e+QgYVlI/9u0/0cE0PzwY8BAJK0ze38Rz5pRfErenYRQ/xXZ8uKM4gJZ5C8bYj3RN8yFFs5UL6gbeacaWVrjVPuW+zswTTAxMA0GCWCGSAFlAwQCAQUABCCoXbCueJPh7HqJ7mXzLBbkWP2C3n/PcJd94KJX2rufDQQUn9KR4oRYNugnRaGiJGcSzwEvq7oCAicQ
    
  • KEYSTORE_PASSWORD

    android
    
  • KEYSTORE_KEY_ALIAS

    android
    
  • KEYSTORE_KEY_PASSWORD

    android
    

You can generate a new keystore with keytool -genkeypair -alias android -keypass android -keystore android.keystore -storepass android -keyalg RSA -dname "CN=Android,O=Android,C=US" -validity 9999 and fill secrets with your values.

To encode the keystore, use cat android.keystore | base64 | tr -d '\n' > android.keystore.base64 or do it with any online tool.

Run Workflow

  1. Go to Actions
  2. Select Build FOSS
  3. Select Run workflow then click to green Run workflow button
  4. Wait for the build, it takes approximately 5 minutes

The zipped APK will be attached to the workflow run. Go to Actions, click on the latest workflow run and download it from Artifacts down below