├── .gitignore ├── LICENSE ├── README.md ├── plugin-dev ├── 0_prerequisites.md ├── 1_introduction.md ├── 2_commands.md ├── 3_patching.md ├── 4_settings.md ├── 5_reflection.md ├── 6_finding_discord_stuff.md └── README.md └── theme-dev └── README.md /.gitignore: -------------------------------------------------------------------------------- 1 | .idea 2 | .vscode -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Creative Commons Attribution-NonCommercial 4.0 International 2 | 3 | Creative Commons Corporation ("Creative Commons") is not a law firm and 4 | does not provide legal services or legal advice. Distribution of 5 | Creative Commons public licenses does not create a lawyer-client or 6 | other relationship. Creative Commons makes its licenses and related 7 | information available on an "as-is" basis. Creative Commons gives no 8 | warranties regarding its licenses, any material licensed under their 9 | terms and conditions, or any related information. Creative Commons 10 | disclaims all liability for damages resulting from their use to the 11 | fullest extent possible. 12 | 13 | Using Creative Commons Public Licenses 14 | 15 | Creative Commons public licenses provide a standard set of terms and 16 | conditions that creators and other rights holders may use to share 17 | original works of authorship and other material subject to copyright and 18 | certain other rights specified in the public license below. The 19 | following considerations are for informational purposes only, are not 20 | exhaustive, and do not form part of our licenses. 21 | 22 | - Considerations for licensors: Our public licenses are intended for 23 | use by those authorized to give the public permission to use 24 | material in ways otherwise restricted by copyright and certain other 25 | rights. Our licenses are irrevocable. Licensors should read and 26 | understand the terms and conditions of the license they choose 27 | before applying it. Licensors should also secure all rights 28 | necessary before applying our licenses so that the public can reuse 29 | the material as expected. Licensors should clearly mark any material 30 | not subject to the license. This includes other CC-licensed 31 | material, or material used under an exception or limitation to 32 | copyright. More considerations for licensors : 33 | wiki.creativecommons.org/Considerations_for_licensors 34 | 35 | - Considerations for the public: By using one of our public licenses, 36 | a licensor grants the public permission to use the licensed material 37 | under specified terms and conditions. If the licensor's permission 38 | is not necessary for any reason–for example, because of any 39 | applicable exception or limitation to copyright–then that use is not 40 | regulated by the license. Our licenses grant only permissions under 41 | copyright and certain other rights that a licensor has authority to 42 | grant. Use of the licensed material may still be restricted for 43 | other reasons, including because others have copyright or other 44 | rights in the material. A licensor may make special requests, such 45 | as asking that all changes be marked or described. Although not 46 | required by our licenses, you are encouraged to respect those 47 | requests where reasonable. More considerations for the public : 48 | wiki.creativecommons.org/Considerations_for_licensees 49 | 50 | Creative Commons Attribution-NonCommercial 4.0 International Public 51 | License 52 | 53 | By exercising the Licensed Rights (defined below), You accept and agree 54 | to be bound by the terms and conditions of this Creative Commons 55 | Attribution-NonCommercial 4.0 International Public License ("Public 56 | License"). To the extent this Public License may be interpreted as a 57 | contract, You are granted the Licensed Rights in consideration of Your 58 | acceptance of these terms and conditions, and the Licensor grants You 59 | such rights in consideration of benefits the Licensor receives from 60 | making the Licensed Material available under these terms and conditions. 61 | 62 | - Section 1 – Definitions. 63 | 64 | - a. Adapted Material means material subject to Copyright and 65 | Similar Rights that is derived from or based upon the Licensed 66 | Material and in which the Licensed Material is translated, 67 | altered, arranged, transformed, or otherwise modified in a 68 | manner requiring permission under the Copyright and Similar 69 | Rights held by the Licensor. For purposes of this Public 70 | License, where the Licensed Material is a musical work, 71 | performance, or sound recording, Adapted Material is always 72 | produced where the Licensed Material is synched in timed 73 | relation with a moving image. 74 | - b. Adapter's License means the license You apply to Your 75 | Copyright and Similar Rights in Your contributions to Adapted 76 | Material in accordance with the terms and conditions of this 77 | Public License. 78 | - c. Copyright and Similar Rights means copyright and/or similar 79 | rights closely related to copyright including, without 80 | limitation, performance, broadcast, sound recording, and Sui 81 | Generis Database Rights, without regard to how the rights are 82 | labeled or categorized. For purposes of this Public License, the 83 | rights specified in Section 2(b)(1)-(2) are not Copyright and 84 | Similar Rights. 85 | - d. Effective Technological Measures means those measures that, 86 | in the absence of proper authority, may not be circumvented 87 | under laws fulfilling obligations under Article 11 of the WIPO 88 | Copyright Treaty adopted on December 20, 1996, and/or similar 89 | international agreements. 90 | - e. Exceptions and Limitations means fair use, fair dealing, 91 | and/or any other exception or limitation to Copyright and 92 | Similar Rights that applies to Your use of the Licensed 93 | Material. 94 | - f. Licensed Material means the artistic or literary work, 95 | database, or other material to which the Licensor applied this 96 | Public License. 97 | - g. Licensed Rights means the rights granted to You subject to 98 | the terms and conditions of this Public License, which are 99 | limited to all Copyright and Similar Rights that apply to Your 100 | use of the Licensed Material and that the Licensor has authority 101 | to license. 102 | - h. Licensor means the individual(s) or entity(ies) granting 103 | rights under this Public License. 104 | - i. NonCommercial means not primarily intended for or directed 105 | towards commercial advantage or monetary compensation. For 106 | purposes of this Public License, the exchange of the Licensed 107 | Material for other material subject to Copyright and Similar 108 | Rights by digital file-sharing or similar means is NonCommercial 109 | provided there is no payment of monetary compensation in 110 | connection with the exchange. 111 | - j. Share means to provide material to the public by any means or 112 | process that requires permission under the Licensed Rights, such 113 | as reproduction, public display, public performance, 114 | distribution, dissemination, communication, or importation, and 115 | to make material available to the public including in ways that 116 | members of the public may access the material from a place and 117 | at a time individually chosen by them. 118 | - k. Sui Generis Database Rights means rights other than copyright 119 | resulting from Directive 96/9/EC of the European Parliament and 120 | of the Council of 11 March 1996 on the legal protection of 121 | databases, as amended and/or succeeded, as well as other 122 | essentially equivalent rights anywhere in the world. 123 | - l. You means the individual or entity exercising the Licensed 124 | Rights under this Public License. Your has a corresponding 125 | meaning. 126 | 127 | - Section 2 – Scope. 128 | 129 | - a. License grant. 130 | - 1. Subject to the terms and conditions of this Public 131 | License, the Licensor hereby grants You a worldwide, 132 | royalty-free, non-sublicensable, non-exclusive, irrevocable 133 | license to exercise the Licensed Rights in the Licensed 134 | Material to: 135 | - A. reproduce and Share the Licensed Material, in whole 136 | or in part, for NonCommercial purposes only; and 137 | - B. produce, reproduce, and Share Adapted Material for 138 | NonCommercial purposes only. 139 | - 2. Exceptions and Limitations. For the avoidance of doubt, 140 | where Exceptions and Limitations apply to Your use, this 141 | Public License does not apply, and You do not need to comply 142 | with its terms and conditions. 143 | - 3. Term. The term of this Public License is specified in 144 | Section 6(a). 145 | - 4. Media and formats; technical modifications allowed. The 146 | Licensor authorizes You to exercise the Licensed Rights in 147 | all media and formats whether now known or hereafter 148 | created, and to make technical modifications necessary to do 149 | so. The Licensor waives and/or agrees not to assert any 150 | right or authority to forbid You from making technical 151 | modifications necessary to exercise the Licensed Rights, 152 | including technical modifications necessary to circumvent 153 | Effective Technological Measures. For purposes of this 154 | Public License, simply making modifications authorized by 155 | this Section 2(a)(4) never produces Adapted Material. 156 | - 5. Downstream recipients. 157 | - A. Offer from the Licensor – Licensed Material. Every 158 | recipient of the Licensed Material automatically 159 | receives an offer from the Licensor to exercise the 160 | Licensed Rights under the terms and conditions of this 161 | Public License. 162 | - B. No downstream restrictions. You may not offer or 163 | impose any additional or different terms or conditions 164 | on, or apply any Effective Technological Measures to, 165 | the Licensed Material if doing so restricts exercise of 166 | the Licensed Rights by any recipient of the Licensed 167 | Material. 168 | - 6. No endorsement. Nothing in this Public License 169 | constitutes or may be construed as permission to assert or 170 | imply that You are, or that Your use of the Licensed 171 | Material is, connected with, or sponsored, endorsed, or 172 | granted official status by, the Licensor or others 173 | designated to receive attribution as provided in Section 174 | 3(a)(1)(A)(i). 175 | - b. Other rights. 176 | - 1. Moral rights, such as the right of integrity, are not 177 | licensed under this Public License, nor are publicity, 178 | privacy, and/or other similar personality rights; however, 179 | to the extent possible, the Licensor waives and/or agrees 180 | not to assert any such rights held by the Licensor to the 181 | limited extent necessary to allow You to exercise the 182 | Licensed Rights, but not otherwise. 183 | - 2. Patent and trademark rights are not licensed under this 184 | Public License. 185 | - 3. To the extent possible, the Licensor waives any right to 186 | collect royalties from You for the exercise of the Licensed 187 | Rights, whether directly or through a collecting society 188 | under any voluntary or waivable statutory or compulsory 189 | licensing scheme. In all other cases the Licensor expressly 190 | reserves any right to collect such royalties, including when 191 | the Licensed Material is used other than for NonCommercial 192 | purposes. 193 | 194 | - Section 3 – License Conditions. 195 | 196 | Your exercise of the Licensed Rights is expressly made subject to 197 | the following conditions. 198 | 199 | - a. Attribution. 200 | - 1. If You Share the Licensed Material (including in modified 201 | form), You must: 202 | - A. retain the following if it is supplied by the 203 | Licensor with the Licensed Material: 204 | - i. identification of the creator(s) of the Licensed 205 | Material and any others designated to receive 206 | attribution, in any reasonable manner requested by 207 | the Licensor (including by pseudonym if designated); 208 | - ii. a copyright notice; 209 | - iii. a notice that refers to this Public License; 210 | - iv. a notice that refers to the disclaimer of 211 | warranties; 212 | - v. a URI or hyperlink to the Licensed Material to 213 | the extent reasonably practicable; 214 | - B. indicate if You modified the Licensed Material and 215 | retain an indication of any previous modifications; and 216 | - C. indicate the Licensed Material is licensed under this 217 | Public License, and include the text of, or the URI or 218 | hyperlink to, this Public License. 219 | - 2. You may satisfy the conditions in Section 3(a)(1) in any 220 | reasonable manner based on the medium, means, and context in 221 | which You Share the Licensed Material. For example, it may 222 | be reasonable to satisfy the conditions by providing a URI 223 | or hyperlink to a resource that includes the required 224 | information. 225 | - 3. If requested by the Licensor, You must remove any of the 226 | information required by Section 3(a)(1)(A) to the extent 227 | reasonably practicable. 228 | - 4. If You Share Adapted Material You produce, the Adapter's 229 | License You apply must not prevent recipients of the Adapted 230 | Material from complying with this Public License. 231 | 232 | - Section 4 – Sui Generis Database Rights. 233 | 234 | Where the Licensed Rights include Sui Generis Database Rights that 235 | apply to Your use of the Licensed Material: 236 | 237 | - a. for the avoidance of doubt, Section 2(a)(1) grants You the 238 | right to extract, reuse, reproduce, and Share all or a 239 | substantial portion of the contents of the database for 240 | NonCommercial purposes only; 241 | - b. if You include all or a substantial portion of the database 242 | contents in a database in which You have Sui Generis Database 243 | Rights, then the database in which You have Sui Generis Database 244 | Rights (but not its individual contents) is Adapted Material; 245 | and 246 | - c. You must comply with the conditions in Section 3(a) if You 247 | Share all or a substantial portion of the contents of the 248 | database. 249 | 250 | For the avoidance of doubt, this Section 4 supplements and does not 251 | replace Your obligations under this Public License where the 252 | Licensed Rights include other Copyright and Similar Rights. 253 | 254 | - Section 5 – Disclaimer of Warranties and Limitation of Liability. 255 | 256 | - a. Unless otherwise separately undertaken by the Licensor, to 257 | the extent possible, the Licensor offers the Licensed Material 258 | as-is and as-available, and makes no representations or 259 | warranties of any kind concerning the Licensed Material, whether 260 | express, implied, statutory, or other. This includes, without 261 | limitation, warranties of title, merchantability, fitness for a 262 | particular purpose, non-infringement, absence of latent or other 263 | defects, accuracy, or the presence or absence of errors, whether 264 | or not known or discoverable. Where disclaimers of warranties 265 | are not allowed in full or in part, this disclaimer may not 266 | apply to You. 267 | - b. To the extent possible, in no event will the Licensor be 268 | liable to You on any legal theory (including, without 269 | limitation, negligence) or otherwise for any direct, special, 270 | indirect, incidental, consequential, punitive, exemplary, or 271 | other losses, costs, expenses, or damages arising out of this 272 | Public License or use of the Licensed Material, even if the 273 | Licensor has been advised of the possibility of such losses, 274 | costs, expenses, or damages. Where a limitation of liability is 275 | not allowed in full or in part, this limitation may not apply to 276 | You. 277 | - c. The disclaimer of warranties and limitation of liability 278 | provided above shall be interpreted in a manner that, to the 279 | extent possible, most closely approximates an absolute 280 | disclaimer and waiver of all liability. 281 | 282 | - Section 6 – Term and Termination. 283 | 284 | - a. This Public License applies for the term of the Copyright and 285 | Similar Rights licensed here. However, if You fail to comply 286 | with this Public License, then Your rights under this Public 287 | License terminate automatically. 288 | - b. Where Your right to use the Licensed Material has terminated 289 | under Section 6(a), it reinstates: 290 | 291 | - 1. automatically as of the date the violation is cured, 292 | provided it is cured within 30 days of Your discovery of the 293 | violation; or 294 | - 2. upon express reinstatement by the Licensor. 295 | 296 | For the avoidance of doubt, this Section 6(b) does not affect 297 | any right the Licensor may have to seek remedies for Your 298 | violations of this Public License. 299 | 300 | - c. For the avoidance of doubt, the Licensor may also offer the 301 | Licensed Material under separate terms or conditions or stop 302 | distributing the Licensed Material at any time; however, doing 303 | so will not terminate this Public License. 304 | - d. Sections 1, 5, 6, 7, and 8 survive termination of this Public 305 | License. 306 | 307 | - Section 7 – Other Terms and Conditions. 308 | 309 | - a. The Licensor shall not be bound by any additional or 310 | different terms or conditions communicated by You unless 311 | expressly agreed. 312 | - b. Any arrangements, understandings, or agreements regarding the 313 | Licensed Material not stated herein are separate from and 314 | independent of the terms and conditions of this Public License. 315 | 316 | - Section 8 – Interpretation. 317 | 318 | - a. For the avoidance of doubt, this Public License does not, and 319 | shall not be interpreted to, reduce, limit, restrict, or impose 320 | conditions on any use of the Licensed Material that could 321 | lawfully be made without permission under this Public License. 322 | - b. To the extent possible, if any provision of this Public 323 | License is deemed unenforceable, it shall be automatically 324 | reformed to the minimum extent necessary to make it enforceable. 325 | If the provision cannot be reformed, it shall be severed from 326 | this Public License without affecting the enforceability of the 327 | remaining terms and conditions. 328 | - c. No term or condition of this Public License will be waived 329 | and no failure to comply consented to unless expressly agreed to 330 | by the Licensor. 331 | - d. Nothing in this Public License constitutes or may be 332 | interpreted as a limitation upon, or waiver of, any privileges 333 | and immunities that apply to the Licensor or You, including from 334 | the legal processes of any jurisdiction or authority. 335 | 336 | Creative Commons is not a party to its public licenses. Notwithstanding, 337 | Creative Commons may elect to apply one of its public licenses to 338 | material it publishes and in those instances will be considered the 339 | "Licensor." The text of the Creative Commons public licenses is 340 | dedicated to the public domain under the CC0 Public Domain Dedication. 341 | Except for the limited purpose of indicating that material is shared 342 | under a Creative Commons public license or as otherwise permitted by the 343 | Creative Commons policies published at creativecommons.org/policies, 344 | Creative Commons does not authorize the use of the trademark "Creative 345 | Commons" or any other trademark or logo of Creative Commons without its 346 | prior written consent including, without limitation, in connection with 347 | any unauthorized modifications to any of its public licenses or any 348 | other arrangements, understandings, or agreements concerning use of 349 | licensed material. For the avoidance of doubt, this paragraph does not 350 | form part of the public licenses. 351 | 352 | Creative Commons may be contacted at creativecommons.org. 353 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 |

