├── .github ├── FUNDING.yml └── workflows │ ├── beta.yml │ └── build.yml ├── .gitignore ├── LICENSE ├── Makefile ├── README.md ├── Tweak ├── AXNAppCell.h ├── AXNAppCell.m ├── AXNManager.h ├── AXNManager.m ├── AXNRequestWrapper.h ├── AXNRequestWrapper.m ├── AXNView.h ├── AXNView.m ├── Makefile ├── Protocol.h ├── RandomHeaders.h ├── Selenium.plist ├── Tweak.h ├── Tweak.xm ├── TweakCCSelenium.h └── config.plist ├── control ├── layout ├── DEBIAN │ ├── postinst │ ├── postrm │ └── preinst └── Library │ └── Application Support │ └── SeleniumExtra.bundle │ ├── Assets │ └── icon.PNG │ ├── StyleMode.ca │ ├── index.xml │ └── main.caml │ ├── de.lproj │ └── Localizable.strings │ ├── en.lproj │ └── Localizable.strings │ ├── fr.lproj │ └── Localizable.strings │ ├── he.lproj │ └── Localizable.strings │ └── zh_TW.iproj │ └── Localizable.strings └── seleniumprefs ├── Makefile ├── Resources ├── Cydia@2x.png ├── Cydia@3x.png ├── Info.plist ├── Octocat.png ├── Octocat@2x.png ├── Octocat@3x.png ├── Root.plist ├── icon.png ├── icon@2x.png ├── icon@3x.png ├── paypal@2x.png └── paypal@3x.png ├── SLNMPRootListController.h ├── SLNMPRootListController.m └── entry.plist /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | # These are supported funding model platforms 2 | 3 | custom: ['https://www.paypal.com/donate/?hosted_button_id=DSAQ8SXMGFUNU'] 4 | -------------------------------------------------------------------------------- /.github/workflows/beta.yml: -------------------------------------------------------------------------------- 1 | name: Beta 2 | on: 3 | push: 4 | branches: 5 | - "**" # matches every branch 6 | - "!main" # excludes main 7 | 8 | jobs: 9 | build: 10 | name: Build Tweak 11 | runs-on: macOS-11 12 | env: 13 | THEOS: theos 14 | 15 | steps: 16 | - name: Checkout 17 | uses: actions/checkout@master 18 | - name: Install Dependencies 19 | run: brew install ldid xz 20 | - name: Setup Theos 21 | uses: actions/checkout@master 22 | with: 23 | repository: lgariv/theos 24 | ref: 55d403d00b309c9fe4a2dbd15b409d77fa133271 25 | path: theos 26 | submodules: recursive 27 | - name: Update Make 28 | run: | 29 | brew install make 30 | PATH="/usr/local/opt/make/libexec/gnubin:$PATH" 31 | - name: Build Package 32 | id: build_package 33 | run: | 34 | make package FINALPACKAGE=1 35 | echo "::set-output name=package::$(ls -t packages | head -n1)" 36 | echo "::set-output name=exit_code::$?" 37 | - name: Manage Version 38 | if: ${{ steps.build_package.outputs.package != 0 }} 39 | run: | 40 | set +e 41 | git fetch --prune --unshallow --tags 42 | VERSION="$(cat control | grep Version | sed -n 's/Version: //gp')" 43 | #echo "::set-env name=TWEAK_VER::$VERSION" 44 | echo "TWEAK_VER=$VERSION" >> $GITHUB_ENV 45 | CUR_TAG="$(git tag -l | grep beta)" 46 | if [[ -z $CUR_TAG ]]; then 47 | #echo "::set-env name=OLD_PRE_TAG::" 48 | echo "OLD_PRE_TAG=" >> $GITHUB_ENV 49 | else 50 | #echo "::set-env name=OLD_PRE_TAG::$CUR_TAG" 51 | echo "OLD_PRE_TAG=$CUR_TAG" >> $GITHUB_ENV 52 | fi 53 | exit 0 54 | set -e 55 | - name: Delete Old Prerelease (if there are any) 56 | uses: dev-drprasad/delete-tag-and-release@v0.1.2 57 | if: ${{ env.OLD_PRE_TAG != 0 && steps.build_package.outputs.package != 0 }} 58 | with: 59 | tag_name: ${{ env.OLD_PRE_TAG }} 60 | env: 61 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 62 | - name: Create Release 63 | if: ${{ steps.build_package.outputs.package != 0 }} 64 | id: create_release 65 | uses: actions/create-release@v1 66 | env: 67 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 68 | with: 69 | tag_name: v${{ env.TWEAK_VER }}-beta 70 | release_name: Beta v${{ env.TWEAK_VER }} 71 | draft: false 72 | prerelease: true 73 | - name: Upload Release Asset 74 | if: ${{ steps.build_package.outputs.package != 0 }} 75 | uses: actions/upload-release-asset@v1 76 | env: 77 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 78 | with: 79 | upload_url: ${{ steps.create_release.outputs.upload_url }} 80 | asset_path: ./packages/${{ steps.build_package.outputs.package }} 81 | asset_name: ${{ steps.build_package.outputs.package }} 82 | asset_content_type: application/vnd.debian.binary-package 83 | -------------------------------------------------------------------------------- /.github/workflows/build.yml: -------------------------------------------------------------------------------- 1 | name: Release 2 | on: 3 | release: 4 | types: 5 | - created 6 | # push: 7 | # branches: 8 | # - main 9 | 10 | jobs: 11 | build: 12 | name: Build Tweak 13 | runs-on: macOS-11 14 | env: 15 | THEOS: theos 16 | 17 | steps: 18 | - name: Checkout 19 | uses: actions/checkout@master 20 | - name: Install Dependencies 21 | run: | 22 | brew install ldid xz make 23 | echo PATH=\"$(brew --prefix make)/libexec/gnubin:\$PATH\" 24 | - name: Setup Theos 25 | uses: actions/checkout@master 26 | with: 27 | repository: lgariv/theos 28 | ref: 55d403d00b309c9fe4a2dbd15b409d77fa133271 29 | path: theos 30 | submodules: recursive 31 | - name: Build Package 32 | id: build_package 33 | run: | 34 | VERSION="$(cat control | grep Version | sed -n 's/Version: //gp')" 35 | #echo "::set-env name=TWEAK_VER::$VERSION" 36 | echo "TWEAK_VER=$VERSION" >> $GITHUB_ENV 37 | make package FINALPACKAGE=1 38 | echo "::set-output name=package::$(ls -t packages | head -n1)" 39 | - name: Manage Version 40 | if: ${{ steps.build_package.outputs.package != 0 }} 41 | run: | 42 | set +e 43 | git fetch --prune --unshallow --tags 44 | VERSION="$(cat control | grep Version | sed -n 's/Version: //gp')" 45 | #echo "::set-env name=TWEAK_VER::$VERSION" 46 | echo "TWEAK_VER=$VERSION" >> $GITHUB_ENV 47 | CUR_TAG="$(git tag -l | grep beta)" 48 | if [[ -z $CUR_TAG ]]; then 49 | #echo "::set-env name=OLD_PRE_TAG::" 50 | echo "OLD_PRE_TAG=" >> $GITHUB_ENV 51 | else 52 | #echo "::set-env name=OLD_PRE_TAG::$CUR_TAG" 53 | echo "OLD_PRE_TAG=$CUR_TAG" >> $GITHUB_ENV 54 | fi 55 | exit 0 56 | set -e 57 | - name: Delete Old Prerelease (if there are any) 58 | uses: dev-drprasad/delete-tag-and-release@v0.1.2 59 | if: ${{ env.OLD_PRE_TAG != 0 && steps.build_package.outputs.package != 0 }} 60 | with: 61 | tag_name: ${{ env.OLD_PRE_TAG }} 62 | env: 63 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 64 | - name: Create Release 65 | if: ${{ steps.build_package.outputs.package != 0 }} 66 | id: create_release 67 | uses: actions/create-release@v1 68 | env: 69 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 70 | with: 71 | tag_name: v${{ env.TWEAK_VER }} 72 | release_name: Release v${{ env.TWEAK_VER }} 73 | draft: false 74 | prerelease: false 75 | - name: Upload Release Asset 76 | uses: actions/upload-release-asset@v1 77 | env: 78 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 79 | with: 80 | upload_url: ${{ steps.create_release.outputs.upload_url }} 81 | asset_path: ./packages/${{ steps.build_package.outputs.package }} 82 | asset_name: ${{ steps.build_package.outputs.package }} 83 | asset_content_type: application/vnd.debian.binary-package 84 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Folders 2 | packages 3 | .vscode 4 | .theos 5 | .dragon 6 | 7 | # Files 8 | *.deb 9 | .DS_Store 10 | *.ninja -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 3, 29 June 2007 3 | 4 | Copyright (C) 2007 Free Software Foundation, Inc. 5 | Everyone is permitted to copy and distribute verbatim copies 6 | of this license document, but changing it is not allowed. 7 | 8 | Preamble 9 | 10 | The GNU General Public License is a free, copyleft license for 11 | software and other kinds of works. 12 | 13 | The licenses for most software and other practical works are designed 14 | to take away your freedom to share and change the works. By contrast, 15 | the GNU General Public License is intended to guarantee your freedom to 16 | share and change all versions of a program--to make sure it remains free 17 | software for all its users. We, the Free Software Foundation, use the 18 | GNU General Public License for most of our software; it applies also to 19 | any other work released this way by its authors. You can apply it to 20 | your programs, too. 21 | 22 | When we speak of free software, we are referring to freedom, not 23 | price. Our General Public Licenses are designed to make sure that you 24 | have the freedom to distribute copies of free software (and charge for 25 | them if you wish), that you receive source code or can get it if you 26 | want it, that you can change the software or use pieces of it in new 27 | free programs, and that you know you can do these things. 28 | 29 | To protect your rights, we need to prevent others from denying you 30 | these rights or asking you to surrender the rights. Therefore, you have 31 | certain responsibilities if you distribute copies of the software, or if 32 | you modify it: responsibilities to respect the freedom of others. 33 | 34 | For example, if you distribute copies of such a program, whether 35 | gratis or for a fee, you must pass on to the recipients the same 36 | freedoms that you received. You must make sure that they, too, receive 37 | or can get the source code. And you must show them these terms so they 38 | know their rights. 39 | 40 | Developers that use the GNU GPL protect your rights with two steps: 41 | (1) assert copyright on the software, and (2) offer you this License 42 | giving you legal permission to copy, distribute and/or modify it. 43 | 44 | For the developers' and authors' protection, the GPL clearly explains 45 | that there is no warranty for this free software. For both users' and 46 | authors' sake, the GPL requires that modified versions be marked as 47 | changed, so that their problems will not be attributed erroneously to 48 | authors of previous versions. 49 | 50 | Some devices are designed to deny users access to install or run 51 | modified versions of the software inside them, although the manufacturer 52 | can do so. This is fundamentally incompatible with the aim of 53 | protecting users' freedom to change the software. The systematic 54 | pattern of such abuse occurs in the area of products for individuals to 55 | use, which is precisely where it is most unacceptable. Therefore, we 56 | have designed this version of the GPL to prohibit the practice for those 57 | products. If such problems arise substantially in other domains, we 58 | stand ready to extend this provision to those domains in future versions 59 | of the GPL, as needed to protect the freedom of users. 60 | 61 | Finally, every program is threatened constantly by software patents. 62 | States should not allow patents to restrict development and use of 63 | software on general-purpose computers, but in those that do, we wish to 64 | avoid the special danger that patents applied to a free program could 65 | make it effectively proprietary. To prevent this, the GPL assures that 66 | patents cannot be used to render the program non-free. 67 | 68 | The precise terms and conditions for copying, distribution and 69 | modification follow. 70 | 71 | TERMS AND CONDITIONS 72 | 73 | 0. Definitions. 74 | 75 | "This License" refers to version 3 of the GNU General Public License. 76 | 77 | "Copyright" also means copyright-like laws that apply to other kinds of 78 | works, such as semiconductor masks. 79 | 80 | "The Program" refers to any copyrightable work licensed under this 81 | License. Each licensee is addressed as "you". "Licensees" and 82 | "recipients" may be individuals or organizations. 83 | 84 | To "modify" a work means to copy from or adapt all or part of the work 85 | in a fashion requiring copyright permission, other than the making of an 86 | exact copy. The resulting work is called a "modified version" of the 87 | earlier work or a work "based on" the earlier work. 88 | 89 | A "covered work" means either the unmodified Program or a work based 90 | on the Program. 91 | 92 | To "propagate" a work means to do anything with it that, without 93 | permission, would make you directly or secondarily liable for 94 | infringement under applicable copyright law, except executing it on a 95 | computer or modifying a private copy. Propagation includes copying, 96 | distribution (with or without modification), making available to the 97 | public, and in some countries other activities as well. 98 | 99 | To "convey" a work means any kind of propagation that enables other 100 | parties to make or receive copies. Mere interaction with a user through 101 | a computer network, with no transfer of a copy, is not conveying. 102 | 103 | An interactive user interface displays "Appropriate Legal Notices" 104 | to the extent that it includes a convenient and prominently visible 105 | feature that (1) displays an appropriate copyright notice, and (2) 106 | tells the user that there is no warranty for the work (except to the 107 | extent that warranties are provided), that licensees may convey the 108 | work under this License, and how to view a copy of this License. If 109 | the interface presents a list of user commands or options, such as a 110 | menu, a prominent item in the list meets this criterion. 111 | 112 | 1. Source Code. 113 | 114 | The "source code" for a work means the preferred form of the work 115 | for making modifications to it. "Object code" means any non-source 116 | form of a work. 117 | 118 | A "Standard Interface" means an interface that either is an official 119 | standard defined by a recognized standards body, or, in the case of 120 | interfaces specified for a particular programming language, one that 121 | is widely used among developers working in that language. 122 | 123 | The "System Libraries" of an executable work include anything, other 124 | than the work as a whole, that (a) is included in the normal form of 125 | packaging a Major Component, but which is not part of that Major 126 | Component, and (b) serves only to enable use of the work with that 127 | Major Component, or to implement a Standard Interface for which an 128 | implementation is available to the public in source code form. A 129 | "Major Component", in this context, means a major essential component 130 | (kernel, window system, and so on) of the specific operating system 131 | (if any) on which the executable work runs, or a compiler used to 132 | produce the work, or an object code interpreter used to run it. 133 | 134 | The "Corresponding Source" for a work in object code form means all 135 | the source code needed to generate, install, and (for an executable 136 | work) run the object code and to modify the work, including scripts to 137 | control those activities. However, it does not include the work's 138 | System Libraries, or general-purpose tools or generally available free 139 | programs which are used unmodified in performing those activities but 140 | which are not part of the work. For example, Corresponding Source 141 | includes interface definition files associated with source files for 142 | the work, and the source code for shared libraries and dynamically 143 | linked subprograms that the work is specifically designed to require, 144 | such as by intimate data communication or control flow between those 145 | subprograms and other parts of the work. 146 | 147 | The Corresponding Source need not include anything that users 148 | can regenerate automatically from other parts of the Corresponding 149 | Source. 150 | 151 | The Corresponding Source for a work in source code form is that 152 | same work. 153 | 154 | 2. Basic Permissions. 155 | 156 | All rights granted under this License are granted for the term of 157 | copyright on the Program, and are irrevocable provided the stated 158 | conditions are met. This License explicitly affirms your unlimited 159 | permission to run the unmodified Program. The output from running a 160 | covered work is covered by this License only if the output, given its 161 | content, constitutes a covered work. This License acknowledges your 162 | rights of fair use or other equivalent, as provided by copyright law. 163 | 164 | You may make, run and propagate covered works that you do not 165 | convey, without conditions so long as your license otherwise remains 166 | in force. You may convey covered works to others for the sole purpose 167 | of having them make modifications exclusively for you, or provide you 168 | with facilities for running those works, provided that you comply with 169 | the terms of this License in conveying all material for which you do 170 | not control copyright. Those thus making or running the covered works 171 | for you must do so exclusively on your behalf, under your direction 172 | and control, on terms that prohibit them from making any copies of 173 | your copyrighted material outside their relationship with you. 174 | 175 | Conveying under any other circumstances is permitted solely under 176 | the conditions stated below. Sublicensing is not allowed; section 10 177 | makes it unnecessary. 178 | 179 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law. 180 | 181 | No covered work shall be deemed part of an effective technological 182 | measure under any applicable law fulfilling obligations under article 183 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or 184 | similar laws prohibiting or restricting circumvention of such 185 | measures. 186 | 187 | When you convey a covered work, you waive any legal power to forbid 188 | circumvention of technological measures to the extent such circumvention 189 | is effected by exercising rights under this License with respect to 190 | the covered work, and you disclaim any intention to limit operation or 191 | modification of the work as a means of enforcing, against the work's 192 | users, your or third parties' legal rights to forbid circumvention of 193 | technological measures. 194 | 195 | 4. Conveying Verbatim Copies. 196 | 197 | You may convey verbatim copies of the Program's source code as you 198 | receive it, in any medium, provided that you conspicuously and 199 | appropriately publish on each copy an appropriate copyright notice; 200 | keep intact all notices stating that this License and any 201 | non-permissive terms added in accord with section 7 apply to the code; 202 | keep intact all notices of the absence of any warranty; and give all 203 | recipients a copy of this License along with the Program. 204 | 205 | You may charge any price or no price for each copy that you convey, 206 | and you may offer support or warranty protection for a fee. 207 | 208 | 5. Conveying Modified Source Versions. 209 | 210 | You may convey a work based on the Program, or the modifications to 211 | produce it from the Program, in the form of source code under the 212 | terms of section 4, provided that you also meet all of these conditions: 213 | 214 | a) The work must carry prominent notices stating that you modified 215 | it, and giving a relevant date. 216 | 217 | b) The work must carry prominent notices stating that it is 218 | released under this License and any conditions added under section 219 | 7. This requirement modifies the requirement in section 4 to 220 | "keep intact all notices". 221 | 222 | c) You must license the entire work, as a whole, under this 223 | License to anyone who comes into possession of a copy. This 224 | License will therefore apply, along with any applicable section 7 225 | additional terms, to the whole of the work, and all its parts, 226 | regardless of how they are packaged. This License gives no 227 | permission to license the work in any other way, but it does not 228 | invalidate such permission if you have separately received it. 229 | 230 | d) If the work has interactive user interfaces, each must display 231 | Appropriate Legal Notices; however, if the Program has interactive 232 | interfaces that do not display Appropriate Legal Notices, your 233 | work need not make them do so. 234 | 235 | A compilation of a covered work with other separate and independent 236 | works, which are not by their nature extensions of the covered work, 237 | and which are not combined with it such as to form a larger program, 238 | in or on a volume of a storage or distribution medium, is called an 239 | "aggregate" if the compilation and its resulting copyright are not 240 | used to limit the access or legal rights of the compilation's users 241 | beyond what the individual works permit. Inclusion of a covered work 242 | in an aggregate does not cause this License to apply to the other 243 | parts of the aggregate. 244 | 245 | 6. Conveying Non-Source Forms. 246 | 247 | You may convey a covered work in object code form under the terms 248 | of sections 4 and 5, provided that you also convey the 249 | machine-readable Corresponding Source under the terms of this License, 250 | in one of these ways: 251 | 252 | a) Convey the object code in, or embodied in, a physical product 253 | (including a physical distribution medium), accompanied by the 254 | Corresponding Source fixed on a durable physical medium 255 | customarily used for software interchange. 256 | 257 | b) Convey the object code in, or embodied in, a physical product 258 | (including a physical distribution medium), accompanied by a 259 | written offer, valid for at least three years and valid for as 260 | long as you offer spare parts or customer support for that product 261 | model, to give anyone who possesses the object code either (1) a 262 | copy of the Corresponding Source for all the software in the 263 | product that is covered by this License, on a durable physical 264 | medium customarily used for software interchange, for a price no 265 | more than your reasonable cost of physically performing this 266 | conveying of source, or (2) access to copy the 267 | Corresponding Source from a network server at no charge. 268 | 269 | c) Convey individual copies of the object code with a copy of the 270 | written offer to provide the Corresponding Source. This 271 | alternative is allowed only occasionally and noncommercially, and 272 | only if you received the object code with such an offer, in accord 273 | with subsection 6b. 274 | 275 | d) Convey the object code by offering access from a designated 276 | place (gratis or for a charge), and offer equivalent access to the 277 | Corresponding Source in the same way through the same place at no 278 | further charge. You need not require recipients to copy the 279 | Corresponding Source along with the object code. If the place to 280 | copy the object code is a network server, the Corresponding Source 281 | may be on a different server (operated by you or a third party) 282 | that supports equivalent copying facilities, provided you maintain 283 | clear directions next to the object code saying where to find the 284 | Corresponding Source. Regardless of what server hosts the 285 | Corresponding Source, you remain obligated to ensure that it is 286 | available for as long as needed to satisfy these requirements. 287 | 288 | e) Convey the object code using peer-to-peer transmission, provided 289 | you inform other peers where the object code and Corresponding 290 | Source of the work are being offered to the general public at no 291 | charge under subsection 6d. 292 | 293 | A separable portion of the object code, whose source code is excluded 294 | from the Corresponding Source as a System Library, need not be 295 | included in conveying the object code work. 296 | 297 | A "User Product" is either (1) a "consumer product", which means any 298 | tangible personal property which is normally used for personal, family, 299 | or household purposes, or (2) anything designed or sold for incorporation 300 | into a dwelling. In determining whether a product is a consumer product, 301 | doubtful cases shall be resolved in favor of coverage. For a particular 302 | product received by a particular user, "normally used" refers to a 303 | typical or common use of that class of product, regardless of the status 304 | of the particular user or of the way in which the particular user 305 | actually uses, or expects or is expected to use, the product. A product 306 | is a consumer product regardless of whether the product has substantial 307 | commercial, industrial or non-consumer uses, unless such uses represent 308 | the only significant mode of use of the product. 309 | 310 | "Installation Information" for a User Product means any methods, 311 | procedures, authorization keys, or other information required to install 312 | and execute modified versions of a covered work in that User Product from 313 | a modified version of its Corresponding Source. The information must 314 | suffice to ensure that the continued functioning of the modified object 315 | code is in no case prevented or interfered with solely because 316 | modification has been made. 317 | 318 | If you convey an object code work under this section in, or with, or 319 | specifically for use in, a User Product, and the conveying occurs as 320 | part of a transaction in which the right of possession and use of the 321 | User Product is transferred to the recipient in perpetuity or for a 322 | fixed term (regardless of how the transaction is characterized), the 323 | Corresponding Source conveyed under this section must be accompanied 324 | by the Installation Information. But this requirement does not apply 325 | if neither you nor any third party retains the ability to install 326 | modified object code on the User Product (for example, the work has 327 | been installed in ROM). 328 | 329 | The requirement to provide Installation Information does not include a 330 | requirement to continue to provide support service, warranty, or updates 331 | for a work that has been modified or installed by the recipient, or for 332 | the User Product in which it has been modified or installed. Access to a 333 | network may be denied when the modification itself materially and 334 | adversely affects the operation of the network or violates the rules and 335 | protocols for communication across the network. 336 | 337 | Corresponding Source conveyed, and Installation Information provided, 338 | in accord with this section must be in a format that is publicly 339 | documented (and with an implementation available to the public in 340 | source code form), and must require no special password or key for 341 | unpacking, reading or copying. 342 | 343 | 7. Additional Terms. 344 | 345 | "Additional permissions" are terms that supplement the terms of this 346 | License by making exceptions from one or more of its conditions. 347 | Additional permissions that are applicable to the entire Program shall 348 | be treated as though they were included in this License, to the extent 349 | that they are valid under applicable law. If additional permissions 350 | apply only to part of the Program, that part may be used separately 351 | under those permissions, but the entire Program remains governed by 352 | this License without regard to the additional permissions. 353 | 354 | When you convey a copy of a covered work, you may at your option 355 | remove any additional permissions from that copy, or from any part of 356 | it. (Additional permissions may be written to require their own 357 | removal in certain cases when you modify the work.) You may place 358 | additional permissions on material, added by you to a covered work, 359 | for which you have or can give appropriate copyright permission. 360 | 361 | Notwithstanding any other provision of this License, for material you 362 | add to a covered work, you may (if authorized by the copyright holders of 363 | that material) supplement the terms of this License with terms: 364 | 365 | a) Disclaiming warranty or limiting liability differently from the 366 | terms of sections 15 and 16 of this License; or 367 | 368 | b) Requiring preservation of specified reasonable legal notices or 369 | author attributions in that material or in the Appropriate Legal 370 | Notices displayed by works containing it; or 371 | 372 | c) Prohibiting misrepresentation of the origin of that material, or 373 | requiring that modified versions of such material be marked in 374 | reasonable ways as different from the original version; or 375 | 376 | d) Limiting the use for publicity purposes of names of licensors or 377 | authors of the material; or 378 | 379 | e) Declining to grant rights under trademark law for use of some 380 | trade names, trademarks, or service marks; or 381 | 382 | f) Requiring indemnification of licensors and authors of that 383 | material by anyone who conveys the material (or modified versions of 384 | it) with contractual assumptions of liability to the recipient, for 385 | any liability that these contractual assumptions directly impose on 386 | those licensors and authors. 387 | 388 | All other non-permissive additional terms are considered "further 389 | restrictions" within the meaning of section 10. If the Program as you 390 | received it, or any part of it, contains a notice stating that it is 391 | governed by this License along with a term that is a further 392 | restriction, you may remove that term. If a license document contains 393 | a further restriction but permits relicensing or conveying under this 394 | License, you may add to a covered work material governed by the terms 395 | of that license document, provided that the further restriction does 396 | not survive such relicensing or conveying. 397 | 398 | If you add terms to a covered work in accord with this section, you 399 | must place, in the relevant source files, a statement of the 400 | additional terms that apply to those files, or a notice indicating 401 | where to find the applicable terms. 402 | 403 | Additional terms, permissive or non-permissive, may be stated in the 404 | form of a separately written license, or stated as exceptions; 405 | the above requirements apply either way. 406 | 407 | 8. Termination. 408 | 409 | You may not propagate or modify a covered work except as expressly 410 | provided under this License. Any attempt otherwise to propagate or 411 | modify it is void, and will automatically terminate your rights under 412 | this License (including any patent licenses granted under the third 413 | paragraph of section 11). 414 | 415 | However, if you cease all violation of this License, then your 416 | license from a particular copyright holder is reinstated (a) 417 | provisionally, unless and until the copyright holder explicitly and 418 | finally terminates your license, and (b) permanently, if the copyright 419 | holder fails to notify you of the violation by some reasonable means 420 | prior to 60 days after the cessation. 421 | 422 | Moreover, your license from a particular copyright holder is 423 | reinstated permanently if the copyright holder notifies you of the 424 | violation by some reasonable means, this is the first time you have 425 | received notice of violation of this License (for any work) from that 426 | copyright holder, and you cure the violation prior to 30 days after 427 | your receipt of the notice. 428 | 429 | Termination of your rights under this section does not terminate the 430 | licenses of parties who have received copies or rights from you under 431 | this License. If your rights have been terminated and not permanently 432 | reinstated, you do not qualify to receive new licenses for the same 433 | material under section 10. 434 | 435 | 9. Acceptance Not Required for Having Copies. 436 | 437 | You are not required to accept this License in order to receive or 438 | run a copy of the Program. Ancillary propagation of a covered work 439 | occurring solely as a consequence of using peer-to-peer transmission 440 | to receive a copy likewise does not require acceptance. However, 441 | nothing other than this License grants you permission to propagate or 442 | modify any covered work. These actions infringe copyright if you do 443 | not accept this License. Therefore, by modifying or propagating a 444 | covered work, you indicate your acceptance of this License to do so. 445 | 446 | 10. Automatic Licensing of Downstream Recipients. 447 | 448 | Each time you convey a covered work, the recipient automatically 449 | receives a license from the original licensors, to run, modify and 450 | propagate that work, subject to this License. You are not responsible 451 | for enforcing compliance by third parties with this License. 452 | 453 | An "entity transaction" is a transaction transferring control of an 454 | organization, or substantially all assets of one, or subdividing an 455 | organization, or merging organizations. If propagation of a covered 456 | work results from an entity transaction, each party to that 457 | transaction who receives a copy of the work also receives whatever 458 | licenses to the work the party's predecessor in interest had or could 459 | give under the previous paragraph, plus a right to possession of the 460 | Corresponding Source of the work from the predecessor in interest, if 461 | the predecessor has it or can get it with reasonable efforts. 462 | 463 | You may not impose any further restrictions on the exercise of the 464 | rights granted or affirmed under this License. For example, you may 465 | not impose a license fee, royalty, or other charge for exercise of 466 | rights granted under this License, and you may not initiate litigation 467 | (including a cross-claim or counterclaim in a lawsuit) alleging that 468 | any patent claim is infringed by making, using, selling, offering for 469 | sale, or importing the Program or any portion of it. 470 | 471 | 11. Patents. 472 | 473 | A "contributor" is a copyright holder who authorizes use under this 474 | License of the Program or a work on which the Program is based. The 475 | work thus licensed is called the contributor's "contributor version". 476 | 477 | A contributor's "essential patent claims" are all patent claims 478 | owned or controlled by the contributor, whether already acquired or 479 | hereafter acquired, that would be infringed by some manner, permitted 480 | by this License, of making, using, or selling its contributor version, 481 | but do not include claims that would be infringed only as a 482 | consequence of further modification of the contributor version. For 483 | purposes of this definition, "control" includes the right to grant 484 | patent sublicenses in a manner consistent with the requirements of 485 | this License. 486 | 487 | Each contributor grants you a non-exclusive, worldwide, royalty-free 488 | patent license under the contributor's essential patent claims, to 489 | make, use, sell, offer for sale, import and otherwise run, modify and 490 | propagate the contents of its contributor version. 491 | 492 | In the following three paragraphs, a "patent license" is any express 493 | agreement or commitment, however denominated, not to enforce a patent 494 | (such as an express permission to practice a patent or covenant not to 495 | sue for patent infringement). To "grant" such a patent license to a 496 | party means to make such an agreement or commitment not to enforce a 497 | patent against the party. 498 | 499 | If you convey a covered work, knowingly relying on a patent license, 500 | and the Corresponding Source of the work is not available for anyone 501 | to copy, free of charge and under the terms of this License, through a 502 | publicly available network server or other readily accessible means, 503 | then you must either (1) cause the Corresponding Source to be so 504 | available, or (2) arrange to deprive yourself of the benefit of the 505 | patent license for this particular work, or (3) arrange, in a manner 506 | consistent with the requirements of this License, to extend the patent 507 | license to downstream recipients. "Knowingly relying" means you have 508 | actual knowledge that, but for the patent license, your conveying the 509 | covered work in a country, or your recipient's use of the covered work 510 | in a country, would infringe one or more identifiable patents in that 511 | country that you have reason to believe are valid. 512 | 513 | If, pursuant to or in connection with a single transaction or 514 | arrangement, you convey, or propagate by procuring conveyance of, a 515 | covered work, and grant a patent license to some of the parties 516 | receiving the covered work authorizing them to use, propagate, modify 517 | or convey a specific copy of the covered work, then the patent license 518 | you grant is automatically extended to all recipients of the covered 519 | work and works based on it. 520 | 521 | A patent license is "discriminatory" if it does not include within 522 | the scope of its coverage, prohibits the exercise of, or is 523 | conditioned on the non-exercise of one or more of the rights that are 524 | specifically granted under this License. You may not convey a covered 525 | work if you are a party to an arrangement with a third party that is 526 | in the business of distributing software, under which you make payment 527 | to the third party based on the extent of your activity of conveying 528 | the work, and under which the third party grants, to any of the 529 | parties who would receive the covered work from you, a discriminatory 530 | patent license (a) in connection with copies of the covered work 531 | conveyed by you (or copies made from those copies), or (b) primarily 532 | for and in connection with specific products or compilations that 533 | contain the covered work, unless you entered into that arrangement, 534 | or that patent license was granted, prior to 28 March 2007. 535 | 536 | Nothing in this License shall be construed as excluding or limiting 537 | any implied license or other defenses to infringement that may 538 | otherwise be available to you under applicable patent law. 539 | 540 | 12. No Surrender of Others' Freedom. 541 | 542 | If conditions are imposed on you (whether by court order, agreement or 543 | otherwise) that contradict the conditions of this License, they do not 544 | excuse you from the conditions of this License. If you cannot convey a 545 | covered work so as to satisfy simultaneously your obligations under this 546 | License and any other pertinent obligations, then as a consequence you may 547 | not convey it at all. For example, if you agree to terms that obligate you 548 | to collect a royalty for further conveying from those to whom you convey 549 | the Program, the only way you could satisfy both those terms and this 550 | License would be to refrain entirely from conveying the Program. 551 | 552 | 13. Use with the GNU Affero General Public License. 553 | 554 | Notwithstanding any other provision of this License, you have 555 | permission to link or combine any covered work with a work licensed 556 | under version 3 of the GNU Affero General Public License into a single 557 | combined work, and to convey the resulting work. The terms of this 558 | License will continue to apply to the part which is the covered work, 559 | but the special requirements of the GNU Affero General Public License, 560 | section 13, concerning interaction through a network will apply to the 561 | combination as such. 562 | 563 | 14. Revised Versions of this License. 564 | 565 | The Free Software Foundation may publish revised and/or new versions of 566 | the GNU General Public License from time to time. Such new versions will 567 | be similar in spirit to the present version, but may differ in detail to 568 | address new problems or concerns. 569 | 570 | Each version is given a distinguishing version number. If the 571 | Program specifies that a certain numbered version of the GNU General 572 | Public License "or any later version" applies to it, you have the 573 | option of following the terms and conditions either of that numbered 574 | version or of any later version published by the Free Software 575 | Foundation. If the Program does not specify a version number of the 576 | GNU General Public License, you may choose any version ever published 577 | by the Free Software Foundation. 578 | 579 | If the Program specifies that a proxy can decide which future 580 | versions of the GNU General Public License can be used, that proxy's 581 | public statement of acceptance of a version permanently authorizes you 582 | to choose that version for the Program. 583 | 584 | Later license versions may give you additional or different 585 | permissions. However, no additional obligations are imposed on any 586 | author or copyright holder as a result of your choosing to follow a 587 | later version. 588 | 589 | 15. Disclaimer of Warranty. 590 | 591 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY 592 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT 593 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY 594 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, 595 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 596 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM 597 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF 598 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 599 | 600 | 16. Limitation of Liability. 601 | 602 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 603 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS 604 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY 605 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE 606 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF 607 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD 608 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), 609 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF 610 | SUCH DAMAGES. 611 | 612 | 17. Interpretation of Sections 15 and 16. 613 | 614 | If the disclaimer of warranty and limitation of liability provided 615 | above cannot be given local legal effect according to their terms, 616 | reviewing courts shall apply local law that most closely approximates 617 | an absolute waiver of all civil liability in connection with the 618 | Program, unless a warranty or assumption of liability accompanies a 619 | copy of the Program in return for a fee. 620 | 621 | END OF TERMS AND CONDITIONS 622 | 623 | How to Apply These Terms to Your New Programs 624 | 625 | If you develop a new program, and you want it to be of the greatest 626 | possible use to the public, the best way to achieve this is to make it 627 | free software which everyone can redistribute and change under these terms. 628 | 629 | To do so, attach the following notices to the program. It is safest 630 | to attach them to the start of each source file to most effectively 631 | state the exclusion of warranty; and each file should have at least 632 | the "copyright" line and a pointer to where the full notice is found. 633 | 634 | 635 | Copyright (C) 636 | 637 | This program is free software: you can redistribute it and/or modify 638 | it under the terms of the GNU General Public License as published by 639 | the Free Software Foundation, either version 3 of the License, or 640 | (at your option) any later version. 641 | 642 | This program is distributed in the hope that it will be useful, 643 | but WITHOUT ANY WARRANTY; without even the implied warranty of 644 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 645 | GNU General Public License for more details. 646 | 647 | You should have received a copy of the GNU General Public License 648 | along with this program. If not, see . 649 | 650 | Also add information on how to contact you by electronic and paper mail. 651 | 652 | If the program does terminal interaction, make it output a short 653 | notice like this when it starts in an interactive mode: 654 | 655 | Copyright (C) 656 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 657 | This is free software, and you are welcome to redistribute it 658 | under certain conditions; type `show c' for details. 659 | 660 | The hypothetical commands `show w' and `show c' should show the appropriate 661 | parts of the General Public License. Of course, your program's commands 662 | might be different; for a GUI interface, you would use an "about box". 663 | 664 | You should also get your employer (if you work as a programmer) or school, 665 | if any, to sign a "copyright disclaimer" for the program, if necessary. 666 | For more information on this, and how to apply and follow the GNU GPL, see 667 | . 668 | 669 | The GNU General Public License does not permit incorporating your program 670 | into proprietary programs. If your program is a subroutine library, you 671 | may consider it more useful to permit linking proprietary applications with 672 | the library. If this is what you want to do, use the GNU Lesser General 673 | Public License instead of this License. But first, please read 674 | . 675 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | INSTALL_TARGET_PROCESSES = SpringBoard 2 | export GO_EASY_ON_ME = 1 3 | 4 | export ARCHS = arm64 arm64e 5 | export TARGET = iphone:clang:14.4:11.0 6 | 7 | export PACKAGE_VERSION = $(THEOS_PACKAGE_BASE_VERSION) 8 | 9 | include $(THEOS)/makefiles/common.mk 10 | SUBPROJECTS += Tweak seleniumprefs 11 | include $(THEOS_MAKE_PATH)/aggregate.mk 12 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Selenium 2 | 3 | **Introduction** 4 | 5 | With Selenium, users can snooze notifications, which causes them to disappear for a chosen period of time before reappearing. Notifications reappear at the same place they first appeared at, with an indicator to let you know they where snoozed. Snoozing notifications will be persistent through resprings. 6 | 7 | **How it works** 8 | 9 | Selenium is based on code from several open-source tweaks, including Dune, QuietDown, with the actual notification snoozing being managed by Axon library combined with PCSimpleTimer. 10 | 11 | Selenium is open-sourced as well. 12 | 13 | **Features** 14 | 15 | • Snooze notifications until a specific date. 16 | 17 | • Snooze notifications for a chosen amount of time. 18 | 19 | • Persistence through resprings, reboots (in jailbroken mode). 20 | 21 | • Tap to change option appear after snoozing. 22 | 23 | • Localised for English, Hebrew, and French. 24 | 25 | **Future Plans** 26 | 27 | • Snooze incoming notifications while DND is on. 28 | 29 | • Snooze notifications until I leave this location. 30 | 31 | • Snooze notifications until I arrive a location. 32 | 33 | # To Do: 34 | 35 | • ~Fix persistence through resprings (as well as the "SNOOZED" indicator).~ ✅ 36 | 37 | • ~Finish the custom stepper cell UI (and add a smaller subtitle that says until HH:mm, like android's Do Not Disturb UI on Marshmallow), then make it actually work.~ ✅ 38 | 39 | • ~Replace all 'For X amount of time' methods with the custom stepper cell.~ ✅ 40 | 41 | • ~Figure out how to grab notification cells + requests more reliably.~ ✅ I think this is fixed? not sure what caused problems in the first place. 42 | 43 | • ~Create pref pane with options to choose UIDatePicker intervals, choosing wether "Tap To Change" should appear when tapping on snooze or just straight open the UIAlertController, choose UIStepper intervals, and what snooze options should be available (currently there are supposed to be only 2, but should be more useful when more options like DND and location are added).~ ✅ Prefs created, some of these options will be added soon. 44 | 45 | • ~Not compatible with Axon, but compatible with Grupi. Need to figure out how to make it compatible with Axon.~ 46 | 47 | • \[Maybe for a future update\] Make an option for the Snooze button in the notification cell actions snooze automatically using the last setting used, and only open the UIAlertController when using the 'Tap To Change' option after that (and also not in the form of a UIAlertController, should expand on a tap to a view that looks more like a floating AirPods / App Clip menu in the middle of the screen). 48 | 49 | • \[Optional\] In addition to the previous one, also add a subtitle to the Snooze action in the notification cell that says what was the last used option. 50 | 51 | • \[Future update\] DND options - started to work on this, but stopped because of all of the important fixes need to be done, listed above. Features should be as simple as snoozing all incoming notifications when DND is on && Snooze CCUI toggle is on - although should be accounted for a situation where the user turns DND off manualey, and be persistent through resprings as well; those are the difficulties. Could be especially useful when combined with 'DND While Driving' as well. (Found in code by the looking for {DND start} without curly braces) 52 | 53 | • ~\[Future release\] Location options - same as the previous one, just with 'Until I leave this location' (similar to Shortcuts Automations) and 'Until I arrive to location X', with location list being configurable from the pref pane the same way Shortcut Automation does (so the user will get options like 'Until I arrive Home' and 'Until I arrive Work' that would work with and benefit from iOS built-in significant locations and location recognition by WiFi just like Shortcut Automations)~ Implemented as an experimental feature in v1.2.0 updat - it _should_ work, other beta testers has reported it was working for them, but I couldn't make it work for myself. More work needed to be done ✴️ 54 | 55 | • \[Important!\] Clean-up. There's a lot more of that to do... 56 | 57 | # License Notice 58 | 59 | Copyright (C) 2020 Lavie Gariv 60 | 61 | This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or any later version. 62 | 63 | This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. 64 | 65 | You should have received a copy of the GNU General Public License along with this program; if not, see . 66 | 67 | Additional permission under GNU GPL version 3 section 7 68 | 69 | If you modify this Program, or any covered work, by linking or combining it with Selenium, containing parts covered by the terms of GNU GPL v3, the licensors of this Program grant you additional permission to convey the resulting work. {Corresponding Source for a non-source form of such a combination shall include the source code for the parts of Selenium used as well as that of the covered work.} 70 | -------------------------------------------------------------------------------- /Tweak/AXNAppCell.h: -------------------------------------------------------------------------------- 1 | @import UIKit; 2 | 3 | @interface MPArtworkColorAnalyzer : NSObject 4 | - (void)analyzeWithCompletionHandler:(id /* block */)arg1; 5 | - (id)initWithImage:(id)arg1 algorithm:(long long)arg2; 6 | @end 7 | 8 | typedef NS_ENUM(NSInteger, MTMaterialRecipe) { 9 | MTMaterialRecipeNone, 10 | MTMaterialRecipeNotifications, 11 | MTMaterialRecipeWidgetHosts, 12 | MTMaterialRecipeWidgets, 13 | MTMaterialRecipeControlCenterModules, 14 | MTMaterialRecipeSwitcherContinuityItem, 15 | MTMaterialRecipePreviewBackground, 16 | MTMaterialRecipeNotificationsDark, 17 | MTMaterialRecipeControlCenterModulesSheer 18 | }; 19 | 20 | typedef NS_OPTIONS(NSUInteger, MTMaterialOptions) { 21 | MTMaterialOptionsNone = 0, 22 | MTMaterialOptionsGamma = 1 << 0, 23 | MTMaterialOptionsBlur = 1 << 1, 24 | MTMaterialOptionsZoom = 1 << 2, 25 | MTMaterialOptionsLuminanceMap = 1 << 3, 26 | MTMaterialOptionsBaseOverlay = 1 << 4, 27 | MTMaterialOptionsPrimaryOverlay = 1 << 5, 28 | MTMaterialOptionsSecondaryOverlay = 1 << 6, 29 | MTMaterialOptionsAuxiliaryOverlay = 1 << 7, 30 | MTMaterialOptionsCaptureOnly = 1 << 8 31 | }; 32 | 33 | @interface MTMaterialView : UIView 34 | +(id)materialViewWithRecipe:(long long)arg1 options:(unsigned long long)arg2 ; 35 | +(id)materialViewWithRecipe:(long long)arg1 configuration:(unsigned long long)arg2 ; 36 | @end 37 | 38 | @interface MPArtworkColorAnalysis : NSObject 39 | @property (nonatomic, readonly) UIColor *backgroundColor; 40 | @property (nonatomic, readonly) UIColor *primaryTextColor; 41 | @property (nonatomic, readonly) UIColor *secondaryTextColor; 42 | @end 43 | 44 | @interface AXNAppCell : UICollectionViewCell { 45 | NSArray *_styleConstraints; 46 | } 47 | 48 | @property (nonatomic, retain) UIImageView *iconView; 49 | @property (nonatomic, retain) UIView *blurView; 50 | @property (nonatomic, retain) UILabel *badgeLabel; 51 | @property (nonatomic, retain) NSString *bundleIdentifier; 52 | @property (nonatomic, assign) NSInteger notificationCount; 53 | @property (nonatomic, assign) NSInteger selectionStyle; 54 | @property (nonatomic, assign) NSInteger style; 55 | @property (nonatomic, assign) BOOL badgesShowBackground; 56 | @property (nonatomic, assign) BOOL darkMode; 57 | @property (nonatomic, assign) BOOL isSetupComplete; 58 | 59 | @end 60 | @interface SBApplicationController 61 | +(id)sharedInstance; 62 | -(id)applicationWithBundleIdentifier:(id)arg1; 63 | @end 64 | @interface SBApplication 65 | @property (nonatomic,readonly) NSString * displayName; 66 | @end 67 | -------------------------------------------------------------------------------- /Tweak/AXNAppCell.m: -------------------------------------------------------------------------------- 1 | #import 2 | #import "AXNAppCell.h" 3 | #import "AXNManager.h" 4 | 5 | @implementation AXNAppCell 6 | 7 | -(id)initWithFrame:(CGRect)frame { 8 | self = [super initWithFrame:frame]; 9 | _style = -1; 10 | 11 | UILongPressGestureRecognizer *recognizer = [[UILongPressGestureRecognizer alloc] initWithTarget:self action:@selector(showMenu:)]; 12 | [self addGestureRecognizer:recognizer]; 13 | 14 | self.layer.cornerRadius = 13; 15 | self.layer.continuousCorners = YES; 16 | self.layer.masksToBounds = YES; 17 | 18 | self.iconView = [[UIImageView alloc] initWithFrame:frame]; 19 | self.iconView.translatesAutoresizingMaskIntoConstraints = NO; 20 | self.iconView.contentMode = UIViewContentModeScaleAspectFit; 21 | 22 | self.badgeLabel = [[UILabel alloc] initWithFrame:frame]; 23 | self.badgeLabel.font = [UIFont boldSystemFontOfSize:14]; 24 | self.badgeLabel.translatesAutoresizingMaskIntoConstraints = NO; 25 | self.badgeLabel.text = @"0"; 26 | self.badgeLabel.textColor = [UIColor whiteColor]; 27 | self.badgeLabel.backgroundColor = [UIColor blackColor]; 28 | self.badgeLabel.layer.cornerRadius = 10; 29 | self.badgeLabel.layer.masksToBounds = YES; 30 | self.badgeLabel.textAlignment = NSTextAlignmentCenter; 31 | 32 | self.blurView = [[UIVisualEffectView alloc] initWithEffect:[UIBlurEffect effectWithStyle:UIBlurEffectStyleLight]]; 33 | self.blurView.frame = CGRectMake(0, 0, frame.size.width, frame.size.height); 34 | // self.blurView.bounds = self.bounds; 35 | 36 | _styleConstraints = @[ 37 | @[ // default 38 | [self.iconView.topAnchor constraintEqualToAnchor:self.topAnchor constant:5], 39 | [self.iconView.leadingAnchor constraintEqualToAnchor:self.leadingAnchor constant:10], 40 | [self.iconView.trailingAnchor constraintEqualToAnchor:self.trailingAnchor constant:-10], 41 | [self.iconView.bottomAnchor constraintEqualToAnchor:self.bottomAnchor constant:-30], 42 | [self.badgeLabel.centerXAnchor constraintEqualToAnchor:self.centerXAnchor], 43 | [self.badgeLabel.bottomAnchor constraintEqualToAnchor:self.bottomAnchor constant:-10], 44 | [self.badgeLabel.heightAnchor constraintEqualToConstant:20], 45 | [self.badgeLabel.widthAnchor constraintEqualToConstant:30], 46 | ], 47 | @[ // packed 48 | [self.iconView.topAnchor constraintEqualToAnchor:self.topAnchor constant:10], 49 | [self.iconView.leadingAnchor constraintEqualToAnchor:self.leadingAnchor constant:10], 50 | [self.iconView.trailingAnchor constraintEqualToAnchor:self.trailingAnchor constant:-10], 51 | [self.iconView.bottomAnchor constraintEqualToAnchor:self.bottomAnchor constant:-10], 52 | [self.badgeLabel.trailingAnchor constraintEqualToAnchor:self.trailingAnchor constant:-5], 53 | [self.badgeLabel.bottomAnchor constraintEqualToAnchor:self.bottomAnchor constant:-5], 54 | [self.badgeLabel.heightAnchor constraintEqualToConstant:20], 55 | [self.badgeLabel.widthAnchor constraintEqualToConstant:30], 56 | ], 57 | @[ // compact 58 | [self.iconView.topAnchor constraintEqualToAnchor:self.topAnchor constant:5], 59 | [self.iconView.leadingAnchor constraintEqualToAnchor:self.leadingAnchor constant:5], 60 | [self.iconView.trailingAnchor constraintEqualToAnchor:self.trailingAnchor constant:-5], 61 | [self.iconView.bottomAnchor constraintEqualToAnchor:self.bottomAnchor constant:-5], 62 | [self.badgeLabel.centerXAnchor constraintEqualToAnchor:self.centerXAnchor], 63 | [self.badgeLabel.bottomAnchor constraintEqualToAnchor:self.bottomAnchor constant:-5], 64 | [self.badgeLabel.leadingAnchor constraintEqualToAnchor:self.leadingAnchor constant:10], 65 | [self.badgeLabel.trailingAnchor constraintEqualToAnchor:self.trailingAnchor constant:-10], 66 | ], 67 | @[ // tiny 68 | [self.iconView.topAnchor constraintEqualToAnchor:self.topAnchor constant:5], 69 | [self.iconView.leadingAnchor constraintEqualToAnchor:self.leadingAnchor constant:5], 70 | [self.iconView.trailingAnchor constraintEqualToAnchor:self.trailingAnchor constant:-5], 71 | [self.iconView.bottomAnchor constraintEqualToAnchor:self.bottomAnchor constant:-25], 72 | [self.badgeLabel.centerXAnchor constraintEqualToAnchor:self.centerXAnchor], 73 | [self.badgeLabel.bottomAnchor constraintEqualToAnchor:self.bottomAnchor constant:-5], 74 | [self.badgeLabel.leadingAnchor constraintEqualToAnchor:self.leadingAnchor constant:5], 75 | [self.badgeLabel.trailingAnchor constraintEqualToAnchor:self.trailingAnchor constant:-5], 76 | ], 77 | @[ // group 78 | [self.iconView.topAnchor constraintEqualToAnchor:self.topAnchor constant:5], 79 | [self.iconView.leadingAnchor constraintEqualToAnchor:self.leadingAnchor], 80 | [self.iconView.trailingAnchor constraintEqualToAnchor:self.trailingAnchor constant:-28], 81 | [self.iconView.bottomAnchor constraintEqualToAnchor:self.bottomAnchor constant:-5], 82 | 83 | [self.badgeLabel.centerXAnchor constraintEqualToAnchor:self.centerXAnchor], 84 | [self.badgeLabel.topAnchor constraintEqualToAnchor:self.topAnchor constant:5], 85 | [self.badgeLabel.bottomAnchor constraintEqualToAnchor:self.bottomAnchor constant:-5], 86 | [self.badgeLabel.leadingAnchor constraintEqualToAnchor:self.leadingAnchor], 87 | [self.badgeLabel.trailingAnchor constraintEqualToAnchor:self.trailingAnchor constant:-5], 88 | ], 89 | @[ // group rounded 90 | [self.iconView.topAnchor constraintEqualToAnchor:self.topAnchor constant:8], 91 | [self.iconView.leadingAnchor constraintEqualToAnchor:self.leadingAnchor constant:3], 92 | [self.iconView.trailingAnchor constraintEqualToAnchor:self.trailingAnchor constant:-26], 93 | [self.iconView.bottomAnchor constraintEqualToAnchor:self.bottomAnchor constant:-8], 94 | 95 | [self.badgeLabel.centerXAnchor constraintEqualToAnchor:self.centerXAnchor], 96 | [self.badgeLabel.topAnchor constraintEqualToAnchor:self.topAnchor constant:8], 97 | [self.badgeLabel.bottomAnchor constraintEqualToAnchor:self.bottomAnchor constant:-8], 98 | [self.badgeLabel.leadingAnchor constraintEqualToAnchor:self.leadingAnchor constant:33], 99 | [self.badgeLabel.trailingAnchor constraintEqualToAnchor:self.trailingAnchor constant:-7], 100 | ] 101 | ]; 102 | 103 | return self; 104 | } 105 | 106 | -(UISemanticContentAttribute)semanticContentAttribute { 107 | return UISemanticContentAttributeForceLeftToRight; 108 | } 109 | 110 | -(void)axnClearAll { 111 | [[AXNManager sharedInstance] clearAll:self.bundleIdentifier]; 112 | } 113 | -(void)axnRealClearAll { 114 | [[AXNManager sharedInstance] clearAll]; 115 | } 116 | 117 | -(BOOL)canBecomeFirstResponder { 118 | return YES; 119 | } 120 | 121 | -(BOOL)canPerformAction:(SEL)action withSender:(id)sender { 122 | return (action == @selector(axnClearAll)); 123 | } 124 | 125 | -(NSString *)getAppName { 126 | SBApplication *app = [[NSClassFromString(@"SBApplicationController") sharedInstance] applicationWithBundleIdentifier:self.bundleIdentifier]; 127 | return app.displayName; 128 | } 129 | 130 | -(void)showMenu:(UILongPressGestureRecognizer *)sender { 131 | if (sender.state == UIGestureRecognizerStateBegan) { 132 | AudioServicesPlaySystemSound(1519); 133 | 134 | float version = [[[UIDevice currentDevice] systemVersion] floatValue]; 135 | 136 | if(version >= 13) { 137 | UIAlertController *alert = [UIAlertController alertControllerWithTitle:@"Notification Option" message:nil preferredStyle:UIAlertControllerStyleActionSheet]; 138 | [alert addAction:[UIAlertAction actionWithTitle:[NSString stringWithFormat:@"Clear All %@ notifications", [self getAppName]] style:UIAlertActionStyleDestructive handler:^(UIAlertAction *action) { 139 | [self axnClearAll]; 140 | }]]; 141 | [alert addAction:[UIAlertAction actionWithTitle:@"Clear All notifications" style:UIAlertActionStyleDestructive handler:^(UIAlertAction *action) { 142 | [self axnRealClearAll]; 143 | }]]; 144 | [alert addAction:[UIAlertAction actionWithTitle:@"Cancel" style:UIAlertActionStyleCancel handler:^(UIAlertAction *action) { 145 | }]]; 146 | UIResponder *responder = self; 147 | while ([responder isKindOfClass:[UIView class]]) responder = [responder nextResponder]; 148 | [(UIViewController *)responder presentViewController:alert animated:YES completion:nil]; 149 | } else { 150 | [self becomeFirstResponder]; 151 | UIMenuController *menu = [UIMenuController sharedMenuController]; 152 | menu.menuItems = @[ 153 | [[UIMenuItem alloc] initWithTitle:[NSString stringWithFormat:@"Clear All %@ notifications", [self getAppName]] action:@selector(axnClearAll)], 154 | [[UIMenuItem alloc] initWithTitle:@"Clear All notifications" action:@selector(axnRealClearAll)] 155 | ]; 156 | [menu setTargetRect:self.bounds inView:self]; 157 | [menu setMenuVisible:YES animated:YES]; 158 | } 159 | } 160 | } 161 | 162 | -(void)setBundleIdentifier:(NSString *)value { 163 | _bundleIdentifier = value; 164 | 165 | self.iconView.image = [[AXNManager sharedInstance] getIcon:value rounded:_style == 5]; 166 | 167 | self.badgeLabel.backgroundColor = [UIColor clearColor]; 168 | if(_style != 4) self.badgeLabel.textColor = [[AXNManager sharedInstance] fallbackColor]; 169 | if(_style == 5) self.badgeLabel.backgroundColor = [UIColor colorWithWhite:0.0 alpha:0.2]; 170 | 171 | BOOL iOS13 = [[[UIDevice currentDevice] systemVersion] floatValue] >= 13; 172 | 173 | if (self.badgesShowBackground && self.iconView.image && _style != 4) { 174 | if ([AXNManager sharedInstance].backgroundColorCache[value] && [AXNManager sharedInstance].textColorCache[value]) { 175 | self.badgeLabel.backgroundColor = [[AXNManager sharedInstance].backgroundColorCache[value] copy]; 176 | self.badgeLabel.textColor = [[AXNManager sharedInstance].textColorCache[value] copy]; 177 | } else { 178 | if(iOS13) { 179 | CGSize size = {1, 1}; 180 | UIGraphicsBeginImageContext(size); 181 | CGContextRef ctx = UIGraphicsGetCurrentContext(); 182 | CGContextSetInterpolationQuality(ctx, kCGInterpolationMedium); 183 | [[self.iconView.image copy] drawInRect:(CGRect){.size = size} blendMode:kCGBlendModeCopy alpha:1]; 184 | uint8_t *data = CGBitmapContextGetData(ctx); 185 | UIColor *backgroundColor = [UIColor colorWithRed:data[2] / 255.0f green:data[1] / 255.0f blue:data[0] / 255.0f alpha:1]; 186 | UIGraphicsEndImageContext(); 187 | CGFloat red = 0.0, green = 0.0, blue = 0.0, alpha = 0.0; 188 | [backgroundColor getRed:&red green:&green blue:&blue alpha:&alpha]; 189 | int threshold = 105; 190 | int bgDelta = ((red * 0.299) + (green * 0.587) + (blue * 0.114)); 191 | UIColor *textColor = (255 - bgDelta < threshold) ? [UIColor blackColor] : [UIColor whiteColor]; 192 | self.badgeLabel.backgroundColor = [backgroundColor copy]; 193 | self.badgeLabel.textColor = [textColor copy]; 194 | } else { 195 | __weak AXNAppCell *weakSelf = self; 196 | MPArtworkColorAnalyzer *colorAnalyzer = [[MPArtworkColorAnalyzer alloc] initWithImage:self.iconView.image algorithm:0]; 197 | [colorAnalyzer analyzeWithCompletionHandler:^(MPArtworkColorAnalyzer *analyzer, MPArtworkColorAnalysis *analysis) { 198 | [AXNManager sharedInstance].backgroundColorCache[value] = [analysis.backgroundColor copy]; 199 | [AXNManager sharedInstance].textColorCache[value] = [analysis.primaryTextColor copy]; 200 | [weakSelf badgeLabel].backgroundColor = [analysis.backgroundColor copy]; 201 | [weakSelf badgeLabel].textColor = [analysis.primaryTextColor copy]; 202 | }]; 203 | } 204 | } 205 | } 206 | } 207 | 208 | -(void)setNotificationCount:(NSInteger)value { 209 | _notificationCount = value; 210 | 211 | if (value <= 99) { 212 | self.badgeLabel.text = [NSString stringWithFormat:@"%ld", value]; 213 | } else { 214 | self.badgeLabel.text = @"99+"; 215 | } 216 | } 217 | 218 | -(void)setSelectionStyle:(NSInteger)style { 219 | _selectionStyle = style; 220 | 221 | self.iconView.alpha = 1.0; 222 | self.badgeLabel.alpha = 1.0; 223 | self.backgroundColor = [UIColor clearColor]; 224 | } 225 | 226 | -(void)setStyle:(NSInteger)style { 227 | if (_style == style) return; 228 | NSInteger oldStyle = _style; 229 | 230 | if (style >= [_styleConstraints count] || style < 0) _style = 0; 231 | else _style = style; 232 | 233 | if(style == 4 || style == 5) { 234 | if(style == 4) { 235 | self.badgeLabel.textAlignment = NSTextAlignmentRight; 236 | self.badgeLabel.backgroundColor = [UIColor clearColor]; 237 | self.badgeLabel.textColor = [UIColor blackColor]; 238 | } else { 239 | self.layer.cornerRadius = 18; 240 | self.alpha = 0.5; 241 | self.badgeLabel.backgroundColor = [UIColor colorWithWhite:0.0 alpha:0.2]; 242 | } 243 | [self addSubview:self.blurView]; 244 | [self addSubview:self.badgeLabel]; 245 | [self addSubview:self.iconView]; 246 | } else { 247 | [self addSubview:self.iconView]; 248 | [self addSubview:self.badgeLabel]; 249 | } 250 | 251 | if (oldStyle != -1) [NSLayoutConstraint deactivateConstraints:_styleConstraints[oldStyle]]; 252 | [NSLayoutConstraint activateConstraints:_styleConstraints[_style]]; 253 | [self setNeedsLayout]; 254 | } 255 | -(void)setDarkMode:(BOOL)darkMode { 256 | if (_darkMode == darkMode) return; 257 | 258 | CGRect frame = self.blurView.frame; 259 | if(darkMode) { 260 | id materialView = NSClassFromString(@"MTMaterialView"); 261 | if([materialView respondsToSelector:@selector(materialViewWithRecipe:options:)]) { 262 | self.blurView = [materialView materialViewWithRecipe:MTMaterialRecipeNotifications options:MTMaterialOptionsBlur]; 263 | } else { 264 | self.blurView = [materialView materialViewWithRecipe:MTMaterialRecipeNotifications configuration:1]; 265 | } 266 | self.blurView.backgroundColor = [UIColor colorWithWhite:0 alpha:0.45]; 267 | } else self.blurView = [[UIVisualEffectView alloc] initWithEffect:[UIBlurEffect effectWithStyle:UIBlurEffectStyleLight]]; 268 | self.blurView.frame = frame; 269 | self.badgeLabel.textColor = darkMode ? [UIColor whiteColor] : [UIColor blackColor]; 270 | self.badgeLabel.alpha = 0.4f; 271 | 272 | [self setNeedsDisplay]; 273 | } 274 | 275 | -(void)setSelected:(BOOL)selected { 276 | [super setSelected:selected]; 277 | if(self.selectionStyle == 2) return; 278 | 279 | if (selected) { 280 | [UIView animateWithDuration:0.15 delay:0.0 options:UIViewAnimationOptionCurveEaseIn animations:^{ 281 | switch (self.selectionStyle) { 282 | case 1: 283 | self.iconView.alpha = 1.0; 284 | self.badgeLabel.alpha = 1.0; 285 | break; 286 | default: 287 | if (!self.darkMode) self.backgroundColor = [[UIColor whiteColor] colorWithAlphaComponent:0.5]; 288 | else self.backgroundColor = [[UIColor blackColor] colorWithAlphaComponent:0.5]; 289 | } 290 | } completion:NULL]; 291 | } else { 292 | [UIView animateWithDuration:0.15 delay:0.0 options:UIViewAnimationOptionCurveEaseIn animations:^{ 293 | switch (self.selectionStyle) { 294 | case 1: 295 | self.iconView.alpha = 0.5; 296 | self.badgeLabel.alpha = 0.5; 297 | break; 298 | default: 299 | self.backgroundColor = [UIColor clearColor]; 300 | } 301 | } completion:NULL]; 302 | } 303 | } 304 | 305 | @end 306 | -------------------------------------------------------------------------------- /Tweak/AXNManager.h: -------------------------------------------------------------------------------- 1 | #import "AXNView.h" 2 | #import "RandomHeaders.h" 3 | #import "Protocol.h" 4 | 5 | @interface AXNManager : NSObject 6 | 7 | @property (nonatomic, retain) NSMutableDictionary *notificationRequests; 8 | @property (nonatomic, retain) NSMutableDictionary *names; 9 | @property (nonatomic, retain) NSMutableDictionary *timestamps; 10 | @property (nonatomic, retain) NSMutableDictionary *iconStore; 11 | @property (nonatomic, retain) NSMutableDictionary *backgroundColorCache; 12 | @property (nonatomic, retain) NSMutableDictionary *textColorCache; 13 | @property (nonatomic, retain) NSMutableDictionary *countCache; 14 | @property (nonatomic, retain) UIColor *fallbackColor; 15 | @property (nonatomic, weak) NCNotificationRequest *latestRequest; 16 | @property (nonatomic, weak) AXNView *view; 17 | @property (nonatomic, weak) id clvc; 18 | @property (nonatomic, weak) id sbclvc; 19 | @property (nonatomic, weak) NCNotificationDispatcher *dispatcher; 20 | +(instancetype)sharedInstance; 21 | -(id)init; 22 | -(void)getRidOfWaste; 23 | -(void)insertNotificationRequest:(id)req; 24 | -(void)removeNotificationRequest:(id)req; 25 | -(void)modifyNotificationRequest:(id)req; 26 | -(UIImage *)getIcon:(NSString *)bundleIdentifier; 27 | -(UIImage *)getIcon:(NSString *)bundleIdentifier rounded:(BOOL)rounded; 28 | -(void)clearAll:(NSString *)bundleIdentifier; 29 | -(void)clearAll; 30 | 31 | -(void)showNotificationRequest:(id)req; 32 | -(void)hideNotificationRequest:(id)req; 33 | -(void)showDNDNotificationRequests:(id)reqs; 34 | 35 | -(void)showNotificationRequests:(id)reqs; 36 | -(void)hideNotificationRequests:(id)reqs; 37 | 38 | -(id)requestsForBundleIdentifier:(NSString *)bundleIdentifier; 39 | -(NSArray *)allRequestsForBundleIdentifier:(NSString *)bundleIdentifier; 40 | -(void)showNotificationRequestsForBundleIdentifier:(NSString *)bundleIdentifier; 41 | -(void)showAllNotificationRequests; 42 | -(void)hideAllNotificationRequests; 43 | -(void)hideAllNotificationRequestsExcept:(id)notification; 44 | -(void)revealNotificationHistory:(BOOL)revealed; 45 | -(id)allNotificationRequests; 46 | 47 | -(id)coalescedNotificationForRequest:(id)req ; 48 | 49 | -(void)invalidateCountCache; 50 | -(void)updateCountForBundleIdentifier:(NSString *)bundleIdentifier; 51 | -(NSInteger)countForBundleIdentifier:(NSString *)bundleIdentifier; 52 | 53 | @end 54 | -------------------------------------------------------------------------------- /Tweak/AXNManager.m: -------------------------------------------------------------------------------- 1 | #import "AXNManager.h" 2 | #import "AXNRequestWrapper.h" 3 | #import "Tweak.h" 4 | 5 | @implementation AXNManager 6 | 7 | +(instancetype)sharedInstance { 8 | static AXNManager *sharedInstance = nil; 9 | static dispatch_once_t onceToken; 10 | dispatch_once(&onceToken, ^{ 11 | sharedInstance = [[AXNManager alloc] init]; 12 | sharedInstance.names = [NSMutableDictionary new]; 13 | sharedInstance.timestamps = [NSMutableDictionary new]; 14 | sharedInstance.notificationRequests = [NSMutableDictionary new]; 15 | sharedInstance.iconStore = [NSMutableDictionary new]; 16 | sharedInstance.backgroundColorCache = [NSMutableDictionary new]; 17 | sharedInstance.textColorCache = [NSMutableDictionary new]; 18 | sharedInstance.countCache = [NSMutableDictionary new]; 19 | sharedInstance.fallbackColor = [UIColor whiteColor]; 20 | }); 21 | return sharedInstance; 22 | } 23 | 24 | -(id)init { 25 | [[NSClassFromString(@"NSDistributedNotificationCenter") defaultCenter] addObserver:self selector:@selector(clearAll) name:@"me.nepeta.axon.clearAllNotification" object:nil]; 26 | [[NSClassFromString(@"NSDistributedNotificationCenter") defaultCenter] addObserver:self selector:@selector(saveNotificationForDebug) name:@"me.nepeta.axon.saveNotification" object:nil]; 27 | return self; 28 | } 29 | 30 | -(void)saveNotificationForDebug { 31 | NSMutableArray *array = [NSMutableArray new]; 32 | for(NSArray *value in [self.notificationRequests allValues]) { 33 | for(AXNRequestWrapper *req in value) [array addObject:req.request]; 34 | } 35 | [[array description] writeToFile:@"/var/mobile/Documents/AxonDebug.txt" atomically:false encoding:NSUTF8StringEncoding error:nil]; 36 | } 37 | 38 | -(void)getRidOfWaste { 39 | for (NSString *bundleIdentifier in [self.notificationRequests allKeys]) { 40 | __weak NSMutableArray *requests = self.notificationRequests[bundleIdentifier]; 41 | for (int i = [requests count] - 1; i >= 0; i--) { 42 | __weak AXNRequestWrapper *wrapped = requests[i]; 43 | if (!wrapped || ![wrapped request]) [requests removeObjectAtIndex:i]; 44 | } 45 | } 46 | } 47 | 48 | -(void)invalidateCountCache { 49 | [self.countCache removeAllObjects]; 50 | } 51 | 52 | -(void)updateCountForBundleIdentifier:(NSString *)bundleIdentifier { 53 | NSArray *requests = [self requestsForBundleIdentifier:bundleIdentifier]; 54 | NSInteger count = [requests count]; 55 | if (count == 0) { 56 | self.countCache[bundleIdentifier] = @(0); 57 | return; 58 | } 59 | 60 | if (@available(iOS 14, *)) { 61 | return; 62 | } else { 63 | if ([self.dispatcher.notificationStore respondsToSelector:@selector(coalescedNotificationForRequest:)]) { 64 | count = 0; 65 | NSMutableArray *coalescedNotifications = [NSMutableArray new]; 66 | for (NCNotificationRequest *req in requests) { 67 | NCCoalescedNotification *coalesced = [self coalescedNotificationForRequest:req]; 68 | if (!coalesced) { 69 | count++; 70 | continue; 71 | } 72 | 73 | if (![coalescedNotifications containsObject:coalesced]) { 74 | count += [coalesced.notificationRequests count]; 75 | [coalescedNotifications addObject:coalesced]; 76 | } 77 | } 78 | } 79 | } 80 | 81 | self.countCache[bundleIdentifier] = @(count); 82 | } 83 | 84 | -(NSInteger)countForBundleIdentifier:(NSString *)bundleIdentifier { 85 | if (self.countCache[bundleIdentifier]) return [self.countCache[bundleIdentifier] intValue]; 86 | 87 | [self updateCountForBundleIdentifier:bundleIdentifier]; 88 | 89 | if (self.countCache[bundleIdentifier]) return [self.countCache[bundleIdentifier] intValue]; 90 | else return 0; 91 | } 92 | 93 | -(UIImage *)getIcon:(NSString *)bundleIdentifier { 94 | if (self.iconStore[bundleIdentifier]) return self.iconStore[bundleIdentifier]; 95 | UIImage *image; 96 | SBIconModel *model; 97 | 98 | SBIconController *iconController = [NSClassFromString(@"SBIconController") sharedInstance]; 99 | 100 | if([iconController respondsToSelector:@selector(homescreenIconViewMap)]) model = [[iconController homescreenIconViewMap] iconModel]; 101 | else if([iconController respondsToSelector:@selector(model)]) model = [iconController model]; 102 | SBIcon *icon = [model applicationIconForBundleIdentifier:bundleIdentifier]; 103 | if([icon respondsToSelector:@selector(getIconImage:)]) image = [icon getIconImage:2]; 104 | else if([icon respondsToSelector:@selector(iconImageWithInfo:)]) image = [icon iconImageWithInfo:(struct SBIconImageInfo){60,60,2,0}]; 105 | 106 | if (!image) { 107 | NSLog(@"[Axon] Image Not Founded!"); 108 | NSArray *requests = [self requestsForBundleIdentifier:bundleIdentifier]; 109 | for (int i = 0; i < [requests count]; i++) { 110 | NCNotificationRequest *request = requests[i]; 111 | if ([request.sectionIdentifier isEqualToString:bundleIdentifier] && request.content && request.content.icon) { 112 | image = request.content.icon; 113 | break; 114 | } 115 | } 116 | } 117 | 118 | if (!image && model) { 119 | icon = [model applicationIconForBundleIdentifier:@"com.apple.Preferences"]; 120 | if([icon respondsToSelector:@selector(getIconImage:)]) image = [icon getIconImage:2]; 121 | else if([icon respondsToSelector:@selector(iconImageWithInfo:)]) image = [icon iconImageWithInfo:(struct SBIconImageInfo){60,60,2,0}]; 122 | } 123 | 124 | if (!image) { 125 | image = [UIImage _applicationIconImageForBundleIdentifier:bundleIdentifier format:0 scale:[UIScreen mainScreen].scale]; 126 | } 127 | 128 | if (image) { 129 | self.iconStore[bundleIdentifier] = [image copy]; 130 | } 131 | 132 | return image ?: [UIImage new]; 133 | } 134 | 135 | -(UIImage *)getIcon:(NSString *)bundleIdentifier rounded:(BOOL)rounded { 136 | UIImage *image = [self getIcon:bundleIdentifier]; 137 | if(rounded) { 138 | UIGraphicsBeginImageContextWithOptions(CGRectMake(0,0,60,60).size, NO, 1.0); 139 | [[UIBezierPath bezierPathWithRoundedRect:CGRectMake(0,0,60,60) cornerRadius:30] addClip]; 140 | [image drawInRect:CGRectMake(0,0,60,60)]; 141 | UIImage *finalImage = UIGraphicsGetImageFromCurrentImageContext(); 142 | UIGraphicsEndImageContext(); 143 | 144 | return finalImage; 145 | } else { 146 | return image; 147 | } 148 | } 149 | 150 | -(void)clearAll:(NSString *)bundleIdentifier { 151 | if (self.notificationRequests[bundleIdentifier]) { 152 | [self.dispatcher destination:nil requestsClearingNotificationRequests:[self allRequestsForBundleIdentifier:bundleIdentifier]]; 153 | } 154 | self.notificationRequests[bundleIdentifier] = nil; 155 | } 156 | 157 | -(void)clearAll { 158 | for(NSString *item in [self.notificationRequests allKeys]) { 159 | [self.dispatcher destination:nil requestsClearingNotificationRequests:[self allRequestsForBundleIdentifier:item]]; 160 | } 161 | self.notificationRequests = [@{} mutableCopy]; 162 | } 163 | 164 | -(void)insertNotificationRequest:(NCNotificationRequest *)req { 165 | if (!req || ![req notificationIdentifier] || !req.bulletin || !req.bulletin.sectionID) return; 166 | NSString *bundleIdentifier = req.bulletin.sectionID; 167 | 168 | if (req.content && req.content.header) { 169 | self.names[bundleIdentifier] = [req.content.header copy]; 170 | } 171 | 172 | if (req.timestamp) { 173 | if (!self.timestamps[bundleIdentifier] || [req.timestamp compare:self.timestamps[bundleIdentifier]] == NSOrderedDescending) { 174 | self.timestamps[bundleIdentifier] = [req.timestamp copy]; 175 | } 176 | 177 | if (!self.latestRequest || [req.timestamp compare:self.latestRequest.timestamp] == NSOrderedDescending) { 178 | self.latestRequest = req; 179 | } 180 | } 181 | 182 | [self getRidOfWaste]; 183 | if (self.notificationRequests[bundleIdentifier]) { 184 | BOOL found = NO; 185 | for (int i = 0; i < [self.notificationRequests[bundleIdentifier] count]; i++) { 186 | __weak AXNRequestWrapper *wrapped = self.notificationRequests[bundleIdentifier][i]; 187 | if (wrapped && [[req notificationIdentifier] isEqualToString:[wrapped notificationIdentifier]]) { 188 | found = YES; 189 | break; 190 | } 191 | } 192 | 193 | if (!found) [self.notificationRequests[bundleIdentifier] addObject:[AXNRequestWrapper wrapRequest:req]]; 194 | } else { 195 | self.notificationRequests[bundleIdentifier] = [NSMutableArray new]; 196 | [self.notificationRequests[bundleIdentifier] addObject:[AXNRequestWrapper wrapRequest:req]]; 197 | } 198 | 199 | [self updateCountForBundleIdentifier:bundleIdentifier]; 200 | } 201 | 202 | -(void)removeNotificationRequest:(NCNotificationRequest *)req { 203 | if (!req || ![req notificationIdentifier] || !req.bulletin || !req.bulletin.sectionID) return; 204 | NSString *bundleIdentifier = req.bulletin.sectionID; 205 | 206 | if (self.latestRequest && [[self.latestRequest notificationIdentifier] isEqualToString:[req notificationIdentifier]]) { 207 | self.latestRequest = nil; 208 | } 209 | 210 | [self getRidOfWaste]; 211 | 212 | BOOL latestRequestVerified = true; 213 | if(self.view.showByDefault == 1) latestRequestVerified = false; 214 | if (self.notificationRequests[bundleIdentifier]) { 215 | __weak NSMutableArray *requests = self.notificationRequests[bundleIdentifier]; 216 | for (int i = [requests count] - 1; i >= 0; i--) { 217 | __weak AXNRequestWrapper *wrapped = requests[i]; 218 | if (wrapped && [[req notificationIdentifier] isEqualToString:[wrapped notificationIdentifier]]) { 219 | [requests removeObjectAtIndex:i]; 220 | if(!latestRequestVerified && [[wrapped notificationIdentifier] isEqualToString:[self.latestRequest notificationIdentifier]]) latestRequestVerified = true; 221 | } 222 | } 223 | } 224 | if(!latestRequestVerified) self.latestRequest = nil; 225 | 226 | [self updateCountForBundleIdentifier:bundleIdentifier]; 227 | } 228 | 229 | -(void)modifyNotificationRequest:(NCNotificationRequest *)req { 230 | if (!req || ![req notificationIdentifier] || !req.bulletin || !req.bulletin.sectionID) return; 231 | NSString *bundleIdentifier = req.bulletin.sectionID; 232 | 233 | if (self.latestRequest && [[self.latestRequest notificationIdentifier] isEqualToString:[req notificationIdentifier]]) { 234 | self.latestRequest = req; 235 | } 236 | 237 | [self getRidOfWaste]; 238 | if (self.notificationRequests[bundleIdentifier]) { 239 | __weak NSMutableArray *requests = self.notificationRequests[bundleIdentifier]; 240 | for (int i = [requests count] - 1; i >= 0; i--) { 241 | __weak AXNRequestWrapper *wrapped = requests[i]; 242 | if (wrapped && [wrapped notificationIdentifier] && [[req notificationIdentifier] isEqualToString:[wrapped notificationIdentifier]]) { 243 | [requests removeObjectAtIndex:i]; 244 | [requests insertObject:[AXNRequestWrapper wrapRequest:req] atIndex:i]; 245 | return; 246 | } 247 | } 248 | } 249 | } 250 | 251 | -(void)setLatestRequest:(NCNotificationRequest *)request { 252 | _latestRequest = request; 253 | 254 | if (self.view.showingLatestRequest) { 255 | [self.view reset]; 256 | } 257 | } 258 | 259 | -(NSArray *)requestsForBundleIdentifier:(NSString *)bundleIdentifier { 260 | NSMutableArray *array = [NSMutableArray new]; 261 | if (!self.notificationRequests[bundleIdentifier]) return array; 262 | 263 | [self getRidOfWaste]; 264 | 265 | for (int i = 0; i < [self.notificationRequests[bundleIdentifier] count]; i++) { 266 | __weak AXNRequestWrapper *wrapped = self.notificationRequests[bundleIdentifier][i]; 267 | if (wrapped && [wrapped request]) [array addObject:[wrapped request]]; 268 | } 269 | 270 | return array; 271 | } 272 | 273 | -(NSArray *)allRequestsForBundleIdentifier:(NSString *)bundleIdentifier { 274 | NSArray *requests = [self requestsForBundleIdentifier:bundleIdentifier]; 275 | 276 | if (@available(iOS 14, *)) { 277 | return requests; 278 | } else { 279 | if ([self.dispatcher.notificationStore respondsToSelector:@selector(coalescedNotificationForRequest:)]) { 280 | NSMutableArray *allRequests = [NSMutableArray new]; 281 | NSMutableArray *coalescedNotifications = [NSMutableArray new]; 282 | 283 | for (NCNotificationRequest *req in requests) { 284 | NCCoalescedNotification *coalesced = [self coalescedNotificationForRequest:req]; 285 | if (!coalesced) { 286 | BOOL found = NO; 287 | for (int i = 0; i < [allRequests count]; i++) { 288 | if ([[req notificationIdentifier] isEqualToString:[allRequests[i] notificationIdentifier]]) { 289 | found = YES; 290 | break; 291 | } 292 | } 293 | 294 | if (!found) { 295 | [allRequests addObject:req]; 296 | } 297 | continue; 298 | } 299 | 300 | if (![coalescedNotifications containsObject:coalesced]) { 301 | for (NCNotificationRequest *request in coalesced.notificationRequests) { 302 | BOOL found = NO; 303 | for (int i = 0; i < [allRequests count]; i++) { 304 | if ([[request notificationIdentifier] isEqualToString:[allRequests[i] notificationIdentifier]]) { 305 | found = YES; 306 | break; 307 | } 308 | } 309 | 310 | if (!found) { 311 | [allRequests addObject:request]; 312 | } 313 | } 314 | [coalescedNotifications addObject:coalesced]; 315 | } 316 | } 317 | 318 | return allRequests; 319 | } else { 320 | } 321 | return requests; 322 | } 323 | } 324 | 325 | -(id)coalescedNotificationForRequest:(id)req { 326 | NCCoalescedNotification *coalesced = nil; 327 | if (@available(iOS 14, *)) { 328 | return nil; 329 | } else { 330 | if ([self.dispatcher.notificationStore respondsToSelector:@selector(coalescedNotificationForRequest:)]) { 331 | coalesced = [self.dispatcher.notificationStore coalescedNotificationForRequest:req]; 332 | } 333 | } 334 | return coalesced; 335 | } 336 | 337 | -(void)showNotificationRequest:(NCNotificationRequest *)req { 338 | if (!req) return; 339 | self.clvc.axnAllowChanges = YES; 340 | if ([self.clvc respondsToSelector:@selector(insertNotificationRequest:forCoalescedNotification:)]) [self.clvc insertNotificationRequest:req forCoalescedNotification:[self coalescedNotificationForRequest:req]]; 341 | else [self.clvc insertNotificationRequest:req]; 342 | self.clvc.axnAllowChanges = NO; 343 | } 344 | 345 | -(void)hideNotificationRequest:(NCNotificationRequest *)req { 346 | if (!req) return; 347 | self.clvc.axnAllowChanges = YES; 348 | [self insertNotificationRequest:req]; 349 | if ([self.clvc respondsToSelector:@selector(removeNotificationRequest:forCoalescedNotification:)]) [self.clvc removeNotificationRequest:req forCoalescedNotification:[self coalescedNotificationForRequest:req]]; 350 | else [self.clvc removeNotificationRequest:req]; 351 | self.clvc.axnAllowChanges = NO; 352 | } 353 | 354 | -(void)showNotificationRequests:(id)reqs { 355 | if (!reqs) return; 356 | for (id req in reqs) { 357 | [self showNotificationRequest:req]; 358 | } 359 | } 360 | 361 | -(void)showDNDNotificationRequests:(id)reqs { 362 | if (!reqs) return; 363 | NSMutableArray *allNotifs = [[self allNotificationRequests] mutableCopy]; 364 | NSMutableArray *DNDNotifs; 365 | for (NCNotificationRequest *entry in allNotifs) { 366 | for (id req in reqs) { 367 | NSArray *notifId = [req[@"id"] componentsSeparatedByString:@"; "]; 368 | NSMutableArray *parts = [[notifId[5] componentsSeparatedByString:@": "] mutableCopy]; 369 | [parts removeObject:parts[0]]; 370 | NSString *identifier = [parts componentsJoinedByString:@""]; 371 | NSLog(@"[AXNManager] string: %@ identifier: %@",req[@"id"],identifier); 372 | if ([entry.notificationIdentifier containsString:identifier] && [req[@"timeStamp"] doubleValue] == -2) { 373 | [DNDNotifs addObject:entry]; 374 | } 375 | } 376 | } 377 | 378 | for (id req in DNDNotifs) { 379 | [self showNotificationRequest:req]; 380 | } 381 | } 382 | 383 | -(void)hideNotificationRequests:(id)reqs { 384 | if (!reqs) return; 385 | for (id req in reqs) { 386 | [self hideNotificationRequest:req]; 387 | } 388 | } 389 | 390 | -(void)showNotificationRequestsForBundleIdentifier:(NSString *)bundleIdentifier { 391 | [self showNotificationRequests:[self requestsForBundleIdentifier:bundleIdentifier]]; 392 | dispatch_after(dispatch_time(DISPATCH_TIME_NOW, 0.3 * NSEC_PER_SEC), dispatch_get_main_queue(), ^{ 393 | [self.clvc updateNotifications]; 394 | }); 395 | } 396 | 397 | -(void)hideAllNotificationRequests { 398 | [self hideNotificationRequests:[self.clvc allNotificationRequests]]; 399 | } 400 | 401 | -(void)showAllNotificationRequests { 402 | [self showNotificationRequests:[self.clvc allNotificationRequests]]; 403 | } 404 | 405 | -(id)allNotificationRequests { 406 | return [self.clvc allNotificationRequests]; 407 | } 408 | 409 | -(void)hideAllNotificationRequestsExcept:(id)notification { 410 | NSMutableSet *set = [[self.clvc allNotificationRequests] mutableCopy]; 411 | [set removeObject:notification]; 412 | [self hideNotificationRequests:set]; 413 | } 414 | 415 | -(void)revealNotificationHistory:(BOOL)revealed { 416 | [self.clvc revealNotificationHistory:revealed]; 417 | } 418 | 419 | @end 420 | -------------------------------------------------------------------------------- /Tweak/AXNRequestWrapper.h: -------------------------------------------------------------------------------- 1 | #import "RandomHeaders.h" 2 | 3 | @interface AXNRequestWrapper : NSObject 4 | 5 | @property (nonatomic, strong) NSString *notificationIdentifier; 6 | @property (nonatomic, weak) NCNotificationRequest *request; 7 | 8 | +(AXNRequestWrapper *)wrapRequest:(NCNotificationRequest *)request; 9 | 10 | @end -------------------------------------------------------------------------------- /Tweak/AXNRequestWrapper.m: -------------------------------------------------------------------------------- 1 | #import "AXNRequestWrapper.h" 2 | 3 | @implementation AXNRequestWrapper 4 | 5 | +(AXNRequestWrapper *)wrapRequest:(NCNotificationRequest *)request { 6 | if (!request || ![request notificationIdentifier]) return nil; 7 | AXNRequestWrapper *wrapped = [AXNRequestWrapper alloc]; 8 | wrapped.request = request; 9 | wrapped.notificationIdentifier = [[request notificationIdentifier] copy]; 10 | return wrapped; 11 | } 12 | 13 | @end -------------------------------------------------------------------------------- /Tweak/AXNView.h: -------------------------------------------------------------------------------- 1 | #import "RandomHeaders.h" 2 | 3 | @interface AXNView : UIView 4 | 5 | @property (nonatomic, retain) NSMutableArray *list; 6 | @property (nonatomic, retain) UICollectionView *collectionView; 7 | @property (nonatomic, retain) UICollectionViewFlowLayout *collectionViewLayout; 8 | @property (nonatomic, retain) NSString *selectedBundleIdentifier; 9 | 10 | @property (nonatomic, assign) BOOL hapticFeedback; 11 | @property (nonatomic, assign) BOOL badgesEnabled; 12 | @property (nonatomic, assign) BOOL badgesShowBackground; 13 | @property (nonatomic, assign) BOOL darkMode; 14 | @property (nonatomic, assign) BOOL showingLatestRequest; 15 | @property (nonatomic, assign) NSInteger selectionStyle; 16 | @property (nonatomic, assign) NSInteger style; 17 | @property (nonatomic, assign) NSInteger sortingMode; 18 | @property (nonatomic, assign) NSInteger showByDefault; 19 | @property (nonatomic, assign) NSInteger alignment; 20 | @property (nonatomic, assign) CGFloat spacing; 21 | 22 | -(void)refresh; 23 | -(void)reset; 24 | 25 | /* Compatibility stuff. */ 26 | -(void)setContentHost:(id)arg1 ; 27 | -(void)setSizeToMimic:(CGSize)arg1 ; 28 | -(void)_layoutContentHost; 29 | -(CGSize)sizeToMimic; 30 | -(id)contentHost; 31 | -(void)_updateSizeToMimic; 32 | -(unsigned long long)_optionsForMainOverlay; 33 | 34 | @end -------------------------------------------------------------------------------- /Tweak/AXNView.m: -------------------------------------------------------------------------------- 1 | #import 2 | #import "AXNView.h" 3 | #import "AXNAppCell.h" 4 | #import "AXNManager.h" 5 | 6 | @implementation AXNView 7 | 8 | -(id)initWithFrame:(CGRect)frame { 9 | self = [super initWithFrame:frame]; 10 | 11 | self.badgesEnabled = YES; 12 | self.badgesShowBackground = YES; 13 | self.showingLatestRequest = NO; 14 | self.list = [NSMutableArray new]; 15 | 16 | self.collectionViewLayout = [[UICollectionViewFlowLayout alloc] init]; 17 | self.collectionViewLayout.scrollDirection = UICollectionViewScrollDirectionHorizontal; 18 | 19 | self.collectionView = [[UICollectionView alloc] initWithFrame:frame collectionViewLayout:self.collectionViewLayout]; 20 | self.collectionView.showsHorizontalScrollIndicator = NO; 21 | self.collectionView.translatesAutoresizingMaskIntoConstraints = NO; 22 | self.collectionView.dataSource = self; 23 | self.collectionView.delegate = self; 24 | self.collectionView.backgroundColor = [UIColor clearColor]; 25 | [self.collectionView registerClass:[AXNAppCell class] forCellWithReuseIdentifier:@"AppCell"]; 26 | 27 | [self addSubview:self.collectionView]; 28 | 29 | [NSLayoutConstraint activateConstraints:@[ 30 | [self.collectionView.topAnchor constraintEqualToAnchor:self.topAnchor], 31 | [self.collectionView.leadingAnchor constraintEqualToAnchor:self.leadingAnchor], 32 | [self.collectionView.trailingAnchor constraintEqualToAnchor:self.trailingAnchor], 33 | [self.collectionView.bottomAnchor constraintEqualToAnchor:self.bottomAnchor], 34 | ]]; 35 | 36 | return self; 37 | } 38 | 39 | - (void)viewDidLayoutSubviews { 40 | [self.collectionView.collectionViewLayout invalidateLayout]; 41 | } 42 | 43 | - (void)setSpacing:(CGFloat)spacing { 44 | _spacing = spacing; 45 | self.collectionViewLayout.minimumLineSpacing = spacing; 46 | self.collectionViewLayout.minimumInteritemSpacing = spacing; 47 | } 48 | 49 | - (void)setAlignment:(NSInteger)alignment { 50 | if (alignment == _alignment) return; 51 | 52 | _alignment = alignment; 53 | if (_alignment > 2 || _alignment < 0) _alignment = 1; 54 | 55 | self.collectionView.semanticContentAttribute = UISemanticContentAttributeUnspecified; 56 | if (alignment == 0) self.collectionView.semanticContentAttribute = UISemanticContentAttributeForceLeftToRight; 57 | else if (alignment == 2) self.collectionView.semanticContentAttribute = UISemanticContentAttributeForceRightToLeft; 58 | 59 | [self.collectionView setNeedsLayout]; 60 | [self.collectionView layoutIfNeeded]; 61 | } 62 | 63 | - (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section { 64 | if (section == 0) return [self.list count]; 65 | else return 0; 66 | } 67 | 68 | - (void)reset { 69 | if (self.showByDefault == 3) return; 70 | if (self.showByDefault == 2 && [self.list count] > 0 && [self.list[0][@"bundleIdentifier"] isEqualToString:self.selectedBundleIdentifier]) return; 71 | 72 | self.showingLatestRequest = NO; 73 | self.selectedBundleIdentifier = nil; 74 | if(self.showByDefault != 1) [[AXNManager sharedInstance] hideAllNotificationRequests]; 75 | 76 | switch (self.showByDefault) { 77 | case 1: 78 | if ([AXNManager sharedInstance].latestRequest) { 79 | [[AXNManager sharedInstance] showNotificationRequest:[AXNManager sharedInstance].latestRequest]; 80 | [[AXNManager sharedInstance] hideAllNotificationRequestsExcept:[AXNManager sharedInstance].latestRequest]; 81 | self.showingLatestRequest = YES; 82 | } else [[AXNManager sharedInstance] hideAllNotificationRequests]; 83 | break; 84 | case 2: 85 | if ([self.list count] > 0) { 86 | [self collectionView:self.collectionView didSelectItemAtIndexPath:[NSIndexPath indexPathForRow:0 inSection:0]]; 87 | } 88 | return; 89 | } 90 | 91 | [self.collectionView reloadSections:[NSIndexSet indexSetWithIndex:0]]; 92 | [[AXNManager sharedInstance] revealNotificationHistory:false]; 93 | } 94 | 95 | - (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath { 96 | AXNAppCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"AppCell" forIndexPath:indexPath] ?: [[AXNAppCell alloc] initWithFrame:CGRectMake(0,0,64,64)]; 97 | NSDictionary *dict = self.list[indexPath.row]; 98 | cell.darkMode = self.darkMode; 99 | cell.badgesShowBackground = self.badgesShowBackground; 100 | cell.bundleIdentifier = dict[@"bundleIdentifier"]; 101 | cell.notificationCount = [dict[@"notificationCount"] intValue]; 102 | cell.backgroundColor = [UIColor clearColor]; 103 | cell.selectionStyle = self.selectionStyle; 104 | cell.selected = [self.selectedBundleIdentifier isEqualToString:cell.bundleIdentifier]; 105 | cell.badgeLabel.hidden = !self.badgesEnabled; 106 | cell.style = self.style; 107 | 108 | if (cell.selected) { 109 | [collectionView selectItemAtIndexPath:indexPath animated:NO scrollPosition:UICollectionViewScrollPositionNone]; 110 | } 111 | 112 | if (self.style == 5) cell.alpha = 0.5; 113 | 114 | return cell; 115 | } 116 | 117 | - (BOOL)collectionView:(UICollectionView *)collectionView shouldSelectItemAtIndexPath:(NSIndexPath *)indexPath { 118 | if (self.hapticFeedback) AudioServicesPlaySystemSound(1519); 119 | AXNAppCell *cell = (AXNAppCell *)[collectionView cellForItemAtIndexPath:indexPath]; 120 | if (cell.selected) { 121 | self.selectedBundleIdentifier = nil; 122 | [collectionView deselectItemAtIndexPath:indexPath animated:NO]; 123 | [self collectionView:collectionView didDeselectItemAtIndexPath:indexPath]; 124 | return NO; 125 | } else { 126 | return YES; 127 | } 128 | } 129 | 130 | - (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath { 131 | AXNAppCell *cell = (AXNAppCell *)[collectionView cellForItemAtIndexPath:indexPath]; 132 | 133 | if (![self.selectedBundleIdentifier isEqualToString:cell.bundleIdentifier]) { 134 | [[AXNManager sharedInstance] hideAllNotificationRequests]; 135 | } 136 | self.selectedBundleIdentifier = cell.bundleIdentifier; 137 | 138 | [[AXNManager sharedInstance] showNotificationRequestsForBundleIdentifier:cell.bundleIdentifier]; 139 | self.showingLatestRequest = NO; 140 | 141 | [[NSClassFromString(@"SBIdleTimerGlobalCoordinator") sharedInstance] resetIdleTimer]; 142 | [[AXNManager sharedInstance] revealNotificationHistory:YES]; 143 | 144 | if (self.collectionViewLayout.scrollDirection == UICollectionViewScrollDirectionVertical) { 145 | if([[AXNManager sharedInstance].clvc respondsToSelector:@selector(collectionView)]) [[[AXNManager sharedInstance].clvc collectionView] _scrollToTopIfPossible:YES]; 146 | } 147 | } 148 | 149 | - (void)collectionView:(UICollectionView *)collectionView didDeselectItemAtIndexPath:(NSIndexPath *)indexPath { 150 | [[AXNManager sharedInstance] hideAllNotificationRequests]; 151 | self.showingLatestRequest = NO; 152 | 153 | [[AXNManager sharedInstance] revealNotificationHistory:NO]; 154 | } 155 | 156 | - (CGSize)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout sizeForItemAtIndexPath:(NSIndexPath *)indexPath { 157 | switch (self.style) { 158 | case 1: return CGSizeMake(64, 64); 159 | case 2: return CGSizeMake(48, 48); 160 | case 3: return CGSizeMake(40, 64); 161 | case 4: return CGSizeMake(60, 30); 162 | case 5: return CGSizeMake(60, 36); 163 | default: return CGSizeMake(64, 90); 164 | } 165 | } 166 | 167 | - (UIEdgeInsets)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout insetForSectionAtIndex:(NSInteger)section { 168 | if (self.alignment != 1) return UIEdgeInsetsMake(0, 0, 0, 0); 169 | 170 | CGFloat spacing = [(UICollectionViewFlowLayout *)collectionViewLayout minimumLineSpacing]; 171 | CGFloat width = 64; 172 | CGFloat viewWidth = self.bounds.size.width; 173 | 174 | if (self.style == 2) width = 48; 175 | else if (self.style == 3) width = 40; 176 | 177 | if (self.collectionViewLayout.scrollDirection == UICollectionViewScrollDirectionVertical) { 178 | width = 90; 179 | if (self.style == 1 || self.style == 3) width = 64; 180 | else if (self.style == 2) width = 48; 181 | 182 | viewWidth = self.bounds.size.height; 183 | } 184 | 185 | NSInteger count = [self collectionView:collectionView numberOfItemsInSection:section]; 186 | CGFloat totalCellWidth = width * count; 187 | CGFloat totalSpacingWidth = spacing * (count - 1); 188 | if (totalSpacingWidth < 0) totalSpacingWidth = 0; 189 | 190 | CGFloat leftInset = (viewWidth - (totalCellWidth + totalSpacingWidth)) / 2; 191 | if (leftInset < 0) { 192 | return [(UICollectionViewFlowLayout *)collectionViewLayout sectionInset]; 193 | } 194 | CGFloat rightInset = leftInset; 195 | 196 | if (self.collectionViewLayout.scrollDirection == UICollectionViewScrollDirectionHorizontal) { 197 | return UIEdgeInsetsMake(0, leftInset, 0, rightInset); 198 | } else { 199 | return UIEdgeInsetsMake(leftInset, 0, rightInset, 0); 200 | } 201 | } 202 | 203 | - (void)refresh { 204 | [self.list removeAllObjects]; 205 | NSArray *sortedKeys = @[]; 206 | 207 | switch (self.sortingMode) { 208 | case 1: 209 | sortedKeys = [[[AXNManager sharedInstance].notificationRequests allKeys] sortedArrayUsingComparator:^NSComparisonResult(id a, id b) { 210 | NSInteger first = [[AXNManager sharedInstance] countForBundleIdentifier:a]; 211 | NSInteger second = [[AXNManager sharedInstance] countForBundleIdentifier:b]; 212 | if (first < second) return (NSComparisonResult)NSOrderedDescending; 213 | if (first > second) return (NSComparisonResult)NSOrderedAscending; 214 | return (NSComparisonResult)NSOrderedSame; 215 | }]; 216 | break; 217 | case 2: 218 | sortedKeys = [[[AXNManager sharedInstance].notificationRequests allKeys] sortedArrayUsingComparator:^NSComparisonResult(id a, id b) { 219 | NSString *first = [[AXNManager sharedInstance].names objectForKey:a]; 220 | NSString *second = [[AXNManager sharedInstance].names objectForKey:b]; 221 | return [first compare:second]; 222 | }]; 223 | break; 224 | default: 225 | sortedKeys = [[[AXNManager sharedInstance].notificationRequests allKeys] sortedArrayUsingComparator:^NSComparisonResult(id a, id b) { 226 | NSDate *first = [[AXNManager sharedInstance].timestamps objectForKey:a]; 227 | NSDate *second = [[AXNManager sharedInstance].timestamps objectForKey:b]; 228 | return [second compare:first] == NSOrderedDescending; 229 | }]; 230 | } 231 | 232 | for (NSString *key in sortedKeys) { 233 | NSInteger count = [[AXNManager sharedInstance] countForBundleIdentifier:key]; 234 | if (count == 0) continue; 235 | [self.list addObject:@{ 236 | @"bundleIdentifier": key, 237 | @"notificationCount": @(count) 238 | }]; 239 | } 240 | 241 | [self.collectionView reloadSections:[NSIndexSet indexSetWithIndex:0]]; 242 | [[AXNManager sharedInstance].sbclvc _setListHasContent:([self.list count] > 0)]; 243 | } 244 | 245 | /* Compatibility stuff to keep it from safe moding. */ 246 | 247 | -(void)setContentHost:(id)arg1 {} 248 | -(void)setSizeToMimic:(CGSize)arg1 {} 249 | -(void)_layoutContentHost {} 250 | -(CGSize)sizeToMimic { return self.frame.size; } 251 | -(id)contentHost { return nil; } 252 | -(void)_updateSizeToMimic {} 253 | -(unsigned long long)_optionsForMainOverlay { return 0; } 254 | 255 | @end 256 | -------------------------------------------------------------------------------- /Tweak/Makefile: -------------------------------------------------------------------------------- 1 | include $(THEOS)/makefiles/common.mk 2 | 3 | TWEAK_NAME = Selenium 4 | $(TWEAK_NAME)_FILES = Tweak.xm $(wildcard AXN*.m) 5 | $(TWEAK_NAME)_FRAMEWORKS += QuartzCore WebKit MediaPlayer UIKit CoreLocation MapKit Contacts 6 | $(TWEAK_NAME)_PRIVATE_FRAMEWORKS = ControlCenterUIKit PersistentConnection BulletinBoard #WorkflowUI 7 | ADDITIONAL_OBJCFLAGS += -fobjc-arc -Wno-unguarded-availability-new -w -fdiagnostics-absolute-paths 8 | 9 | include $(THEOS_MAKE_PATH)/tweak.mk 10 | -------------------------------------------------------------------------------- /Tweak/Protocol.h: -------------------------------------------------------------------------------- 1 | @import Foundation; 2 | 3 | @protocol clvc 4 | @property (nonatomic,assign) BOOL axnAllowChanges; 5 | 6 | @optional 7 | -(void)insertNotificationRequest:(id)arg1 ; 8 | -(void)modifyNotificationRequest:(id)arg1 ; 9 | -(void)removeNotificationRequest:(id)arg1 ; 10 | -(void)insertNotificationRequest:(id)arg1 forCoalescedNotification:(id)arg2 ; 11 | -(void)modifyNotificationRequest:(id)arg1 forCoalescedNotification:(id)arg2 ; 12 | -(void)removeNotificationRequest:(id)arg1 forCoalescedNotification:(id)arg2 ; 13 | -(NSSet *)allNotificationRequests; 14 | -(id)collectionView; 15 | -(void)revealNotificationHistory:(BOOL)revealed; 16 | -(void)updateNotifications; 17 | 18 | @end 19 | -------------------------------------------------------------------------------- /Tweak/RandomHeaders.h: -------------------------------------------------------------------------------- 1 | #import "Protocol.h" 2 | #import 3 | #import 4 | 5 | @interface BBAction : NSObject 6 | +(instancetype)action; 7 | @end 8 | 9 | @interface BBObserver : NSObject 10 | @end 11 | 12 | @interface BBBulletin : NSObject 13 | @property (nonatomic,readonly) NSString * sectionDisplayName; 14 | @property (nonatomic,copy) NSString * header; 15 | @property (nonatomic,copy) NSString * section; 16 | @property (nonatomic,copy) NSString * sectionID; 17 | @property (nonatomic,copy) NSSet * subsectionIDs; 18 | @property (nonatomic,copy) NSString * recordID; 19 | @property (nonatomic,copy) NSString * publisherBulletinID; 20 | @property (nonatomic,copy) NSString * dismissalID; 21 | @property (nonatomic,copy) NSString * categoryID; 22 | @property (nonatomic,copy) NSString * threadID; 23 | @property (nonatomic,copy) NSArray * peopleIDs; 24 | @property (nonatomic,copy) NSString * bulletinID; 25 | @property (nonatomic,retain) NSDate *lastInterruptDate; 26 | @property (assign,nonatomic) BOOL clearable; 27 | @property (nonatomic,retain) NSDate *date; 28 | @property (nonatomic,copy) BBAction *defaultAction; 29 | @property (nonatomic,copy) NSString *message; 30 | @property (nonatomic,retain) NSDate *publicationDate; 31 | @property (assign,nonatomic) BOOL showsMessagePreview; 32 | @property (nonatomic,copy) NSString *title; 33 | +(id)bulletinWithBulletin:(id)arg1 ; 34 | @end 35 | 36 | @interface NCNotificationContent : NSObject 37 | @property (nonatomic,readonly) UIImage * icon; 38 | @property (nonatomic,copy,readonly) NSString * header; 39 | @end 40 | 41 | @interface NCNotificationRequest : NSObject 42 | @property (nonatomic,readonly) NCNotificationContent * content; 43 | @property (nonatomic,copy,readonly) NSString * sectionIdentifier; 44 | @property (nonatomic,copy,readonly) NSString * notificationIdentifier; 45 | @property (nonatomic,copy,readonly) NSString * threadIdentifier; 46 | @property (nonatomic,copy,readonly) NSString * categoryIdentifier; 47 | @property (nonatomic,readonly) BBBulletin * bulletin; 48 | @property (nonatomic,readonly) BBObserver * observer; 49 | @property (nonatomic,readonly) NSDate * timestamp; 50 | @end 51 | 52 | @interface NCCoalescedNotification : NSObject 53 | @property (nonatomic,copy,readonly) NSArray * notificationRequests; 54 | @end 55 | 56 | @interface NCNotificationCombinedListViewController : UIViewController 57 | @property (nonatomic, assign) BOOL axnAllowChanges; 58 | -(id)allNotificationRequests; 59 | -(id)axnNotificationRequests; 60 | -(bool)insertNotificationRequest:(id)arg1 forCoalescedNotification:(id)arg2 ; 61 | -(void)removeNotificationRequest:(id)arg1 forCoalescedNotification:(id)arg2 ; 62 | -(bool)modifyNotificationRequest:(id)arg1 forCoalescedNotification:(id)arg2 ; 63 | -(void)insertNotificationRequestIntoRecentsSection:(id)arg1 forCoalescedNotification:(id)arg2 ; 64 | -(void)_performNotificationHistorySectionOperation:(/*^block*/ id)arg1 animated:(bool)arg2 delayAnimation:(bool)arg3 ; 65 | -(void)removeNotificationRequestFromRecentsSection:(id)arg1 forCoalescedNotification:(id)arg2 ; 66 | -(void)forceNotificationHistoryRevealed:(bool)arg1 animated:(bool)arg2 ; 67 | -(void)_revealNotificationsHistory; 68 | -(void)setShouldAllowNotificationsHistoryReveal:(bool)arg1 ; 69 | -(void)_setShowingNotificationsHistory:(bool)arg1 animated:(bool)arg2 ; 70 | -(void)_setShowingNotificationsHistory:(bool)arg1 ; 71 | -(bool)shouldAllowNotificationsHistoryReveal; 72 | -(void)setDidPlayRevealHaptic:(bool)arg1 ; 73 | -(void)setNotificationHistorySectionNeedsReload:(bool)arg1 ; 74 | -(void)_reloadNotificationHistorySectionIfNecessary; 75 | -(id)_coalescingIdentifierForNotificationRequest:(id)arg1 ; 76 | -(bool)hasContent; 77 | -(void)clearAllCoalescingControlsCells; 78 | -(void)clearAll; 79 | -(UICollectionView*)collectionView; 80 | -(void)_resetNotificationsHistory; 81 | @end 82 | 83 | @interface SBDashBoardCombinedListViewController : UIViewController 84 | -(void)_setListHasContent:(BOOL)arg1; 85 | -(bool)hasContent; 86 | @end 87 | 88 | @interface NCNotificationStore : NSObject 89 | -(NCCoalescedNotification *)coalescedNotificationForRequest:(id)arg1 ; 90 | @end 91 | 92 | @interface NCNotificationDispatcher : NSObject 93 | @property (nonatomic,retain) NCNotificationStore * notificationStore; 94 | -(void)destination:(id)arg1 requestsClearingNotificationRequests:(id)arg2 ; 95 | -(void)destination:(id)arg1 requestsClearingNotificationRequests:(id)arg2 fromDestinations:(id)arg3 ; 96 | @end 97 | 98 | @interface SBNCNotificationDispatcher : NSObject 99 | @property (nonatomic,retain) NCNotificationDispatcher * dispatcher; 100 | @end 101 | 102 | @interface SBIcon : NSObject 103 | 104 | struct SBIconImageInfo { 105 | CGFloat width; 106 | CGFloat height; 107 | CGFloat field1; 108 | CGFloat field2; 109 | }; 110 | 111 | -(UIImage *)getIconImage:(int)arg1 ; 112 | -(UIImage *)iconImageWithInfo:(struct SBIconImageInfo)info; 113 | 114 | @end 115 | 116 | @interface SBIconModel : NSObject 117 | 118 | -(SBIcon *)applicationIconForBundleIdentifier:(id)arg1 ; 119 | 120 | @end 121 | 122 | @interface SBIconViewMap : NSObject 123 | 124 | @property (nonatomic,readonly) SBIconModel * iconModel; 125 | 126 | @end 127 | 128 | @interface SBIconController : UIViewController 129 | 130 | @property (nonatomic, retain) WKWebView *axnIntegrityView; 131 | +(id)sharedInstance; 132 | -(SBIconViewMap *)homescreenIconViewMap; 133 | -(SBIconModel *)model; 134 | 135 | @end 136 | 137 | @interface UIImage (Private) 138 | 139 | + (UIImage *)_applicationIconImageForBundleIdentifier:(NSString *)bundleIdentifier format:(int)format scale:(CGFloat)scale; 140 | 141 | @end 142 | 143 | @interface CALayer (Private) 144 | 145 | @property (nonatomic, assign) BOOL continuousCorners; 146 | 147 | @end 148 | 149 | @interface _UILegibilitySettings : NSObject 150 | 151 | @property (nonatomic,retain) UIColor * primaryColor; 152 | 153 | @end 154 | 155 | @interface SBFLockScreenDateView : UIView 156 | 157 | @property (nonatomic,retain) _UILegibilitySettings * legibilitySettings; 158 | -(id)initWithFrame:(CGRect)arg1 ; 159 | -(void)setLegibilitySettings:(_UILegibilitySettings *)arg1 ; 160 | 161 | @end 162 | 163 | @interface SBIdleTimerGlobalCoordinator : NSObject 164 | 165 | +(id)sharedInstance; 166 | -(void)resetIdleTimer; 167 | 168 | @end 169 | 170 | @interface UIScrollView(Private) 171 | 172 | -(BOOL)_scrollToTopIfPossible:(BOOL)arg1; 173 | 174 | @end 175 | -------------------------------------------------------------------------------- /Tweak/Selenium.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Filter 6 | 7 | Bundles 8 | 9 | com.apple.springboard 10 | com.apple.Preferences 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /Tweak/Tweak.h: -------------------------------------------------------------------------------- 1 | #import 2 | #import 3 | #import 4 | #import 5 | #import 6 | #import "RandomHeaders.h" 7 | #import "AXNView.h" 8 | 9 | #define kIdentifier @"com.miwix.selenium" 10 | #define kSettingsChangedNotification (CFStringRef)@"com.miwix.selenium/ReloadPrefs" 11 | #define kSettingsPath @"/var/mobile/Library/Preferences/com.miwix.selenium.plist" 12 | 13 | @interface SBDashBoardNotificationAdjunctListViewController : UIViewController { 14 | UIStackView* _stackView; 15 | } 16 | 17 | @property (nonatomic, retain) AXNView *axnView; 18 | 19 | -(void)adjunctListModel:(id)arg1 didAddItem:(id)arg2 ; 20 | -(void)adjunctListModel:(id)arg1 didRemoveItem:(id)arg2 ; 21 | -(void)_didUpdateDisplay; 22 | -(CGSize)sizeToMimic; 23 | -(void)_insertItem:(id)arg1 animated:(BOOL)arg2 ; 24 | -(void)_removeItem:(id)arg1 animated:(BOOL)arg2 ; 25 | -(BOOL)isPresentingContent; 26 | 27 | @end 28 | // iOS13 Support 29 | @interface CSNotificationAdjunctListViewController : UIViewController { 30 | UIStackView* _stackView; 31 | } 32 | 33 | @property (nonatomic, retain) AXNView *axnView; 34 | 35 | -(void)adjunctListModel:(id)arg1 didAddItem:(id)arg2 ; 36 | -(void)adjunctListModel:(id)arg1 didRemoveItem:(id)arg2 ; 37 | -(void)_didUpdateDisplay; 38 | -(CGSize)sizeToMimic; 39 | -(void)_insertItem:(id)arg1 animated:(BOOL)arg2 ; 40 | -(void)_removeItem:(id)arg1 animated:(BOOL)arg2 ; 41 | -(BOOL)isPresentingContent; 42 | 43 | @end 44 | 45 | 46 | @interface SBDashBoardCombinedListViewController (Axon) 47 | 48 | @property (nonatomic, retain) AXNView *axnView; 49 | 50 | @end 51 | // iOS13 Support 52 | @interface CSCombinedListViewController : UIViewController 53 | 54 | @property (nonatomic, retain) AXNView *axnView; 55 | 56 | @end 57 | -------------------------------------------------------------------------------- /Tweak/TweakCCSelenium.h: -------------------------------------------------------------------------------- 1 | @interface CCUIContentModuleContentContainerView : UIView 2 | @end 3 | 4 | @interface CCUIContentModuleBackgroundView : UIView 5 | @end 6 | 7 | @interface MTMaterialView : UIView 8 | @end 9 | 10 | @interface CCUIRoundButton : UIControl 11 | @property (nonatomic, retain) MTMaterialView *normalStateBackgroundView; 12 | - (void)_unhighlight; 13 | - (void)setHighlighted:(bool)arg1; 14 | @end 15 | 16 | @interface CCUILabeledRoundButton : UIView 17 | @property (nonatomic, assign) bool centered; 18 | @property (nonatomic, copy) NSString *title; 19 | @property (nonatomic, copy) NSString *subtitle; 20 | @property (nonatomic, assign) bool labelsVisible; 21 | @property (nonatomic, retain) UIImage *glyphImage; 22 | @property (nonatomic, retain) CCUIRoundButton *buttonView; 23 | - (id)initWithGlyphImage:(id)arg1 highlightColor:(id)arg2 useLightStyle:(BOOL)arg3; 24 | - (void)updatePosition; 25 | @end 26 | 27 | @interface CCUILabeledRoundButtonViewController : UIViewController 28 | @property (nonatomic,copy) NSString *title; 29 | @property (nonatomic,copy) NSString *subtitle; 30 | @property (nonatomic, retain) UIColor *highlightColor; 31 | @property (nonatomic, assign) bool labelsVisible; 32 | @property (nonatomic, retain) CCUILabeledRoundButton *buttonContainer; 33 | @property (nonatomic, retain) CCUIRoundButton *button; 34 | -(id)initWithGlyphImage:(id)arg1 highlightColor:(id)arg2 useLightStyle:(BOOL)arg3 ; 35 | @end 36 | 37 | @interface CCUIDisplayBackgroundViewController : UIViewController 38 | @property (nonatomic, retain) CCUILabeledRoundButtonViewController *nightShiftButton; 39 | @property (nonatomic, retain) CCUILabeledRoundButtonViewController *trueToneButton; 40 | @end 41 | 42 | @interface CCUIContentModuleContainerViewController : UIViewController 43 | @property (nonatomic,copy) NSString *moduleIdentifier; 44 | @property (nonatomic,strong,readwrite) CCUIContentModuleBackgroundView *backgroundView; 45 | @property (nonatomic,retain) CCUIDisplayBackgroundViewController *backgroundViewController; 46 | @property (nonatomic, retain) CCUILabeledRoundButtonViewController *darkButton; 47 | @end 48 | 49 | @interface CAPackage : NSObject 50 | @property (readonly) CALayer *rootLayer; 51 | @property (readonly) BOOL geometryFlipped; 52 | + (id)packageWithContentsOfURL:(id)arg1 type:(id)arg2 options:(id)arg3 error:(id)arg4; 53 | - (id)_initWithContentsOfURL:(id)arg1 type:(id)arg2 options:(id)arg3 error:(id)arg4; 54 | @end 55 | 56 | extern NSString const *kCAPackageTypeCAMLBundle; 57 | 58 | @interface CCUICAPackageView : UIView 59 | @property (nonatomic, retain) CAPackage *package; 60 | - (void)setStateName:(id)arg1; 61 | @end 62 | 63 | @interface CCUISeleniumButton : CCUIRoundButton 64 | @property (nonatomic, retain) UIView *backgroundView; 65 | @property (nonatomic, retain) CCUICAPackageView *packageView; 66 | - (id)initWithGlyphImage:(id)arg1 highlightColor:(id)arg2 useLightStyle:(BOOL)arg3; 67 | - (void)updateStateAnimated:(bool)arg1; 68 | @end 69 | 70 | @interface DNDState : NSObject 71 | -(BOOL)isActive; 72 | @end 73 | -------------------------------------------------------------------------------- /Tweak/config.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | entries 6 | 7 | 8 | snoozedCache 9 | 10 | 11 | DND 12 | 13 | 14 | location 15 | 16 | 17 | DNDEnabled 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /control: -------------------------------------------------------------------------------- 1 | Package: com.miwix.selenium 2 | Name: Selenium 3 | Depends: mobilesubstrate, ws.hbang.common, firmware (>= 13.0) 4 | Version: 1.2.1 5 | Architecture: iphoneos-arm 6 | Description: Snooze notifications. Focus on what matters⏱ 7 | Maintainer: Lavie Gariv 8 | Author: Lavie Gariv 9 | Section: Tweaks 10 | -------------------------------------------------------------------------------- /layout/DEBIAN/postinst: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # echo "[Selenium] Setting permissions..." 4 | 5 | # FILE="/Library/Application Support/SeleniumExtra.bundle/Assets/icon.PNG" 6 | # if test -f "$FILE"; then 7 | # echo "[Selenium] Icon..." 8 | # chmod 0644 "/Library/Application Support/SeleniumExtra.bundle/Assets/icon.PNG" 9 | # fi 10 | 11 | # FILE="/Library/Application Support/SeleniumExtra.bundle/de.lproj/Localizable.strings" 12 | # if test -f "$FILE"; then 13 | # echo "[Selenium] German..." 14 | # chmod 0644 "/Library/Application Support/SeleniumExtra.bundle/de.lproj/Localizable.strings" 15 | # fi 16 | 17 | # FILE="/Library/Application Support/SeleniumExtra.bundle/en.lproj/Localizable.strings" 18 | # if test -f "$FILE"; then 19 | # echo "[Selenium] English..." 20 | # chmod 0644 "/Library/Application Support/SeleniumExtra.bundle/en.lproj/Localizable.strings" 21 | # fi 22 | 23 | # FILE="/Library/Application Support/SeleniumExtra.bundle/fr.lproj/Localizable.strings" 24 | # if test -f "$FILE"; then 25 | # echo "[Selenium] French..." 26 | # chmod 0644 "/Library/Application Support/SeleniumExtra.bundle/fr.lproj/Localizable.strings" 27 | # fi 28 | 29 | # FILE="/Library/Application Support/SeleniumExtra.bundle/he.lproj/Localizable.strings" 30 | # if test -f "$FILE"; then 31 | # echo "[Selenium] Hebrew..." 32 | # chmod 0644 "/Library/Application Support/SeleniumExtra.bundle/he.lproj/Localizable.strings" 33 | # fi 34 | 35 | # FILE="/System/Library/CoreServices/SpringBoard.app/Info.plist" 36 | # if test -f "$FILE"; then 37 | # echo "[Selenium] SpringBoard..." 38 | # chmod 0644 "/System/Library/CoreServices/SpringBoard.app/Info.plist" 39 | # fi 40 | 41 | # echo "[Selenium] Permissions set!" 42 | -------------------------------------------------------------------------------- /layout/DEBIAN/postrm: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Removing manager.plist 4 | 5 | # if [ "remove" == "$1" ]; then 6 | # echo "[Selenium] Removing files..." 7 | # FILE="/var/mobile/Library/Selenium/manager.plist" 8 | # if test -f "$FILE"; then 9 | # rm -r "/var/mobile/Library/Selenium/" 10 | # fi 11 | 12 | # echo "[Selenium] Restoring backup..." 13 | # BACKUP="/System/Library/CoreServices/SpringBoard.app/Info.plist.backup" 14 | # if test -f "$BACKUP"; then 15 | # rm /System/Library/CoreServices/SpringBoard.app/Info.plist 16 | # mv /System/Library/CoreServices/SpringBoard.app/Info.plist.backup /System/Library/CoreServices/SpringBoard.app/Info.plist 17 | # echo "[Selenium] Backup restored!" 18 | # fi 19 | # fi 20 | 21 | 22 | # # Aborting install/upgrade if preinst extied with an error 23 | 24 | # ABORT=0 25 | 26 | # case "$1" in 27 | # abort-install ) 28 | # ABORT=1 29 | # #finish return 30 | # ;; 31 | # abort-upgrade ) 32 | # ABORT=1 33 | # #finish return 34 | # ;; 35 | # failed-upgrade ) 36 | # ABORT=1 37 | # #finish return 38 | # ;; 39 | # esac 40 | 41 | # if [ $ABORT == 1 ]; then 42 | # echo "[Selenium] Aborting..." 43 | # BACKUP="/System/Library/CoreServices/SpringBoard.app/Info.plist.backup" 44 | # if test -f "$BACKUP"; then 45 | # rm /System/Library/CoreServices/SpringBoard.app/Info.plist 46 | # mv /System/Library/CoreServices/SpringBoard.app/Info.plist.backup /System/Library/CoreServices/SpringBoard.app/Info.plist 47 | # echo "[Selenium] An error occured during install. System modifications were reverted to original state." 48 | # fi 49 | # fi 50 | -------------------------------------------------------------------------------- /layout/DEBIAN/preinst: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # set -e 4 | # x=1 5 | # while [ $x -eq 1 ] 6 | # do 7 | # #ARG="install" 8 | # #if [ "$ARG" == "$1" ]; then 9 | # echo "[Selenium] Checking files..." 10 | # FILE="/Library/Application Support/SeleniumExtra.bundle/txt.txt" 11 | # if test -f "$FILE"; then 12 | # chmod 0644 "/Library/Application Support/SeleniumExtra.bundle/txt.txt" 13 | # fi 14 | # INFO="/System/Library/CoreServices/SpringBoard.app/Info.plist" 15 | # if test -f "$INFO"; then 16 | # BACKUP="/System/Library/CoreServices/SpringBoard.app/Info.plist.backup" 17 | # if test -f "$BACKUP"; then 18 | # echo "[Selenium] Backup exists!" 19 | # echo "[Selenium] Files already modified!" 20 | # else 21 | # echo "[Selenium] Backing up files..." 22 | # cp /System/Library/CoreServices/SpringBoard.app/Info.plist /System/Library/CoreServices/SpringBoard.app/Info.plist.backup && : || break 23 | # echo "[Selenium] Modifying files..." 24 | # plutil -convert xml1 $INFO > /dev/null 2>&1 && : || break 25 | # echo "[Selenium] Modifying files..." 26 | # LINES="$(wc -l $INFO | sed -n 's/ $INFO//gp' | sed -n 's/ //gp')" 27 | # echo "[Selenium] Modifying files..." 28 | # NEWLINES="$(echo "$((LINES - 2))")" 29 | # echo "[Selenium] Modifying files..." 30 | # echo "$(cat $INFO | head -n$NEWLINES)" > newInfo.plist && : || break 31 | # echo "[Selenium] Modifying files..." 32 | # echo " UIBackgroundModes" >> newInfo.plist && : || break 33 | # echo " " >> newInfo.plist && : || break 34 | # echo " location" >> newInfo.plist && : || break 35 | # echo " " >> newInfo.plist && : || break 36 | # echo " NSLocationAlwaysAndWhenInUseUsageDescription" >> newInfo.plist && : || break 37 | # echo " Set location access to 'Always' to enable location-based features for Selenium." >> newInfo.plist && : || break 38 | # echo " NSLocationWhenInUseUsageDescription" >> newInfo.plist && : || break 39 | # echo " Set location access to 'Always' to enable location-based features for Selenium." >> newInfo.plist && : || break 40 | # echo "" >> newInfo.plist && : || break 41 | # echo "" >> newInfo.plist && : || break 42 | # rm -r $INFO 43 | # mv newInfo.plist $INFO && : || break 44 | # plutil -convert binary1 $INFO > /dev/null 2>&1 && : || break 45 | # echo "[Selenium] Files modified!" 46 | # fi 47 | # fi 48 | # set -t 49 | # exit 0 50 | # set +t 51 | # #fi 52 | # x=$[$x-1] 53 | # done 54 | # exit 1 55 | -------------------------------------------------------------------------------- /layout/Library/Application Support/SeleniumExtra.bundle/Assets/icon.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lgariv/Selenium/a5c925b5ad78dc1d3862740b8ef516b33d57bf57/layout/Library/Application Support/SeleniumExtra.bundle/Assets/icon.PNG -------------------------------------------------------------------------------- /layout/Library/Application Support/SeleniumExtra.bundle/StyleMode.ca/index.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | documentHeight 6 | 40 7 | documentResizesToView 8 | 9 | documentWidth 10 | 40 11 | dynamicGuidesEnabled 12 | 13 | fileID 14 | 12181974097127107471 15 | geometryFlipped 16 | 17 | guidesEnabled 18 | 19 | interactiveMouseEventsEnabled 20 | 21 | interactiveTouchEventsEnabled 22 | 23 | lastTemporaryDirPath 24 | /var/folders/3d/k3zmc8h53pv08m948fmlhv640000gp/T/MicaAssets-rmzwvk 25 | loopEnd 26 | +infinity 27 | loopStart 28 | 0.0 29 | loopingEnabled 30 | 31 | multitouchDisablesMouse 32 | 33 | multitouchEnabled 34 | 35 | plugins 36 | 37 | presentationMouseEventsEnabled 38 | 39 | presentationTouchEventsEnabled 40 | 41 | rootDocument 42 | main.caml 43 | savesWindowFrame 44 | 45 | scalesToFitInPlayer 46 | 47 | showsTouches 48 | 49 | snappingEnabled 50 | 51 | timelineMarkers 52 | [(null)] 53 | touchesColor 54 | 1 1 0 0.8 55 | unitsInPixelsInPlayer 56 | 57 | useSingleAppMode 58 | 59 | 60 | 61 | -------------------------------------------------------------------------------- /layout/Library/Application Support/SeleniumExtra.bundle/StyleMode.ca/main.caml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | -------------------------------------------------------------------------------- /layout/Library/Application Support/SeleniumExtra.bundle/de.lproj/Localizable.strings: -------------------------------------------------------------------------------- 1 | 2 | SNOOZEN 3 | Benachrichtigung schlummern 4 | SNOOZENS 5 | Benachrichtigungen schlummern 6 | SNOOZE 7 | Schlummern 8 | SNOOZED 9 | Schlummernd 10 | fMINUTES 11 | Für 15 Minuten 12 | tMINUTES 13 | Für 30 Minuten 14 | ffMINUTES 15 | Für 45 Minuten 16 | oneHOUR 17 | Für 1 Stunde 18 | twoHOURS 19 | Für 2 Stunden 20 | threeHOURS 21 | Für 3 Stunden 22 | fourHOURS 23 | Für 4 Stunden 24 | sixHOURS 25 | Für 6 Stunden 26 | eightHOURS 27 | Für 8 Stunden 28 | twelveHOURS 29 | Für 12 Stunden 30 | sTIME 31 | Spezifische Zeit 32 | SNOOZEU 33 | Schlummern bis 34 | SNOOZEF 35 | Schlummern für 36 | CANCEL 37 | Abbrechen 38 | TAPCHANGE 39 | Tippen zum ändern 40 | STEPPER 41 | Schrittweise 42 | ARRIVELOCATION 43 | Bis ich vor Ort sein werde 44 | LEAVELOCATION 45 | Bis ich einen Ort verlasse 46 | LOCATION 47 | Ort 48 | 49 | -------------------------------------------------------------------------------- /layout/Library/Application Support/SeleniumExtra.bundle/en.lproj/Localizable.strings: -------------------------------------------------------------------------------- 1 | 2 | SNOOZEN 3 | Snooze Notification 4 | SNOOZENS 5 | Snooze Notifications 6 | SNOOZE 7 | Snooze 8 | SNOOZED 9 | Snoozed 10 | fMINUTES 11 | For 15 Minutes 12 | tMINUTES 13 | For 30 Minutes 14 | ffMINUTES 15 | For 45 Minutes 16 | oneHOUR 17 | For 1 Hour 18 | twoHOURS 19 | For 2 Hours 20 | threeHOURS 21 | For 3 Hours 22 | fourHOURS 23 | For 4 Hours 24 | sixHOURS 25 | For 6 Hours 26 | eightHOURS 27 | For 8 Hours 28 | twelveHOURS 29 | For 12 Hours 30 | sTIME 31 | Specific Time 32 | SNOOZEU 33 | Snooze Until 34 | SNOOZEF 35 | Snooze For 36 | CANCEL 37 | Cancel 38 | TAPCHANGE 39 | Tap To Change 40 | STEPPER 41 | Stepper 42 | ARRIVELOCATION 43 | Until I arrive at location 44 | LEAVELOCATION 45 | Until I leave location 46 | LOCATION 47 | Location 48 | 49 | -------------------------------------------------------------------------------- /layout/Library/Application Support/SeleniumExtra.bundle/fr.lproj/Localizable.strings: -------------------------------------------------------------------------------- 1 | 2 | SNOOZEN 3 | Snooze Notification 4 | SNOOZENS 5 | Snooze Notifications 6 | SNOOZE 7 | Snooze 8 | SNOOZED 9 | Snoozed 10 | fMINUTES 11 | Pendant 15 minutes 12 | tMINUTES 13 | Pendant 30 minutes 14 | ffMINUTES 15 | Pendant 45 minutes 16 | oneHOUR 17 | Pendant 1 heure 18 | twoHOURS 19 | Pendant 2 heures 20 | threeHOURS 21 | Pendant 3 heures 22 | fourHOURS 23 | Pendant 4 heures 24 | sixHOURS 25 | Pendant 6 heures 26 | eightHOURS 27 | Pendant 8 heures 28 | twelveHOURS 29 | Pendant 12 heures 30 | sTIME 31 | Jusqu'à une certaine heure 32 | SNOOZEU 33 | Snooze jusqu'à 34 | SNOOZEF 35 | Snooze pendant 36 | CANCEL 37 | Annuler 38 | TAPCHANGE 39 | Appuyez Pour Changer 40 | STEPPER 41 | Durée personnalisée 42 | ARRIVELOCATION 43 | jusqu'à ce que j'arriverai lieu 44 | LEAVELOCATION 45 | jusqu'à ce que j'quitte lieu 46 | LOCATION 47 | Lieu 48 | 49 | -------------------------------------------------------------------------------- /layout/Library/Application Support/SeleniumExtra.bundle/he.lproj/Localizable.strings: -------------------------------------------------------------------------------- 1 | 2 | SNOOZEN 3 | דחה התראה 4 | SNOOZENS 5 | דחה התראות 6 | SNOOZE 7 | דחה 8 | SNOOZED 9 | נדחה 10 | fMINUTES 11 | 15 דקות 12 | tMINUTES 13 | 30 דקות 14 | ffMINUTES 15 | 45 דקות 16 | oneHOUR 17 | שעה אחת 18 | twoHOURS 19 | שעתיים 20 | threeHOURS 21 | 3 שעות 22 | fourHOURS 23 | 4 שעות 24 | sixHOURS 25 | 6 שעות 26 | eightHOURS 27 | 8 שעות 28 | twelveHOURS 29 | 12 שעות 30 | sTIME 31 | זמן ספציפי 32 | SNOOZEF 33 | דחה ל 34 | SNOOZEU 35 | דחה עד ל 36 | CANCEL 37 | ביטול 38 | TAPCHANGE 39 | הקש כדי לשנות 40 | STEPPER 41 | סטפר 42 | ARRIVELOCATION 43 | עד הגעתי למיקום 44 | LEAVELOCATION 45 | עד שאצא ממיקום 46 | LOCATION 47 | מיקום 48 | 49 | -------------------------------------------------------------------------------- /layout/Library/Application Support/SeleniumExtra.bundle/zh_TW.iproj/Localizable.strings: -------------------------------------------------------------------------------- 1 | 2 | SNOOZEN 3 | 讓通知稍後提醒 4 | SNOOZENS 5 | 讓通知稍後提醒 6 | SNOOZE 7 | 稍後提醒 8 | SNOOZED 9 | 已啟用稍後提醒 10 | fMINUTES 11 | 十五分鐘後 12 | tMINUTES 13 | 三十分鐘後 14 | ffMINUTES 15 | 四十五分鐘後 16 | oneHOUR 17 | 一小時後 18 | twoHOURS 19 | 兩小時後 20 | threeHOURS 21 | 三小時後 22 | fourHOURS 23 | 四小時後 24 | sixHOURS 25 | 六小時後 26 | eightHOURS 27 | 八小時後 28 | twelveHOURS 29 | 半天後 30 | sTIME 31 | 關鍵時刻(劉寶傑(誤)) 32 | SNOOZEU 33 | 提醒 34 | SNOOZEF 35 | 36 | CANCEL 37 | 取消 38 | TAPCHANGE 39 | 點擊來編輯 40 | STEPPER 41 | 步進器 42 | ARRIVELOCATION 43 | 直到抵達指定地點 44 | LEAVELOCATION 45 | 直到離開指定地點 46 | LOCATION 47 | 位置 48 | 49 | -------------------------------------------------------------------------------- /seleniumprefs/Makefile: -------------------------------------------------------------------------------- 1 | include $(THEOS)/makefiles/common.mk 2 | 3 | BUNDLE_NAME = SeleniumPrefs 4 | 5 | SeleniumPrefs_FILES = SLNMPRootListController.m 6 | SeleniumPrefs_FRAMEWORKS = UIKit 7 | SeleniumPrefs_PRIVATE_FRAMEWORKS = Preferences 8 | SeleniumPrefs_EXTRA_FRAMEWORKS += Cephei CepheiPrefs 9 | SeleniumPrefs_INSTALL_PATH = /Library/PreferenceBundles 10 | SeleniumPrefs_CFLAGS = -fobjc-arc -Wno-unguarded-availability-new -w -fdiagnostics-absolute-paths 11 | 12 | include $(THEOS_MAKE_PATH)/bundle.mk 13 | 14 | internal-stage:: 15 | $(ECHO_NOTHING)mkdir -p $(THEOS_STAGING_DIR)/Library/PreferenceLoader/Preferences$(ECHO_END) 16 | $(ECHO_NOTHING)cp entry.plist $(THEOS_STAGING_DIR)/Library/PreferenceLoader/Preferences/SeleniumPrefs.plist$(ECHO_END) 17 | -------------------------------------------------------------------------------- /seleniumprefs/Resources/Cydia@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lgariv/Selenium/a5c925b5ad78dc1d3862740b8ef516b33d57bf57/seleniumprefs/Resources/Cydia@2x.png -------------------------------------------------------------------------------- /seleniumprefs/Resources/Cydia@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lgariv/Selenium/a5c925b5ad78dc1d3862740b8ef516b33d57bf57/seleniumprefs/Resources/Cydia@3x.png -------------------------------------------------------------------------------- /seleniumprefs/Resources/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleExecutable 8 | SeleniumPrefs 9 | CFBundleIdentifier 10 | com.miwix.seleniumprefs 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundlePackageType 14 | BNDL 15 | CFBundleShortVersionString 16 | 1.0.0 17 | CFBundleSignature 18 | ???? 19 | CFBundleVersion 20 | 1.0 21 | NSPrincipalClass 22 | SLNMPRootListController 23 | 24 | 25 | -------------------------------------------------------------------------------- /seleniumprefs/Resources/Octocat.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lgariv/Selenium/a5c925b5ad78dc1d3862740b8ef516b33d57bf57/seleniumprefs/Resources/Octocat.png -------------------------------------------------------------------------------- /seleniumprefs/Resources/Octocat@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lgariv/Selenium/a5c925b5ad78dc1d3862740b8ef516b33d57bf57/seleniumprefs/Resources/Octocat@2x.png -------------------------------------------------------------------------------- /seleniumprefs/Resources/Octocat@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lgariv/Selenium/a5c925b5ad78dc1d3862740b8ef516b33d57bf57/seleniumprefs/Resources/Octocat@3x.png -------------------------------------------------------------------------------- /seleniumprefs/Resources/Root.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | items 6 | 7 | 8 | cell 9 | PSGroupCell 10 | label 11 | enabled 12 | 13 | 14 | PostNotification 15 | com.miwix.seleniumprefs/settingschanged 16 | cell 17 | PSSwitchCell 18 | default 19 | 20 | defaults 21 | com.miwix.seleniumprefs 22 | key 23 | TweakisEnabled 24 | label 25 | Enabled 26 | 27 | 28 | PostNotification 29 | com.miwix.seleniumprefs/settingschanged 30 | cell 31 | PSSwitchCell 32 | default 33 | 34 | defaults 35 | com.miwix.seleniumprefs 36 | key 37 | snooozedDeliverProminently 38 | label 39 | Snoozed Prominently 40 | 41 | 42 | cell 43 | PSGroupCell 44 | label 45 | Specific Time Interval (in minutes) 46 | footerText 47 | Requires a respring for changed to take effect. 48 | 49 | 50 | PostNotification 51 | com.miwix.seleniumprefs/settingschanged 52 | cell 53 | PSSegmentCell 54 | default 55 | 5 56 | defaults 57 | com.miwix.seleniumprefs 58 | key 59 | segmentInterval 60 | validValues 61 | 62 | 1 63 | 5 64 | 10 65 | 15 66 | 67 | validTitles 68 | 69 | 1 70 | 5 71 | 10 72 | 15 73 | 74 | 75 | 76 | cell 77 | PSGroupCell 78 | label 79 | Action To Replace 80 | footerText 81 | Requires a respring for changed to take effect. 82 | 83 | 84 | PostNotification 85 | com.miwix.seleniumprefs/settingschanged 86 | cell 87 | PSSegmentCell 88 | default 89 | 1 90 | defaults 91 | com.miwix.seleniumprefs 92 | key 93 | chosenButton 94 | validValues 95 | 96 | 0 97 | 1 98 | 99 | validTitles 100 | 101 | Manage 102 | View 103 | 104 | 105 | 106 | cell 107 | PSGroupCell 108 | label 109 | while playing 110 | footerText 111 | Deliver notifications quietly while playing music or watching a video. No banners, no sounds, and without waking up the screen. 112 | 113 | 114 | PostNotification 115 | com.miwix.seleniumprefs/settingschanged 116 | cell 117 | PSSwitchCell 118 | default 119 | 120 | defaults 121 | com.miwix.seleniumprefs 122 | key 123 | deliverQuietlyWhilePlaying 124 | label 125 | Deliver Quietly 126 | 127 | 147 | 148 | cell 149 | PSGroupCell 150 | label 151 | experimental 152 | 153 | 154 | PostNotification 155 | com.miwix.seleniumprefs/settingschanged 156 | cell 157 | PSSwitchCell 158 | default 159 | 160 | defaults 161 | com.miwix.seleniumprefs 162 | key 163 | snoozeByLocation 164 | label 165 | Location Snoozing 166 | 167 | 168 | cell 169 | PSGroupCell 170 | 171 | 172 | cell 173 | PSGroupCell 174 | label 175 | open-source 176 | 177 | 178 | cellClass 179 | HBLinkTableCell 180 | label 181 | Source Code 182 | subtitle 183 | https://github.com/lgariv/Selenium 184 | icon 185 | Octocat.png 186 | url 187 | https://github.com/lgariv/Selenium 188 | 189 | 190 | cell 191 | PSGroupCell 192 | label 193 | support 194 | 195 | 196 | cellClass 197 | HBTwitterCell 198 | label 199 | Follow me on Twitter 200 | user 201 | LavieGDev 202 | 203 | 204 | cellClass 205 | HBLinkTableCell 206 | label 207 | Donate me 208 | subtitle 209 | If you like my work😄 210 | icon 211 | paypal.png 212 | url 213 | https://www.paypal.com/donate/?hosted_button_id=DSAQ8SXMGFUNU 214 | 215 | 216 | cellClass 217 | HBLinkTableCell 218 | label 219 | Add my repo 220 | subtitle 221 | https://lgariv.github.io/LaVie/ 222 | icon 223 | Cydia.png 224 | url 225 | cydia://url/https://cydia.saurik.com/api/share#?source=https://lgariv.github.io/LaVie/ 226 | 227 | 228 | title 229 | Selenium 230 | 231 | 232 | -------------------------------------------------------------------------------- /seleniumprefs/Resources/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lgariv/Selenium/a5c925b5ad78dc1d3862740b8ef516b33d57bf57/seleniumprefs/Resources/icon.png -------------------------------------------------------------------------------- /seleniumprefs/Resources/icon@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lgariv/Selenium/a5c925b5ad78dc1d3862740b8ef516b33d57bf57/seleniumprefs/Resources/icon@2x.png -------------------------------------------------------------------------------- /seleniumprefs/Resources/icon@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lgariv/Selenium/a5c925b5ad78dc1d3862740b8ef516b33d57bf57/seleniumprefs/Resources/icon@3x.png -------------------------------------------------------------------------------- /seleniumprefs/Resources/paypal@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lgariv/Selenium/a5c925b5ad78dc1d3862740b8ef516b33d57bf57/seleniumprefs/Resources/paypal@2x.png -------------------------------------------------------------------------------- /seleniumprefs/Resources/paypal@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lgariv/Selenium/a5c925b5ad78dc1d3862740b8ef516b33d57bf57/seleniumprefs/Resources/paypal@3x.png -------------------------------------------------------------------------------- /seleniumprefs/SLNMPRootListController.h: -------------------------------------------------------------------------------- 1 | #import 2 | #import 3 | #import 4 | #import 5 | #import 6 | #import 7 | 8 | @interface BSAction : NSObject 9 | @end 10 | 11 | @interface SBSRelaunchAction : BSAction 12 | +(id)actionWithReason:(id)arg1 options:(unsigned long long)arg2 targetURL:(id)arg3 ; 13 | @end 14 | 15 | @interface FBSSystemService : NSObject 16 | +(id)sharedService; 17 | -(void)sendActions:(id)arg1 withResult:(/*^block*/id)arg2 ; 18 | @end 19 | 20 | @interface UIScrollView (fix) 21 | @property (getter=_minimumContentOffset,nonatomic,readonly) CGPoint minimumContentOffset; 22 | @end 23 | 24 | @interface SLNMPRootListController : HBRootListController 25 | 26 | @property (nonatomic, retain, nullable) NSMutableDictionary *savedSpecifiers; 27 | 28 | @property (nonatomic, retain, nullable) UIBarButtonItem *respringButton; 29 | 30 | @property (readwrite, copy, nonatomic, nullable) 31 | UIColor *navigationBarBackgroundColor; 32 | 33 | @property (readwrite, copy, nonatomic, nullable) 34 | UIColor *navigationBarTitleColor; 35 | 36 | @property (readwrite, copy, nonatomic, nullable) 37 | UIColor *navigationBarTintColor; 38 | 39 | @property (nonatomic, readwrite, assign) 40 | BOOL prefersLargeTitles; 41 | 42 | @property (nonatomic, strong, readwrite, nullable) 43 | UIView *titleView; 44 | 45 | @property (nonatomic, retain, nullable) UILabel* titleLabel; 46 | @property (nonatomic, retain, nullable) UIImageView* iconView; 47 | 48 | //@property(nonatomic, readwrite, copy) UINavigationBarAppearance *scrollEdgeAppearance; 49 | 50 | @end 51 | -------------------------------------------------------------------------------- /seleniumprefs/SLNMPRootListController.m: -------------------------------------------------------------------------------- 1 | #include "SLNMPRootListController.h" 2 | 3 | @implementation SLNMPRootListController 4 | 5 | - (NSArray *)specifiers { 6 | if (!_specifiers) { 7 | _specifiers = [self loadSpecifiersFromPlistName:@"Root" target:self]; 8 | } 9 | 10 | return _specifiers; 11 | } 12 | 13 | -(void)respring { 14 | UIView *view = [[UIView alloc] initWithFrame:self.view.frame]; 15 | [view setBackgroundColor:[UIColor blackColor]]; 16 | UIStackView *stackView = [[UIStackView alloc] initWithFrame:CGRectMake(0, 0, self.view.frame.size.width, self.view.frame.size.width)]; 17 | stackView.axis = UILayoutConstraintAxisVertical; 18 | stackView.alignment = UIStackViewAlignmentCenter; 19 | stackView.distribution = UIStackViewDistributionEqualSpacing; 20 | stackView.spacing = 4; 21 | [stackView setTranslatesAutoresizingMaskIntoConstraints:NO]; 22 | UIImage *iconImage = [UIImage imageWithContentsOfFile:@"/Library/Application Support/SeleniumExtra.bundle/Assets/icon.PNG"]; 23 | UIImageView *iconImageView = [[UIImageView alloc] initWithImage:iconImage]; 24 | [iconImageView setFrame:CGRectMake(0,0,200,200)]; 25 | [iconImageView setTranslatesAutoresizingMaskIntoConstraints:NO]; 26 | [iconImageView.widthAnchor constraintEqualToAnchor:nil constant:[[UIScreen mainScreen] bounds].size.width*0.4f].active = YES; 27 | [iconImageView.heightAnchor constraintEqualToAnchor:nil constant:[[UIScreen mainScreen] bounds].size.width*0.4f].active = YES; 28 | UIView *backgroundView = [[UIView alloc] initWithFrame:iconImageView.frame]; 29 | UIView *iconContainingView = [[UIView alloc] initWithFrame:iconImageView.frame]; 30 | [iconContainingView setBackgroundColor:[UIColor clearColor]]; 31 | [backgroundView.layer setCornerRadius:[backgroundView frame].size.height/4]; 32 | [backgroundView setBackgroundColor:[UIColor whiteColor]]; 33 | [iconContainingView addSubview:backgroundView]; 34 | [iconContainingView addSubview:iconImageView]; 35 | [iconContainingView sendSubviewToBack:backgroundView]; 36 | [iconContainingView setTranslatesAutoresizingMaskIntoConstraints:NO]; 37 | [iconContainingView.widthAnchor constraintEqualToAnchor:nil constant:[[UIScreen mainScreen] bounds].size.width*0.4f].active = YES; 38 | [iconContainingView.heightAnchor constraintEqualToAnchor:nil constant:[[UIScreen mainScreen] bounds].size.width*0.4f].active = YES; 39 | [backgroundView setTranslatesAutoresizingMaskIntoConstraints:NO]; 40 | [backgroundView.widthAnchor constraintEqualToAnchor:nil constant:[[UIScreen mainScreen] bounds].size.width*0.4f].active = YES; 41 | [backgroundView.heightAnchor constraintEqualToAnchor:nil constant:[[UIScreen mainScreen] bounds].size.width*0.4f].active = YES; 42 | [stackView addArrangedSubview:iconContainingView]; 43 | UILabel *labelOne = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, self.view.frame.size.width, self.view.frame.size.width)]; 44 | NSDictionary *attribs = @{NSFontAttributeName:[UIFont preferredFontForTextStyle:UIFontTextStyleLargeTitle]}; 45 | NSMutableAttributedString *attributedText = [[NSMutableAttributedString alloc] initWithString:@"Selenium" attributes:attribs]; 46 | labelOne.attributedText = attributedText; 47 | labelOne.textColor = [UIColor whiteColor]; 48 | labelOne.textAlignment = NSTextAlignmentCenter; 49 | labelOne.adjustsFontForContentSizeCategory = YES; 50 | [stackView addArrangedSubview:labelOne]; 51 | UILabel *labelTwo = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, self.view.frame.size.width, self.view.frame.size.width)]; 52 | NSDictionary *attribsTwo = @{NSFontAttributeName:[UIFont preferredFontForTextStyle:UIFontTextStyleBody]}; 53 | NSMutableAttributedString *attributedTextTwo = [[NSMutableAttributedString alloc] initWithString:@"You will be back in a moment." attributes:attribsTwo]; 54 | labelTwo.attributedText = attributedTextTwo; 55 | labelTwo.textColor = [UIColor whiteColor]; 56 | labelTwo.textAlignment = NSTextAlignmentCenter; 57 | labelOne.adjustsFontForContentSizeCategory = YES; 58 | [stackView addArrangedSubview:labelTwo]; 59 | [view addSubview:stackView]; 60 | [stackView.centerXAnchor constraintEqualToAnchor:view.centerXAnchor constant:0].active = YES; 61 | [stackView.centerYAnchor constraintEqualToAnchor:view.centerYAnchor constant:0].active = YES; 62 | [view setAlpha:0]; 63 | [[UIApplication sharedApplication].keyWindow.rootViewController.view.superview addSubview:view]; 64 | [UIView animateWithDuration:1.0f animations:^{ 65 | [view setAlpha:1]; 66 | } completion:^(BOOL finished) { 67 | SBSRelaunchAction *restartAction = [NSClassFromString(@"SBSRelaunchAction") actionWithReason:@"RestartRenderServer" options:2 targetURL:nil]; 68 | [[NSClassFromString(@"FBSSystemService") sharedService] sendActions:[NSSet setWithObject:restartAction] withResult:nil]; 69 | }]; 70 | } 71 | 72 | - (instancetype)init { 73 | self = [super init]; 74 | 75 | if (self) { 76 | self.navigationItem.largeTitleDisplayMode = UINavigationItemLargeTitleDisplayModeAlways; 77 | 78 | self.respringButton = [[UIBarButtonItem alloc] initWithTitle:@"Respring" 79 | style:UIBarButtonItemStylePlain 80 | target:self 81 | action:@selector(respring)]; 82 | self.respringButton.tintColor = [UIColor labelColor]; 83 | self.navigationItem.rightBarButtonItem = self.respringButton; 84 | self.navigationItem.titleView = [[UIView alloc] initWithFrame:CGRectMake(0,0,64,40)]; 85 | NSString *_title = @"Selenium"; 86 | NSString *_subtitle = @"Version 1.2.0"; 87 | 88 | UIStackView *text = [[UIStackView alloc] initWithFrame:CGRectMake(0,0,64,16)]; 89 | text.axis = 1; 90 | text.distribution = 0; 91 | text.alignment = UIStackViewAlignmentCenter; 92 | text.layoutMarginsRelativeArrangement = 0; 93 | text.spacing = 0; 94 | 95 | UILabel *titleLabel = [[UILabel alloc] initWithFrame:CGRectMake(0,0,64,8)]; 96 | titleLabel.text = _title; 97 | titleLabel.font = [UIFont boldSystemFontOfSize:16]; 98 | titleLabel.textColor = [UIColor labelColor]; 99 | titleLabel.adjustsFontSizeToFitWidth = YES; 100 | titleLabel.translatesAutoresizingMaskIntoConstraints = NO; 101 | titleLabel.textAlignment = NSTextAlignmentCenter; 102 | titleLabel.numberOfLines = 1; 103 | 104 | UILabel *subtitleLabel = [[UILabel alloc] initWithFrame:CGRectMake(0,0,64,8)]; 105 | subtitleLabel.text = _subtitle; 106 | subtitleLabel.font = [UIFont systemFontOfSize:16 weight:UIFontWeightThin]; 107 | subtitleLabel.textColor = [UIColor labelColor]; 108 | subtitleLabel.adjustsFontSizeToFitWidth = YES; 109 | subtitleLabel.translatesAutoresizingMaskIntoConstraints = NO; 110 | subtitleLabel.textAlignment = NSTextAlignmentCenter; 111 | subtitleLabel.numberOfLines = 1; 112 | 113 | [text addArrangedSubview:titleLabel]; 114 | [text addArrangedSubview:subtitleLabel]; 115 | 116 | self.iconView = [[UIImageView alloc] initWithFrame:CGRectMake(0,0,32,40)]; 117 | self.iconView.contentMode = UIViewContentModeScaleAspectFit; 118 | self.iconView.image = [UIImage imageWithContentsOfFile:@"/Library/PreferenceBundles/SeleniumPrefs.bundle/icon.png"]; 119 | self.iconView.translatesAutoresizingMaskIntoConstraints = NO; 120 | 121 | UIStackView *titleStackView = [[UIStackView alloc] initWithFrame:CGRectMake(0,0,64,80)]; 122 | titleStackView.axis = 1; 123 | titleStackView.distribution = 0; 124 | titleStackView.alignment = UIStackViewAlignmentCenter; 125 | titleStackView.layoutMarginsRelativeArrangement = 0; 126 | titleStackView.spacing = 1; 127 | 128 | [titleStackView addArrangedSubview:self.iconView]; 129 | [titleStackView addArrangedSubview:text]; 130 | 131 | [self.navigationItem.titleView addSubview:titleStackView]; 132 | 133 | 134 | HBAppearanceSettings *appearanceSettings = [[HBAppearanceSettings alloc] init]; 135 | appearanceSettings.navigationBarTintColor = [UIColor labelColor]; 136 | //appearanceSettings.navigationBarTitleColor = [UIColor colorWithWhite:0 alpha:1]; 137 | 138 | self.hb_appearanceSettings = appearanceSettings; 139 | } 140 | 141 | return self; 142 | } 143 | 144 | -(void)scrollViewDidScroll:(UIScrollView *)scrollView { 145 | 146 | CGFloat offsetY = scrollView.contentOffset.y; 147 | 148 | if (offsetY > (scrollView.minimumContentOffset.y+1)) { 149 | [UIView animateWithDuration:0.133 animations:^{ 150 | self.navigationItem.titleView.frame = CGRectMake(self.navigationItem.titleView.frame.origin.x, -40, self.navigationItem.titleView.frame.size.width, self.navigationItem.titleView.frame.size.height); 151 | }]; 152 | } else { 153 | [UIView animateWithDuration:0.133 animations:^{ 154 | self.navigationItem.titleView.frame = CGRectMake(self.navigationItem.titleView.frame.origin.x, 0, self.navigationItem.titleView.frame.size.width, self.navigationItem.titleView.frame.size.height); 155 | }]; 156 | } 157 | } 158 | @end 159 | -------------------------------------------------------------------------------- /seleniumprefs/entry.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | entry 6 | 7 | bundle 8 | SeleniumPrefs 9 | cell 10 | PSLinkCell 11 | detail 12 | SLNMPRootListController 13 | icon 14 | icon.png 15 | isController 16 | 17 | label 18 | Selenium 19 | 20 | 21 | 22 | --------------------------------------------------------------------------------