Aliucord - Development Docs

2 |

3 | 4 | Discord 5 | 6 |

7 | 8 | ### [Plugin Documentation](/plugin-dev) 9 | [Plugin Installation](https://github.com/Aliucord/Aliucord/blob/main/README.md#-plugin-installation) - [Request Plugin](https://github.com/Aliucord/plugin-requests/issues/new?template=plugin_request.yml) 10 | ### [Theming Documentation](/theme-dev) 11 | [Theme Installation](https://github.com/Vendicated/AliucordPlugins/tree/main/Themer) 12 | -------------------------------------------------------------------------------- /plugin-dev/0_prerequisites.md: -------------------------------------------------------------------------------- 1 | # Prerequisites 2 | 3 | - PC 4 | - Knowledge of Java/Kotlin, Android, adb and git 5 | - [Android Studio](https://developer.android.com/studio) - While you can technically make plugins with any IDE, Android Studio is by far the easiest and most convenient as it manages many things for you 6 | - [Java SDK](https://jdk.java.net/16/) - Comes with Android Studio 7 | - [Android Platform Tools](https://developer.android.com/studio/releases/platform-tools) - Comes with Android Studio 8 | - [Git](https://git-scm.com/downloads) 9 | - [Jadx](https://github.com/Juby210/jadx) - This is used to decompile the Discord apks to human readable java files 10 | -------------------------------------------------------------------------------- /plugin-dev/1_introduction.md: -------------------------------------------------------------------------------- 1 | # Introduction 2 | 3 | ## Basic Plugin Structure 4 | 5 | Every plugin must extend the plugin class and be [annotated](https://docs.oracle.com/javase/tutorial/java/annotations/) 6 | with the @AliucordPlugin annotation 7 | 8 | Plugins have a few life cycle methods: 9 | - `load(Context)`: called whenever your plugin is loaded. Do initialisation here 10 | - `unload(Context)`: called whenever your plugin is unloaded 11 | - `start(Context)`: called whenever your plugin is started. Register commands or patches here 12 | - `stop(Context)`: called whenever your plugin is stopped. Unregister commands or patches here 13 | 14 | Thus, they are called in the order `load -> start -> stop -> unload`. If load or start throws an exception, it will be logged to the debug log 15 | and your plugin will be unloaded. 16 | 17 | Additionally, every plugin class has access to a [CommandsAPI to register commands](2_commands.md), a [PatcherAPI to add patches](3_patching.md) 18 | and a [SettingsAPI to persist data](4_settings.md). You may also register a [custom SettingsTab](4_settings.md#SettingsTab) 19 | 20 | A minimal plugin boilerplate looks like this: 21 | 22 |
23 | Java 24 |
25 | 26 | ```java 27 | package com.yourname.plugins; 28 | 29 | import android.content.Context; 30 | 31 | import com.aliucord.annotations.AliucordPlugin; 32 | import com.aliucord.entities.Plugin; 33 | 34 | @SuppressWarnings("unused") 35 | @AliucordPlugin 36 | public class MyPlugin extends Plugin { 37 | @Override 38 | public void start(Context context) { 39 | 40 | } 41 | 42 | @Override 43 | public void stop(Context context) { 44 | 45 | } 46 | } 47 | ``` 48 |
49 | 50 |
51 | Kotlin 52 |
53 | 54 | ```kt 55 | package com.yourname.plugins 56 | 57 | import android.content.Context 58 | 59 | import com.aliucord.annotations.AliucordPlugin 60 | import com.aliucord.entities.Plugin 61 | 62 | @SuppressWarnings("unused") 63 | @AliucordPlugin 64 | class MyPlugin : Plugin() { 65 | override fun start(context: Context) { 66 | 67 | } 68 | 69 | override fun stop(context: Context) { 70 | 71 | } 72 | } 73 | ``` 74 |
75 | 76 | ## Plugin Template 77 | 78 | A [Plugin Template](https://github.com/Aliucord/plugins-template) is available that has everything set up for you 79 | -------------------------------------------------------------------------------- /plugin-dev/2_commands.md: -------------------------------------------------------------------------------- 1 | # Commands 2 | 3 | Aliucord offers a rich commands api which makes it easy to implement your own commands. It hooks into slash commands so all commands will be 4 | made available along with the regular slash commands. 5 | 6 | ## The basics 7 | 8 | Every plugin has its own [CommandsAPI](https://aliucord.github.io/dokka/html/-aliucord/com.aliucord.api/-commands-a-p-i) 9 | made available as `commands` inside your plugin class. 10 | 11 | You can register commands using `commands.registerCommand(name, description, options, callback)` and unregister 12 | them later either by using `commands.unregisterCommand(commandName)` or via `commands.unregisterAll()`. 13 | Commands should be unique, so please use a meaningful command name that won't overlap with other plugins. 14 | 15 | Commands are run on a separate thread, so you can do heavy work here, send Http Requests, etc... 16 | 17 | Errors are caught and will be presented to the user in a nicely formatted error, but you should still make sure your command never throws errors. 18 | 19 | The callback is a lambda function that gets the CommandContext as only argument and should return a 20 | [CommandResult](https://aliucord.github.io/dokka/html/-aliucord/com.aliucord.api/-commands-a-p-i/-command-result) or null to send no reply. 21 | 22 | Please refer to the [CommandContext Javadoc](https://aliucord.github.io/dokka/html/-aliucord/com.aliucord.entities/-command-context) 23 | for the available methods 24 | 25 | ## CommandOptions 26 | 27 | Command Options are options the user can specify. They can be used to make the user input any text, select from a selection of values, select another user, etc. 28 | These are kind of a mess and take a lot of arguments because they come from Discord. 29 | Simply pass null, Collections.emptyList() or whatever may be suitable. 30 | 31 | Quick rundown (Note: You cannot create CommandChoices yourself, use [Utils.createCommandChoice](https://aliucord.github.io/dokka/html/-aliucord/com.aliucord/-utils/create-command-choice.html)) 32 | ```kt 33 | Utils.createCommandOption( 34 | type: ApplicationCommandType = ApplicationCommandType.STRING, // The type of this option, e.g. String, User or SubCommand 35 | name: String, // The name of this option 36 | description: String? = null, // This will both be shown to the user and be the key of this argument in the callback 37 | descriptionRes: Int? = null, // Resource ID of the description string. If discord has a string you find suitable, use this to have the description be localized, otherwise pass null 38 | required: Boolean = false, // Whether this option is required or not 39 | default: Boolean = false, // Whether this option is the default selected option 40 | channelTypes: List = emptyList(), // Most likely the allowed channels this can be used in, but not certian, recommended to keep this an empty list. 41 | choices: List = emptyList(), // The pre-chosen options that this can be, if it is a STRING option 42 | subCommandOptions: List = emptyList(), // The child subcommand options if applicable 43 | autocomplete: Boolean = false // Currently unknown to exactly what this does, it is recommended to either pass false or ommit this parameter all together. 44 | ): ApplicationCommandOption 45 | ``` 46 | -------------------------------------------------------------------------------- /plugin-dev/3_patching.md: -------------------------------------------------------------------------------- 1 | # Patching 2 | 3 | Aliucord currently uses the [Pine](https://github.com/canyie/pine) java method hook framework for hooking Discord's methods, though in plugins you should always use the XposedBridge wrapper to prepare for future internal code changes. 4 | 5 | You can use it to run your own code before, instead of or after any method of any Discord class 6 | 7 | ## Finding the right method to patch 8 | Refer to [Finding Discord Stuff](6_finding_discord_stuff.md) 9 | 10 | ## Retrieving private fields / calling private methods inside patches 11 | Refer to [Reflection](5_reflection.md) 12 | 13 | ## The Basics 14 | 15 | Every plugin has its own [Patcher](https://aliucord.github.io/dokka/html/-aliucord/com.aliucord.api/-patcher-a-p-i) instance as `patcher` inside your Plugin class 16 | 17 | You can add patches using `patcher.patch(method, methodHook)`. This will return a [Runnable](https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/Runnable.html) 18 | that when invoked will remove the patch again. Alternatively, you can simply use `patcher.unpatchAll()` to remove all patches. 19 | 20 | The `patch` method essentially takes two arguments. A fully qualified method and a [XC_MethodHook](https://api.xposed.info/reference/de/robv/android/xposed/XC_MethodHook.html). 21 | 22 | Assuming you want to patch the `applyMagic` method of the Magician class: 23 | ```java 24 | package com.discord.magic; 25 | 26 | public class Magician { 27 | public void applyMagic(Context context, String kind, int count) { 28 | // Some magical code 29 | } 30 | } 31 | ``` 32 | There are two ways to do so: 33 | 34 | #### Specifying the className, methodName and arguments 35 | 36 |
37 | Java 38 |
39 | 40 | ```java 41 | patcher.patch("com.discord.magic.Magician", "applyMagic", new Class[] { Context.class, String.class, int.class }, myMethodHook); 42 | ``` 43 |
44 | 45 |
46 | Kotlin 47 |
48 | 49 | ```kt 50 | patcher.patch("com.discord.magic.Magician", "applyMagic", arrayOf(Context::class.java, String::class.java, Int::class.javaPrimitiveType), myMethodHook) 51 | ``` 52 |
53 | 54 | #### Retrieving the Method yourself 55 | 56 |
57 | Java 58 |
59 | 60 | ```java 61 | patcher.patch(Magician.class.getDeclaredMethod("applyMagic", Context.class, String.class, int.class), myMethodHook); 62 | ``` 63 |
64 | 65 |
66 | Kotlin 67 |
68 | 69 | ```kt 70 | patcher.patch(Magician::class.java.getDeclaredMethod("applyMagic", Context::class.java, String::class.java, Int::class.javaPrimitiveType), myMethodHook) 71 | // or for convenience one of before, instead or after like so: 72 | patcher.before("applyMagic", ...) { 73 | // receiver (this) is correctly typed magician here now so you could do something like 74 | someMagicianMethod() 75 | } 76 | ``` 77 |
78 | 79 | #### Woah that looks scary D: 80 | 81 | Due to Java's method overloads, there can be multiple methods with the same name but different parameters. Thus, it is necessary to specify the parameter 82 | types of the method. 83 | `.class` here (or `::class.java` if you are using Kotlin) simply retrieves the runtime representation of your class which can be used for [Reflection](https://www.oracle.com/technical-resources/articles/java/javareflection.html). 84 | You basically just need to take the parameters of the desired method and append `.class`/`::class.java` to them! 85 | 86 | ##### Reference: 87 | - [Reflection](https://www.oracle.com/technical-resources/articles/java/javareflection.html) 88 | - [Class / .class](https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/Class.html) 89 | - [Class.getDeclaredMethod](https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/Class.html#getDeclaredMethod(java.lang.String,java.lang.Class...)) 90 | 91 | 92 | ## MethodHooks and MethodHookParams 93 | 94 | The [XC_MethodHook](https://api.xposed.info/reference/de/robv/android/xposed/XC_MethodHook.html) class describes how the method should be patched. 95 | Possible methods are `beforeCall` and `afterCall`. To replace the method you can either use `beforeCall` and set the result or use [XC_MethodReplacement](https://api.xposed.info/reference/de/robv/android/xposed/XC_MethodReplacement.html) 96 | 97 | For convenience, Aliucord provides the 98 | [Hook](https://aliucord.github.io/dokka/html/-aliucord/com.aliucord.patcher/-hook), 99 | [PreHook](https://aliucord.github.io/dokka/html/-aliucord/com.aliucord.patcher/-pre-hook) and 100 | [InsteadHook](https://aliucord.github.io/dokka/html/-aliucord/com.aliucord.patcher/-instead-hook) 101 | classes that take a single lambda method as their only argument. ***These should always be used whenever possible, as it allows aliucord to catch and log errors appropriately.*** 102 | 103 | No matter which patch method you decide for, you will always work with a [MethodHookParam](https://api.xposed.info/reference/de/robv/android/xposed/XC_MethodHook.MethodHookParam.html) 104 | which is essentially a Context object of the method you're patching. It contains the thisObject (the class the method belongs to), the arguments passed to the method, 105 | the result of the method if any and way more. It behaves a bit differently depending on whether this is a prePatch or regular patch: 106 | 107 | | Field/Method name | Description | PrePatch | Normal Patch | 108 | |-------------------|-------------|----------|--------------| 109 | | method | The Method you are patching | - | - | 110 | | thisObject | The class this method belongs too or null if it is a static method | - | - | 111 | | args | All arguments passed to the method | Altering these will pass the altered arguments to the original method | - | 112 | | getResult() | Returns the result of the method | null | The result of the method or null if void | 113 | | setResult(Object) | Sets the result | Will prevent the original method from running | Altered result will be returned to caller | 114 | | getThrowable() | Returns the throwable if the method threw | null | Possible throwable | 115 | | setThrowable(Throwable) | Makes this method throw the specified Throwable | Will prevent the original method from running | You better not crash the app!! | 116 | | resetResult() | Resets result and throwable | No longer prevent original method from running | No longer throw; return null | 117 | | invokeOriginalMethod() | Invokes original method and returns the result | Just use an afterPatch | - | 118 | 119 | ### Some Examples 120 | 121 | #### Everyone is now called Clyde - InsteadHook (returnConstant) 122 | 123 |
124 | Java 125 |
126 | 127 | ```java 128 | import com.aliucord.patcher.InsteadHook; 129 | import com.discord.models.user.CoreUser; 130 | 131 | patcher.patch(CoreUser.class.getDeclaredMethod("getUsername"), InsteadHook.returnConstant("Clyde")); 132 | ``` 133 |
134 | 135 |
136 | Kotlin 137 |
138 | 139 | ```kt 140 | import com.aliucord.patcher.InsteadHook 141 | import com.discord.models.user.CoreUser 142 | 143 | patcher.instead("getUsername") { "Clyde" } 144 | ``` 145 |
146 | 147 | #### Rename all users named Clyde to Evil Clyde - Hook 148 | 149 |
150 | Java 151 |
152 | 153 | ```java 154 | import com.aliucord.patcher.Hook; 155 | import com.discord.models.user.CoreUser; 156 | 157 | patcher.patch(CoreUser.class.getDeclaredMethod("getUsername"), new Hook(methodHookParam -> { 158 | var name = (String) methodHookParam.getResult(); 159 | if (name != null && name.equalsIgnoreCase("Clyde")) methodHookParam.setResult("Evil Clyde"); 160 | }); 161 | ``` 162 |
163 | 164 |
165 | Kotlin 166 |
167 | 168 | ```kt 169 | import com.aliucord.patcher.Hook 170 | import com.discord.models.user.CoreUser 171 | 172 | patcher.after("getUsername") { 173 | val name = it.result as String? 174 | if (name != null && name.equalsIgnoreCase("Clyde")) it.result = "Evil Clyde"; 175 | } 176 | ``` 177 |
178 | 179 | #### Rename specific User - PreHook 180 | 181 |
182 | Java 183 |
184 | 185 | ```java 186 | import com.aliucord.patcher.PreHook; 187 | import com.discord.models.user.CoreUser; 188 | 189 | patcher.patch(CoreUser.class.getDeclaredMethod("getUsername"), new PreHook(methodHookParam -> { 190 | var currentUser = (CoreUser) methodHookParam.thisObject; 191 | long id = currentUser.getId(); 192 | if (id == 343383572805058560L) methodHookParam.setResult("Not Clyde!!"); 193 | }); 194 | ``` 195 |
196 | 197 |
198 | Kotlin 199 |
200 | 201 | ```kt 202 | import com.aliucord.patcher.PreHook 203 | import com.discord.models.user.CoreUser 204 | 205 | patcher.before("getUsername") { 206 | if (id == 343383572805058560L) it.result = "Not Clyde!!"; 207 | } 208 | ``` 209 |
210 | 211 | #### Hide your typing indicator from others - InsteadHook.DO_NOTHING 212 | 213 |
214 | Java 215 |
216 | 217 | ```java 218 | import com.discord.stores.StoreUserTyping; 219 | import top.canyie.pine.callback.InsteadHook; 220 | 221 | patcher.patch(StoreUserTyping.class.getDeclaredMethod("setUserTyping", long.class), InsteadHook.DO_NOTHING); 222 | ``` 223 |
224 | 225 |
226 | Kotlin 227 |
228 | 229 | ```kt 230 | import com.discord.stores.StoreUserTyping 231 | import top.canyie.pine.callback.InsteadHook 232 | 233 | patcher.instead("setUserTyping", Long::class.javaPrimitiveType) { null }; 234 | ``` 235 |
236 | -------------------------------------------------------------------------------- /plugin-dev/4_settings.md: -------------------------------------------------------------------------------- 1 | # Settings 2 | 3 | Every plugin has access to a [SettingsAPI](https://aliucord.github.io/dokka/html/-aliucord/com.aliucord.api/-settings-a-p-i) instance, 4 | made available as `this.settings` inside your plugin class, 5 | which can be used to persist settings. You can store any data structure here: Strings, Integers, Booleans or even Objects (json stringified). 6 | 7 | Setting keys are automatically prefixed with your plugin name to prevent collisions. 8 | 9 | Settings are stored per-plugin inside `/Aliucord/settings/[PluginName].json`. 10 | 11 | If this is undesired, you may manually write to the [Aliucord Path](https://aliucord.github.io/dokka/html/-aliucord/com.aliucord/-constants/-b-a-s-e_-p-a-t-h.html) 12 | or whichever you deem appropriate. Avoid storing huge data structures or raw bytes here. Write those to the cache folder or something similar. 13 | 14 | 15 | ## SettingsTab 16 | 17 | You may want to add a SettingsTab to your plugin, which can be opened by clicking the settings button on your plugin's card in 18 | Aliucord's plugins tab 19 | 20 | To do so, you must simply set `this.settingsTab` to a [SettingsTab](https://aliucord.github.io/dokka/html/-aliucord/com.aliucord.entities/-plugin/-settings-tab). 21 | This can either be a [dedicated page](#Dedicated-Settings-Page) or a [bottomsheet](#Settings-Bottomsheet) 22 | 23 | ## Passing arguments to your SettingsTab 24 | 25 | It may be desired to pass arguments to your SettingsTab, e.g. your plugin's SettingsAPI. 26 | To do so, simply make use of SettingsTab.withArgs: 27 | 28 |
29 | Java 30 |
31 | 32 | ```java 33 | public class MyPlugin extends Plugin { 34 | public MyPlugin() { 35 | settingsTab = new SettingsTab(MySettingsPage.class).withArgs(settings); 36 | } 37 | } 38 | ``` 39 |
40 | 41 |
42 | Kotlin 43 |
44 | 45 | ```kt 46 | class MyPlugin : Plugin() { 47 | init { 48 | settingsTab = SettingsTab(MySettingsPage::class.java).withArgs(settings) 49 | } 50 | } 51 | ``` 52 |
53 | 54 | Then inside your SettingsPage fragment: 55 | 56 |
57 | Java 58 |
59 | 60 | ```java 61 | public class MySettingsPage extends SettingsPage { 62 | private final SettingsAPI mSettings; 63 | 64 | public MySettingsPage(SettingsAPI settings) { 65 | mSettings = settings; 66 | } 67 | } 68 | ``` 69 |
70 | 71 |
72 | Kotlin 73 |
74 | 75 | ```kt 76 | class MySettingsPage(val mSettings: SettingsAPI) : SettingsPage() { 77 | 78 | } 79 | ``` 80 |
81 | 82 | 83 | ## Dedicated Settings Page 84 | 85 | This is a dedicated page that takes up the entire screen. 86 | 87 | To use it, you must extend 88 | [com.aliucord.fragments.SettingsPage](https://aliucord.github.io/dokka/html/-aliucord/com.aliucord.fragments/-settings-page) 89 | and override `onViewBound(View)`. 90 | 91 | You can then create and add Views to the page using 92 | [addView(View)](https://aliucord.github.io/dokka/html/-aliucord/com.aliucord.fragments/-settings-page/add-view.html) 93 | 94 | 95 | ## Settings Bottomsheet 96 | 97 | This is a sheet that takes up the bottom portion of the screen (e.g. the actions sheet when long pressing a message or user profiles). 98 | 99 | To use it, you must extend [com.aliucord.widgets.BottomSheet](https://aliucord.github.io/dokka/html/-aliucord/com.aliucord.widgets/-bottom-sheet) 100 | and override `onViewCreated(view: View, bundle: Bundle)`. 101 | 102 | You can then create and add Views to the bottomsheet using 103 | [addView(View)](https://aliucord.github.io/dokka/html/-aliucord/com.aliucord.widgets/-bottom-sheet/add-view.html) 104 | -------------------------------------------------------------------------------- /plugin-dev/5_reflection.md: -------------------------------------------------------------------------------- 1 | # Accessing private fields or methods using Reflection 2 | 3 | This part of the guide should be used when a field or method you want to use/access is not public. There are two ways to get around non-public fields/methods. 4 | 5 | ## Access methods 6 | 7 | Sometimes, the method or field will have a static "access method" that allows you to access the private method or field from outside of the class. They are usually named something along the lines of `access$_______`, with the blank being the field or method name. They take in an instance of the class as the first argument, and any other method arguments should you be "accessing" a method. 8 | 9 | > Note: The examples below were taken from decompiled discord code at the time of writing this guide. 10 | 11 |
12 | Field example 13 |
14 | 15 | ```java 16 | public static final int access$getToolbarHeight$p(WidgetMedia widgetMedia) { 17 | return widgetMedia.toolbarHeight; 18 | } 19 | ``` 20 | This example method allows you to get the toolbarHeight field of WidgetMedia. It takes in a `WidgetMedia` instance and returns the toolbarHight. 21 |
22 | 23 |
24 | Method example 25 |
26 | 27 | ```java 28 | public static final void access$handlePlayerEvent(WidgetMedia widgetMedia, AppMediaPlayer.Event event) { 29 | widgetMedia.handlePlayerEvent(event); 30 | } 31 | ``` 32 | This example allows you to call the handlePlayerEvent of `WidgetMedia`, which is normally private. It simply takes 33 | 1. The instance of `WidgetMedia` 34 | 2. The argument to pass to handlePlayerEvent 35 | 36 |
37 | 38 | To use these, simply call the method. If you are using kotlin, you have to wrap the function name in backticks, like so: 39 | ```kt 40 | WidgetMedia.`access$handlePlayerEvent`(widgetMedia, event) 41 | ``` 42 | These sort of methods should be used before trying reflection, as reflection is slow and should only be used when absolutely needed. 43 | 44 | ## Reflection 45 | 46 | If the above is not possible, you can use reflection to access non-public methods/fields. Examples for both java and kotlin are shown below. 47 | 48 |
49 | Java (method) 50 |
51 | 52 | ```java 53 | // Get the method 54 | var method = ClassName.class.getDeclaredMethod("methodName"); 55 | // Make it "accessible" 56 | method.setAccessible(true); 57 | // Invoke it 58 | // Note: if the method takes any arguments then add them after the classInstance argument. 59 | // Additionally, if the method is static then just pass null for the classInstance. 60 | var result = method.invoke(classInstance); 61 | ``` 62 |
63 | 64 |
65 | Java (field) 66 |
67 | 68 | ```java 69 | // Get the field 70 | var field = ClassName.class.getDeclaredField("fieldName"); 71 | // Make it "accessible" 72 | field.setAccessible(true); 73 | // Get value 74 | // Note: if the field is static then just pass null for the classInstance. 75 | var value = field.get(classInstance); 76 | ``` 77 |
78 | 79 |
80 | Kotlin (method) 81 |
82 | 83 | ```kt 84 | // Get the method 85 | val method = ClassName::class.java.getDeclaredMethod("methodName").apply { 86 | isAccessible = true // Make it "accessible" 87 | } 88 | // Invoke it 89 | // Note: if the method takes any arguments then add them after the classInstance argument. 90 | // Additionally, if the method is static then just pass null for the classInstance. 91 | val result = method.invoke(classInstance) 92 | ``` 93 |
94 | 95 |
96 | Kotlin (field) 97 |
98 | 99 | ```kt 100 | // Get the field 101 | val field = ClassName::class.java.getDeclaredField("fieldName").apply { 102 | isAccessible = true // Make it "accessible" 103 | } 104 | // Get value 105 | // Note: if the field is static then just pass null for the classInstance. 106 | val value = field.get(classInstance) 107 | ``` 108 |
109 | -------------------------------------------------------------------------------- /plugin-dev/6_finding_discord_stuff.md: -------------------------------------------------------------------------------- 1 | # Finding Discord Stuff 2 | 3 | TODO -------------------------------------------------------------------------------- /plugin-dev/README.md: -------------------------------------------------------------------------------- 1 | # Aliucord Plugin Development 2 | 3 | You can develop plugins in either Java or Kotlin. Kotlin is a lot more convenient and has many utility methods that 4 | make your life a lot easier, but it may be better to start with Java if you don't know anything about either of them. 5 | 6 | This documentation will only cover the basics. If something isn't covered by it, try looking at the source code of other plugins to 7 | see how they do things. 8 | 9 | Feel free to open a pull request to make this documentation better! 10 | 11 | 1. [Introduction](1_introduction.md) 12 | 2. [Commands](2_commands.md) 13 | 3. [Patches](3_patching.md) 14 | 4. [Settings](4_settings.md) 15 | 5. [Accessing private fields or methods using Reflection](5_reflection.md) 16 | 6. [Find your way around Discords code](6_finding_discord_stuff.md) -------------------------------------------------------------------------------- /theme-dev/README.md: -------------------------------------------------------------------------------- 1 | # Themer Documentation 2 | 3 |
4 | Table of Contents 5 | 6 | ___ 7 | 1. [Small Introduction](#small-introduction) 8 | 1. [Creating a Simple Theme](#creating-a-simple-theme) 9 | 2. [Main Strings](#main-strings) 10 | 1. [Manifest Strings](#manifest-strings) 11 | 2. [Background Image Strings](#background-image-strings) 12 | 3. [Font Strings](#font-strings) 13 | 4. [Allowed URLs](#allowed-urls) 14 | 3. [Simple Strings](#simple-strings) 15 | 4. [Accent Strings](#accent-strings) 16 | 5. [Primary Strings](#primary-strings) 17 | 1. [General Strings](#general-strings) 18 | 6. [uikit Strings](#uikit-strings) 19 | 7. [Drawable Strings](#drawable-strings) 20 | 8. [Material You](#material-you) 21 | 1. [Getting Started](#getting-started) 22 | 2. [Adding Material You Colors](#adding-material-you-colors) 23 | 9. [Random Things](#random-things) 24 | 1. [Advanced Resources](#advanced-resources) 25 | 2. [Light Mode Theming](#light-mode-theming) 26 | 10. [Troubleshooting](#troubleshooting) 27 | ___ 28 |
29 | 30 | Welcome to the Documentation for the [Themer Plugin](https://github.com/Vendicated/AliucordPlugins/tree/main/Themer) 31 | > Some things may apply to the [XPosed Module](https://github.com/Aliucord/DiscordThemer) too 32 | 33 | ## Small Introduction 34 | 35 | **DIRECTLY MODIFY THE JSON FILE AT YOUR OWN RISK** 36 | 37 | 38 | ### Creating a Simple Theme 39 | 40 | * Start by making a new Theme inside of the Themer plugin settings, give it a name and it will set Version, and Author (you) automatically for you. 41 | * You will see multiple categories, choose the simple colors category and click on the + icon to add a new string. Add a `background` string and give it some color by clicking on it. 42 | * Save, then select restart to see how it looks! 43 | 44 | 45 | 46 | ## Main Strings 47 | 48 | > Strings used for the plugin to tell the user what the name of the Theme is, Author, Version, License, etc but also things like custom font and custom background 49 | 50 | 51 | ### Manifest Strings 52 | 53 | Used to show name of the theme, author, etc. They are in the "manifest" section of the .json 54 | ```json 55 | { 56 | "name": "the theme name", 57 | "author": "authors name", 58 | "license": "license, ask if you want to add one but dont know how to or what license to choose in #theme-development", 59 | "version": "this is the verion number, do not use text for updater", 60 | "updater": "this is where you put your raw.githubusercontent.com link, if you ever want to update your theme just bump the version number up" 61 | } 62 | ``` 63 | If done correctly it should look similar to this in the .JSON 64 | ![image](https://user-images.githubusercontent.com/84905506/132266565-ff27a087-4e36-48ca-baca-2a1d823939fd.png) 65 | 66 | 67 | 68 | 69 | ### Background Image Strings 70 | 71 | These are the strings for adding a background and also giving it transparency (alpha). They are in the "background" section of the .json 72 | 73 | **Warning: Your Background won't be visible unless you enable transparency!** 74 | ```json 75 | { 76 | "url": "url for the bg image", 77 | "overlay_alpha": "background transparency, goes from 0 to 255, 0 being fully transparent while 255 being fully opaque", 78 | "blur_radius": "background blur, goes from 0 to 25, 0 being no blur and 25 a lot of blur. yep I cant tell you better" 79 | } 80 | ``` 81 | If done correctly it should look similar to this in the .JSON 82 | ![image](https://user-images.githubusercontent.com/84905506/132266685-eaa4cca8-9d49-449a-bf8b-c17acc9d3270.png) 83 | 84 | 85 | ### Font Strings 86 | 87 | The string for the font URL. The string is in the "fonts" section of the .json. 88 | 89 | ```json 90 | { 91 | "*": "This changes the font globally", 92 | "ginto_bold": "changes categories, channel names, and headers in user settings", 93 | "ginto_medium": "changes user settings category names, and the channel name in the member list", 94 | "ginto_regular": "changes nothing for me, you can test it if you want", 95 | "roboto_medium_numbers": "changes nothing for me, you can test it if you want", 96 | "sourcecodepro_semibold": "changes nothing for me, you can test it if you want", 97 | "whitney_bold": "changes server template names, and Invite should look like this", 98 | "whitney_medium": "changes message text, channel names, button names, etc", 99 | "whitney_semibold": "changes selected channel name, DM List names, etc" 100 | } 101 | ``` 102 | If done correctly it should look similar to this in the .JSON 103 | ![image](https://user-images.githubusercontent.com/84905506/132266358-3d8e34da-622d-49d9-b74a-d7dd1d413ee6.png) 104 | 105 | 106 | 107 | ### Allowed URLs 108 | Only the links listed below are accepted for external resources. Other links will refuse to load. 109 | This is for security and privacy reasons. 110 | 111 | Note: Due to discord having their cdn require authentication, **using `cdn.discordapp.com` and `media.discordapp.net` links will no longer work.** 112 | * github.com 113 | * raw.githubusercontent.com 114 | * gitlab.com 115 | * i.imgur.com 116 | * i.ibb.co 117 | 118 | 119 | 120 | ## Simple Strings 121 | 122 | These are provided by the plugin (or Xposed module). They theme many things at once for convenience. 123 | 124 | > **Normal strings will take priority over simple strings!** 125 | 126 | | String | Purpose | 127 | | --------- | :----------------------- | 128 | | background | Main backgrounds | 129 | | background_secondary | Secondary backgrounds | 130 | | mention_highlight | Mention highlight on message pings/replies | 131 | | active_channel | Selected channel | 132 | | statusbar | Status bar (where notifications, bluetooth, battery, etc... icons are located) | 133 | | input_background | Background of input boxes (Discord login, search box, etc...) | 134 | | blocked_bg | Background of blocked messages | 135 | 136 | **If you'd like to know what groups of strings are changed by the strings shown above view [this](https://github.com/Vendicated/AliucordPlugins/blob/1d7ba8900ad6d4cfb17e6be670e273a8b9cee212/Themer/src/main/kotlin/dev/vendicated/aliucordplugs/themer/Constants.kt#L71#135).** 137 | 138 | 139 | 140 | ## Accent Strings 141 | 142 | > **Accent strings are used mostly for brand colors.** 143 | 144 | 145 | | String | Purpose | 146 | | ---------------- |:-----------------------:| 147 | | brand_new up to 900 | New brand Colors | 148 | | brand_new | Accent color | 149 | | brand_500_alpha_20 | Channel / User mention background | 150 | | brand_new_260 | Channel / User mention text | 151 | | brand_new_360 | Cursor color, nitro text color in the settings, turned on switch, etc... | 152 | | brand_new_500 | Bot Tag | 153 | | brand_new_560 | Reaction clicked border | 154 | | link | Link colors | 155 | | link_500 | File upload link color | 156 | 157 | 158 | 159 | 160 | ## Primary Strings 161 | 162 | > **Primary dark strings are used for main elements of discord, such as buttons, text and backgrounds.** 163 | 164 | | String | Purpose | 165 | | ---------------- |:-----------------------:| 166 | | primary_dark_100 | Chat scrollbar | 167 | | primary_dark_200 | Chat text color | 168 | | primary_dark_300 | Attachments and emotes icon, DMs button, Discord navigation button colors, top bar icons, Search & Settings icon in the member list, Text underneath icons in the member list, role names in Members list, server name color in the emotes list, and icons for default emotes. | 169 | | primary_dark_330 | Timestamps, New day divider, "Message #..." color, UserDetails text, User status (friends list, DMs list) "All Servers" text in Recent Mentions, Text input placeholder (DMs, Themer) 170 | | primary_dark_360 | Channel list text & Categories, "Counters" text | 171 | | primary_dark_400 | User statuses, TextInput placeholders (chat, searchbars), Server / Category name in search tab, | 172 | | primary_dark_600 | Chat background & Members List background | 173 | | primary_dark_630 | Channel list background, Channel header background, Member list header background, Discord emoji keyboard background, User profile background, "is typing..." background, Create server background | 174 | | primary_dark_660 | Chatbox, Gifts & Attachment icon backgrounds | 175 | | primary_dark_700 | Server list | 176 | | primary_dark_800 | The bottom bar that houses friends, search, mentions, and profile picture icons | 177 | 178 | 179 | 180 | ### General Strings 181 | 182 | > **General Strings are used mostly used for smaller things, such as toasts and other text colors.** 183 | 184 | | String | Purpose | 185 | | ---------------- |:-----------------------:| 186 | | black_alpha_10 | Image color border | 187 | | primary_300 | Unrevealed spoiler text background, default role color in the "Roles" menu | 188 | | primary_600 | Server folders | 189 | | primary_630 | Code block & Monospaced text background color | 190 | | primary_660 | Code block border line color | 191 | | primary_700 | Status (Notifications) bar, Embed background, Top Bar, DMs button, Server streaming icons, Themer bottom bar background, Server name text shadow | 192 | | primary_700_alpha_60 | Embed border colour, Share sheet selected channel background. [Image](https://i.imgur.com/mLNuJ77.jpeg) | 193 | | black_alpha_80 | Server name text shadow (with server banner) | 194 | | white | Server title (with server banner,) White text in the color picker for plugins | 195 | | white_500 | Unread channels, Server title (overrides white if added after it), Active channel text, Channel name text (chat, member list) Default username color, white icons in various buttons, text in toast messages, channel name in channel description, "Invite Members" text, etc... | 196 | | white_800 | Pop-up message background (for example when you mute a channel) | 197 | | abc_tint_switch_track | Changes disabled switch track colour | 198 | | transparent | Inactive button of (Emoji/Gif/Stickers) and events (event info/interested) button backgrounds, when there is no internet status bar color in main screens, embedded image alpha background | 199 | | dim_foreground_material_light | Prompt background when aliucord needs a restart | 200 | | status_grey_200 | Typing indicator three dots | 201 | 202 | 203 | 204 | ## UIKit Strings 205 | 206 | > **UIKit strings are used for brand colors that aren't blurple, along with text and buttons.** 207 | 208 | | String | Purpose | 209 | | ---------------- |:-----------------------:| 210 | | uikit_btn_bg_color_selector_brand | Settings button color in plugins list and other areas | 211 | | uikit_btn_bg_color_selector_green | Online icon color, add servers button in the server list, in "Invite Members" page invite button outline and text color, add friend text colour, live events button background, "Active now"/"live event" text and blob, in Privacy & Safety "Keep me safe" text | 212 | | uikit_btn_bg_color_selector_red | Ping color, Uninstall button on the plugins page, and the "NEW MESSAGES" text in chat | 213 | | uikit_settings_item_text_color_dark | Secondary text color | 214 | | uikit_settings_item_text_color_light | Changes the color of the 'Invite Members' button, background of streaming icon located on the server icon, background of events icon, text placeholder blobs when the members list is loading, some buttons in context menus, and tabs (best seen in the server event menu), input box background (excluding aliucord plugins input boxes) | 215 | 216 | 217 | 218 | ## Drawable Strings 219 | 220 | > **Drawable strings are icons / images you see throughout discord.** 221 | 222 | | String | Purpose | 223 | | ---------------- |:-----------------------:| 224 | | drawable_button_grey | "New Unreads" button | 225 | | drawable_open_folder_dark | Open folder 226 | | drawable_overlay_channels_selected_dark | Selected channel color in channel list for dark mode | 227 | | drawable_overlay_channels_pressed_dark | Pressed channel color in channel list for dark mode | 228 | | item_background_material | Mostly used for the top bar (where the name of the plugin, version and author name is written) | 229 | | design_bottom_navigation_item_background | Is mainly for the bottom part of the plugin page (where description is, uninstall and settings). Also themes search box in plugins page | 230 | | drawable_button_red | The red NEW↑ in the guild list when you get a ping in a guild | 231 | | drawable_voice_indicator_speaking | Color of the ring around a profile picture when voice activity is detected | 232 | | drawable_voice_user_background_speaking | Speaking background | 233 | | drawable_voice_sensitivity_progress | Voice sensitivity bar in the settings | 234 | | ic_ban_red_24dp | Ban icon Color | 235 | | ic_sidebar_notifications_off_dark_24dp | Notification icon in the sidebar when the channel is muted | 236 | | ic_sidebar_notifications_on_dark_24dp | Notification icon in the sidebar when the channel isn't muted | 237 | | ic_thread | Threads icon color located in the sidebar | 238 | | ic_thread_locked | Locked threads icon in the sidebar | 239 | | ic_thread_nsfw | NSFW threads icon in the sidebar | 240 | | ic_channel_topic_ellipsis_dark | Expand button in the channel sidebar | 241 | | ic_content_copy_white_a60_24dp | Copy id icon | 242 | | ic_file_download_white_24dp | Download icon for images or regular files | 243 | | ic_open_in_browser_white_24dp | Open media in browser icon | 244 | | ic_share_white_a60_24dp | Share image icon | 245 | | ic_visibility_white_24dp | Mark as read icon | 246 | | ic_thread_white_24dp | Threads icon when you hold down a channel | 247 | | ic_notifications_settings_white_a60_24dp | Notifications settings icon when you hold down a channel | 248 | | ic_account_circle_white_a60_24dp | Profile icon when you hold down a Direct Message | 249 | | icon_save | Icon when saving a theme with themer | 250 | 251 | 252 | 253 | ### Channel Icons 254 | 255 | 256 | > **Themes the channel icon found at the top bar next to the channel name.** 257 | 258 | 259 | | String | Purpose | 260 | | ---------------- |:-----------------------:| 261 | | ic_channel_text | Regular text channel | 262 | | ic_channel_locked | Locked Channel | 263 | | ic_channel_nsfw | NSFW Channel | 264 | | ic_channel_announcements | Regular Announcements channel | 265 | | ic_channel_announcements_locked | Locked Announcements channel | 266 | | ic_channel_announcements_nsfw | NSFW Announcements channel | 267 | | ic_channel_announcements_thread | Announcements channel with a thread | 268 | | ic_channel_announcements_thread_locked | Locked announcements channel with a thread | 269 | | ic_channel_announcements_thread_nsfw | NSFW announcements channel with a thread | 270 | | ic_channel_pinned_message | Pin icon in the sidebar on any channel | 271 | | ic_channel_voice | Voice channel icon in the sidebar | 272 | | ic_channel_voice_locked | Locked voice channel icon in the sidebar | 273 | 274 | 275 | 276 | 277 | ### Media Icons 278 | 279 | > **Themes the connection icons found under user's about me.** 280 | 281 | | String | Purpose | 282 | | ---------------- |:-----------------------:| 283 | | ic_account_github_white_24dp | Github | 284 | | ic_account_steam_white_24dp | Steam | 285 | | ic_account_twitter_light_and_dark_24dp | Twitter | 286 | | ic_account_twitch_light_and_dark_24dp | Twitch | 287 | | ic_account_spotify_light_and_dark_24dp | Spotify | 288 | | ic_account_youtube_light_and_dark_24dp | YouTube | 289 | | ic_account_reddit_light_and_dark_24dp | Reddit | 290 | | ic_account_xbox_white_24dp | Xbox | 291 | | ic_account_playstation_white_24dp | Playstation | 292 | | ic_account_battlenet_light_and_dark_24dp | Battlenet | 293 | 294 | 295 | 296 | ## Material You 297 | 298 | > Material You is a new project by Google that tries to unify android themeing and make one global style that applies to all apps. 299 | It was added in Android 12, so you will need Android 12. [Learn more](https://material.io/blog/announcing-material-you) 300 | 301 | > The themer plugin has support for it, allowing you to make themes that adapt to your system. 302 | 303 | > This requires directly modifying the JSON file, so you will have to familiarise yourself with JSON. 304 | 305 | 306 | #### Getting Started 307 | 308 | You are advised to [install this app](https://play.google.com/store/apps/details?id=com.ch3d.material.color), which will allow you to see all colors generated by Material You. 309 | 310 | Open the Themer plugin menu and create a theme. This creates the JSON file that you will use for adding Material You values. 311 | In the Themer plugin add random colors to all the UI elements you'd like to change (this saves time later in the process). 312 | 313 | Now that you have that, open the JSON file in your preferred text editor then move on to the next section. 314 | ##### Suggested editors 315 | - [Vscode](https://code.visualstudio.com/) (Desktop) 316 | - [MiXplorer Editor](https://mixplorer.com/) (Mobile) 317 | 318 | #### Adding Material You Colors 319 | 320 | Material You colors are separated into 5 groups: 321 | - accent1 322 | - accent2 323 | - accent3 324 | - neutral1 325 | - neutral2 326 | 327 | This is where the app comes into play. Launch it and you will see all 5 groups and different numbers inside of those groups which are different shades of that group. 328 | 329 | Every Material You color consists of a few components: 330 | `system_ + group + _ + shade`, so for example `system_accent1_300` 331 | 332 | Using the app, find colors you like, figure out the full name as described above and replace the number (something like -292992) with the string. 333 | Note: Strings are wrapped into double quotes, so your theme should end up looking something like this: 334 | ```json 335 | { 336 | "colors": { 337 | "some-color": "system_accent0_300" 338 | } 339 | } 340 | ``` 341 | 342 | More detailed explanation can be found [here](https://discord.com/channels/811255666990907402/868419532992172073/898303519394758706). 343 | 344 | [Download Example Theme](https://github.com/MrSpidercat/Matu/releases/download/Release/matu-dark.json) 345 | 346 | 347 | 348 | ## Random Things 349 | ### Advanced Resources 350 | 351 | * This link by Ven might help you if you know what you're doing. 352 | 353 | https://gist.github.com/Vendicated/7e8aa7b2512b8e38e041692cbf34acfa 354 | 355 | ### Light Mode Theming 356 | 357 | * As Riyu has found out, a lot of things in Light mode are not themable, but ven did say he will add more light mode support. [Link to Riyu's light mode tests](https://ptb.discord.com/channels/811255666990907402/868419532992172073/902278346195476490) 358 | 359 | ## If certain elements on Android 12+ don't get themed 360 | 361 | > Due to Android's updates, specific elements in any/all themes might not be colored anymore depending on the device. Some of the important ones: chatbox input background, active dm button background, channel colors (the icons still work) etc. Not to worry, unless you're on Android 12+, they will work for you. Otherwise, it really depends what the device is, but it can happen. 362 | 363 | 364 | ## Troubleshooting 365 | - Background color not changing 366 | > Unfortunately sometimes this depends on your ROM 367 | - Background image not changing 368 | > Please check that you've used an allowed link and have transparency enabled (don't use cdn) 369 | 370 | 371 | ### **You've reached the end!** 372 | --------------------------------------------------------------------------------