├── .gitignore ├── LICENSE ├── README.md ├── iOSOpenDev.pmdoc ├── 01iod-contents.xml ├── 01iod.xml ├── 02iod-contents.xml ├── 02iod.xml └── index.xml └── scripts ├── iod-setup ├── iod-setup_postinstall ├── iod-setup_preinstall ├── iod-uninstall ├── iod-uninstall_postinstall └── iod-uninstall_preinstall /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | ._* 3 | .VolumeIcon.icns 4 | .com.apple.timemachine.supported 5 | .fseventsd 6 | .localized 7 | .DocumentRevisions-V100 8 | .Spotlight-V100 9 | .vol 10 | Icon -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | iOSOpenDev is an independent project and has not been authorized, sponsored, or otherwise approved by Apple Inc. 2 | 3 | IOS is a registered trademark of Cisco and used under license by Apple Inc. 4 | 5 | Xcode is a registered trademark of Apple Inc. 6 | 7 | iOSOpenDev -- iOS Open Development 8 | Copyright (c) 2012-2013 Spencer W.S. James (Kokoabim) . 9 | 10 | GNU GENERAL PUBLIC LICENSE 11 | Version 2, June 1991 12 | 13 | Copyright (C) 1989, 1991 Free Software Foundation, Inc., 14 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 15 | Everyone is permitted to copy and distribute verbatim copies 16 | of this license document, but changing it is not allowed. 17 | 18 | Preamble 19 | 20 | The licenses for most software are designed to take away your 21 | freedom to share and change it. By contrast, the GNU General Public 22 | License is intended to guarantee your freedom to share and change free 23 | software--to make sure the software is free for all its users. This 24 | General Public License applies to most of the Free Software 25 | Foundation's software and to any other program whose authors commit to 26 | using it. (Some other Free Software Foundation software is covered by 27 | the GNU Lesser General Public License instead.) You can apply it to 28 | your programs, too. 29 | 30 | When we speak of free software, we are referring to freedom, not 31 | price. Our General Public Licenses are designed to make sure that you 32 | have the freedom to distribute copies of free software (and charge for 33 | this service if you wish), that you receive source code or can get it 34 | if you want it, that you can change the software or use pieces of it 35 | in new free programs; and that you know you can do these things. 36 | 37 | To protect your rights, we need to make restrictions that forbid 38 | anyone to deny you these rights or to ask you to surrender the rights. 39 | These restrictions translate to certain responsibilities for you if you 40 | distribute copies of the software, or if you modify it. 41 | 42 | For example, if you distribute copies of such a program, whether 43 | gratis or for a fee, you must give the recipients all the rights that 44 | you have. You must make sure that they, too, receive or can get the 45 | source code. And you must show them these terms so they know their 46 | rights. 47 | 48 | We protect your rights with two steps: (1) copyright the software, and 49 | (2) offer you this license which gives you legal permission to copy, 50 | distribute and/or modify the software. 51 | 52 | Also, for each author's protection and ours, we want to make certain 53 | that everyone understands that there is no warranty for this free 54 | software. If the software is modified by someone else and passed on, we 55 | want its recipients to know that what they have is not the original, so 56 | that any problems introduced by others will not reflect on the original 57 | authors' reputations. 58 | 59 | Finally, any free program is threatened constantly by software 60 | patents. We wish to avoid the danger that redistributors of a free 61 | program will individually obtain patent licenses, in effect making the 62 | program proprietary. To prevent this, we have made it clear that any 63 | patent must be licensed for everyone's free use or not licensed at all. 64 | 65 | The precise terms and conditions for copying, distribution and 66 | modification follow. 67 | 68 | GNU GENERAL PUBLIC LICENSE 69 | TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 70 | 71 | 0. This License applies to any program or other work which contains 72 | a notice placed by the copyright holder saying it may be distributed 73 | under the terms of this General Public License. The "Program", below, 74 | refers to any such program or work, and a "work based on the Program" 75 | means either the Program or any derivative work under copyright law: 76 | that is to say, a work containing the Program or a portion of it, 77 | either verbatim or with modifications and/or translated into another 78 | language. (Hereinafter, translation is included without limitation in 79 | the term "modification".) Each licensee is addressed as "you". 80 | 81 | Activities other than copying, distribution and modification are not 82 | covered by this License; they are outside its scope. The act of 83 | running the Program is not restricted, and the output from the Program 84 | is covered only if its contents constitute a work based on the 85 | Program (independent of having been made by running the Program). 86 | Whether that is true depends on what the Program does. 87 | 88 | 1. You may copy and distribute verbatim copies of the Program's 89 | source code as you receive it, in any medium, provided that you 90 | conspicuously and appropriately publish on each copy an appropriate 91 | copyright notice and disclaimer of warranty; keep intact all the 92 | notices that refer to this License and to the absence of any warranty; 93 | and give any other recipients of the Program a copy of this License 94 | along with the Program. 95 | 96 | You may charge a fee for the physical act of transferring a copy, and 97 | you may at your option offer warranty protection in exchange for a fee. 98 | 99 | 2. You may modify your copy or copies of the Program or any portion 100 | of it, thus forming a work based on the Program, and copy and 101 | distribute such modifications or work under the terms of Section 1 102 | above, provided that you also meet all of these conditions: 103 | 104 | a) You must cause the modified files to carry prominent notices 105 | stating that you changed the files and the date of any change. 106 | 107 | b) You must cause any work that you distribute or publish, that in 108 | whole or in part contains or is derived from the Program or any 109 | part thereof, to be licensed as a whole at no charge to all third 110 | parties under the terms of this License. 111 | 112 | c) If the modified program normally reads commands interactively 113 | when run, you must cause it, when started running for such 114 | interactive use in the most ordinary way, to print or display an 115 | announcement including an appropriate copyright notice and a 116 | notice that there is no warranty (or else, saying that you provide 117 | a warranty) and that users may redistribute the program under 118 | these conditions, and telling the user how to view a copy of this 119 | License. (Exception: if the Program itself is interactive but 120 | does not normally print such an announcement, your work based on 121 | the Program is not required to print an announcement.) 122 | 123 | These requirements apply to the modified work as a whole. If 124 | identifiable sections of that work are not derived from the Program, 125 | and can be reasonably considered independent and separate works in 126 | themselves, then this License, and its terms, do not apply to those 127 | sections when you distribute them as separate works. But when you 128 | distribute the same sections as part of a whole which is a work based 129 | on the Program, the distribution of the whole must be on the terms of 130 | this License, whose permissions for other licensees extend to the 131 | entire whole, and thus to each and every part regardless of who wrote it. 132 | 133 | Thus, it is not the intent of this section to claim rights or contest 134 | your rights to work written entirely by you; rather, the intent is to 135 | exercise the right to control the distribution of derivative or 136 | collective works based on the Program. 137 | 138 | In addition, mere aggregation of another work not based on the Program 139 | with the Program (or with a work based on the Program) on a volume of 140 | a storage or distribution medium does not bring the other work under 141 | the scope of this License. 142 | 143 | 3. You may copy and distribute the Program (or a work based on it, 144 | under Section 2) in object code or executable form under the terms of 145 | Sections 1 and 2 above provided that you also do one of the following: 146 | 147 | a) Accompany it with the complete corresponding machine-readable 148 | source code, which must be distributed under the terms of Sections 149 | 1 and 2 above on a medium customarily used for software interchange; or, 150 | 151 | b) Accompany it with a written offer, valid for at least three 152 | years, to give any third party, for a charge no more than your 153 | cost of physically performing source distribution, a complete 154 | machine-readable copy of the corresponding source code, to be 155 | distributed under the terms of Sections 1 and 2 above on a medium 156 | customarily used for software interchange; or, 157 | 158 | c) Accompany it with the information you received as to the offer 159 | to distribute corresponding source code. (This alternative is 160 | allowed only for noncommercial distribution and only if you 161 | received the program in object code or executable form with such 162 | an offer, in accord with Subsection b above.) 163 | 164 | The source code for a work means the preferred form of the work for 165 | making modifications to it. For an executable work, complete source 166 | code means all the source code for all modules it contains, plus any 167 | associated interface definition files, plus the scripts used to 168 | control compilation and installation of the executable. However, as a 169 | special exception, the source code distributed need not include 170 | anything that is normally distributed (in either source or binary 171 | form) with the major components (compiler, kernel, and so on) of the 172 | operating system on which the executable runs, unless that component 173 | itself accompanies the executable. 174 | 175 | If distribution of executable or object code is made by offering 176 | access to copy from a designated place, then offering equivalent 177 | access to copy the source code from the same place counts as 178 | distribution of the source code, even though third parties are not 179 | compelled to copy the source along with the object code. 180 | 181 | 4. You may not copy, modify, sublicense, or distribute the Program 182 | except as expressly provided under this License. Any attempt 183 | otherwise to copy, modify, sublicense or distribute the Program is 184 | void, and will automatically terminate your rights under this License. 185 | However, parties who have received copies, or rights, from you under 186 | this License will not have their licenses terminated so long as such 187 | parties remain in full compliance. 188 | 189 | 5. You are not required to accept this License, since you have not 190 | signed it. However, nothing else grants you permission to modify or 191 | distribute the Program or its derivative works. These actions are 192 | prohibited by law if you do not accept this License. Therefore, by 193 | modifying or distributing the Program (or any work based on the 194 | Program), you indicate your acceptance of this License to do so, and 195 | all its terms and conditions for copying, distributing or modifying 196 | the Program or works based on it. 197 | 198 | 6. Each time you redistribute the Program (or any work based on the 199 | Program), the recipient automatically receives a license from the 200 | original licensor to copy, distribute or modify the Program subject to 201 | these terms and conditions. You may not impose any further 202 | restrictions on the recipients' exercise of the rights granted herein. 203 | You are not responsible for enforcing compliance by third parties to 204 | this License. 205 | 206 | 7. If, as a consequence of a court judgment or allegation of patent 207 | infringement or for any other reason (not limited to patent issues), 208 | conditions are imposed on you (whether by court order, agreement or 209 | otherwise) that contradict the conditions of this License, they do not 210 | excuse you from the conditions of this License. If you cannot 211 | distribute so as to satisfy simultaneously your obligations under this 212 | License and any other pertinent obligations, then as a consequence you 213 | may not distribute the Program at all. For example, if a patent 214 | license would not permit royalty-free redistribution of the Program by 215 | all those who receive copies directly or indirectly through you, then 216 | the only way you could satisfy both it and this License would be to 217 | refrain entirely from distribution of the Program. 218 | 219 | If any portion of this section is held invalid or unenforceable under 220 | any particular circumstance, the balance of the section is intended to 221 | apply and the section as a whole is intended to apply in other 222 | circumstances. 223 | 224 | It is not the purpose of this section to induce you to infringe any 225 | patents or other property right claims or to contest validity of any 226 | such claims; this section has the sole purpose of protecting the 227 | integrity of the free software distribution system, which is 228 | implemented by public license practices. Many people have made 229 | generous contributions to the wide range of software distributed 230 | through that system in reliance on consistent application of that 231 | system; it is up to the author/donor to decide if he or she is willing 232 | to distribute software through any other system and a licensee cannot 233 | impose that choice. 234 | 235 | This section is intended to make thoroughly clear what is believed to 236 | be a consequence of the rest of this License. 237 | 238 | 8. If the distribution and/or use of the Program is restricted in 239 | certain countries either by patents or by copyrighted interfaces, the 240 | original copyright holder who places the Program under this License 241 | may add an explicit geographical distribution limitation excluding 242 | those countries, so that distribution is permitted only in or among 243 | countries not thus excluded. In such case, this License incorporates 244 | the limitation as if written in the body of this License. 245 | 246 | 9. The Free Software Foundation may publish revised and/or new versions 247 | of the General Public License from time to time. Such new versions will 248 | be similar in spirit to the present version, but may differ in detail to 249 | address new problems or concerns. 250 | 251 | Each version is given a distinguishing version number. If the Program 252 | specifies a version number of this License which applies to it and "any 253 | later version", you have the option of following the terms and conditions 254 | either of that version or of any later version published by the Free 255 | Software Foundation. If the Program does not specify a version number of 256 | this License, you may choose any version ever published by the Free Software 257 | Foundation. 258 | 259 | 10. If you wish to incorporate parts of the Program into other free 260 | programs whose distribution conditions are different, write to the author 261 | to ask for permission. For software which is copyrighted by the Free 262 | Software Foundation, write to the Free Software Foundation; we sometimes 263 | make exceptions for this. Our decision will be guided by the two goals 264 | of preserving the free status of all derivatives of our free software and 265 | of promoting the sharing and reuse of software generally. 266 | 267 | NO WARRANTY 268 | 269 | 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY 270 | FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN 271 | OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES 272 | PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED 273 | OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 274 | MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS 275 | TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE 276 | PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, 277 | REPAIR OR CORRECTION. 278 | 279 | 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 280 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR 281 | REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, 282 | INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING 283 | OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED 284 | TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY 285 | YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER 286 | PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE 287 | POSSIBILITY OF SUCH DAMAGES. 288 | 289 | END OF TERMS AND CONDITIONS 290 | 291 | How to Apply These Terms to Your New Programs 292 | 293 | If you develop a new program, and you want it to be of the greatest 294 | possible use to the public, the best way to achieve this is to make it 295 | free software which everyone can redistribute and change under these terms. 296 | 297 | To do so, attach the following notices to the program. It is safest 298 | to attach them to the start of each source file to most effectively 299 | convey the exclusion of warranty; and each file should have at least 300 | the "copyright" line and a pointer to where the full notice is found. 301 | 302 | 303 | Copyright (C) 304 | 305 | This program is free software; you can redistribute it and/or modify 306 | it under the terms of the GNU General Public License as published by 307 | the Free Software Foundation; either version 2 of the License, or 308 | (at your option) any later version. 309 | 310 | This program is distributed in the hope that it will be useful, 311 | but WITHOUT ANY WARRANTY; without even the implied warranty of 312 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 313 | GNU General Public License for more details. 314 | 315 | You should have received a copy of the GNU General Public License along 316 | with this program; if not, write to the Free Software Foundation, Inc., 317 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 318 | 319 | Also add information on how to contact you by electronic and paper mail. 320 | 321 | If the program is interactive, make it output a short notice like this 322 | when it starts in an interactive mode: 323 | 324 | Gnomovision version 69, Copyright (C) year name of author 325 | Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 326 | This is free software, and you are welcome to redistribute it 327 | under certain conditions; type `show c' for details. 328 | 329 | The hypothetical commands `show w' and `show c' should show the appropriate 330 | parts of the General Public License. Of course, the commands you use may 331 | be called something other than `show w' and `show c'; they could even be 332 | mouse-clicks or menu items--whatever suits your program. 333 | 334 | You should also get your employer (if you work as a programmer) or your 335 | school, if any, to sign a "copyright disclaimer" for the program, if 336 | necessary. Here is a sample; alter the names: 337 | 338 | Yoyodyne, Inc., hereby disclaims all copyright interest in the program 339 | `Gnomovision' (which makes passes at compilers) written by James Hacker. 340 | 341 | , 1 April 1989 342 | Ty Coon, President of Vice 343 | 344 | This General Public License does not permit incorporating your program into 345 | proprietary programs. If your program is a subroutine library, you may 346 | consider it more useful to permit linking proprietary applications with the 347 | library. If this is what you want to do, use the GNU Lesser General 348 | Public License instead of this License. -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ### iOSOpenDev—iOS Open Development 2 | Copyright (c) 2012-2013 Spencer W.S. James (Kokoabim). 3 | 4 | * Follow [@kokoabim](https://twitter.com/kokoabim) 5 | * Download [http://iOSOpenDev.com](http://iOSOpenDev.com) 6 | * Wiki [https://github.com/kokoabim/iOSOpenDev/wiki](https://github.com/kokoabim/iOSOpenDev/wiki/_pages) 7 | * IRC channel #iOSOpenDev on irc.saurik.com 8 | -------------------------------------------------------------------------------- /iOSOpenDev.pmdoc/01iod-contents.xml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /iOSOpenDev.pmdoc/01iod.xml: -------------------------------------------------------------------------------- 1 | com.iosopendev.iosopendev162.iod-setup.pkg1.0/Users/spencer/Projects/iOSOpenDev/package/scripts/iod-setup/opt/iOSOpenDevSetup/binscripts.preinstall.isRelativeTypeinstallTo.pathparentinstallToscripts.postinstall.isRelativeTypescripts/iod-setup_preinstallscripts/iod-setup_postinstall01iod-contents.xml/CVS$/\.svn$/\.cvsignore$/\.cvspass$/\.DS_Store$ -------------------------------------------------------------------------------- /iOSOpenDev.pmdoc/02iod-contents.xml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /iOSOpenDev.pmdoc/02iod.xml: -------------------------------------------------------------------------------- 1 | com.iosopendev.iosopendev162.iod-uninstall.pkg1.0/Users/spencer/Projects/iOSOpenDev/package/scripts/iod-uninstall/opt/iOSOpenDevUninstall/bininstallToinstallTo.pathparent/Users/spencer/Projects/iOSOpenDev/package/scripts/iod-uninstall_preinstall/Users/spencer/Projects/iOSOpenDev/package/scripts/iod-uninstall_postinstall02iod-contents.xml/CVS$/\.svn$/\.cvsignore$/\.cvspass$/\.DS_Store$ -------------------------------------------------------------------------------- /iOSOpenDev.pmdoc/index.xml: -------------------------------------------------------------------------------- 1 | iOSOpenDev (1.6-2)/Users/spencer/Projects/iOSOpenDev/packages/iOSOpenDev_1.6-2.pkgcom.iosopendev\ 14 | 15 | \fs20 \ 16 | GNU GENERAL PUBLIC LICENSE\ 17 | Version 2, June 1991\ 18 | \ 19 | Copyright (C) 1989, 1991 Free Software Foundation, Inc.,\ 20 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA\ 21 | Everyone is permitted to copy and distribute verbatim copies\ 22 | of this license document, but changing it is not allowed.\ 23 | \ 24 | Preamble\ 25 | \ 26 | The licenses for most software are designed to take away your\ 27 | freedom to share and change it. By contrast, the GNU General Public\ 28 | License is intended to guarantee your freedom to share and change free\ 29 | software--to make sure the software is free for all its users. This\ 30 | General Public License applies to most of the Free Software\ 31 | Foundation's software and to any other program whose authors commit to\ 32 | using it. (Some other Free Software Foundation software is covered by\ 33 | the GNU Lesser General Public License instead.) You can apply it to\ 34 | your programs, too.\ 35 | \ 36 | When we speak of free software, we are referring to freedom, not\ 37 | price. Our General Public Licenses are designed to make sure that you\ 38 | have the freedom to distribute copies of free software (and charge for\ 39 | this service if you wish), that you receive source code or can get it\ 40 | if you want it, that you can change the software or use pieces of it\ 41 | in new free programs; and that you know you can do these things.\ 42 | \ 43 | To protect your rights, we need to make restrictions that forbid\ 44 | anyone to deny you these rights or to ask you to surrender the rights.\ 45 | These restrictions translate to certain responsibilities for you if you\ 46 | distribute copies of the software, or if you modify it.\ 47 | \ 48 | For example, if you distribute copies of such a program, whether\ 49 | gratis or for a fee, you must give the recipients all the rights that\ 50 | you have. You must make sure that they, too, receive or can get the\ 51 | source code. And you must show them these terms so they know their\ 52 | rights.\ 53 | \ 54 | We protect your rights with two steps: (1) copyright the software, and\ 55 | (2) offer you this license which gives you legal permission to copy,\ 56 | distribute and/or modify the software.\ 57 | \ 58 | Also, for each author's protection and ours, we want to make certain\ 59 | that everyone understands that there is no warranty for this free\ 60 | software. If the software is modified by someone else and passed on, we\ 61 | want its recipients to know that what they have is not the original, so\ 62 | that any problems introduced by others will not reflect on the original\ 63 | authors' reputations.\ 64 | \ 65 | Finally, any free program is threatened constantly by software\ 66 | patents. We wish to avoid the danger that redistributors of a free\ 67 | program will individually obtain patent licenses, in effect making the\ 68 | program proprietary. To prevent this, we have made it clear that any\ 69 | patent must be licensed for everyone's free use or not licensed at all.\ 70 | \ 71 | The precise terms and conditions for copying, distribution and\ 72 | modification follow.\ 73 | \ 74 | GNU GENERAL PUBLIC LICENSE\ 75 | TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION\ 76 | \ 77 | 0. This License applies to any program or other work which contains\ 78 | a notice placed by the copyright holder saying it may be distributed\ 79 | under the terms of this General Public License. The "Program", below,\ 80 | refers to any such program or work, and a "work based on the Program"\ 81 | means either the Program or any derivative work under copyright law:\ 82 | that is to say, a work containing the Program or a portion of it,\ 83 | either verbatim or with modifications and/or translated into another\ 84 | language. (Hereinafter, translation is included without limitation in\ 85 | the term "modification".) Each licensee is addressed as "you".\ 86 | \ 87 | Activities other than copying, distribution and modification are not\ 88 | covered by this License; they are outside its scope. The act of\ 89 | running the Program is not restricted, and the output from the Program\ 90 | is covered only if its contents constitute a work based on the\ 91 | Program (independent of having been made by running the Program).\ 92 | Whether that is true depends on what the Program does.\ 93 | \ 94 | 1. You may copy and distribute verbatim copies of the Program's\ 95 | source code as you receive it, in any medium, provided that you\ 96 | conspicuously and appropriately publish on each copy an appropriate\ 97 | copyright notice and disclaimer of warranty; keep intact all the\ 98 | notices that refer to this License and to the absence of any warranty;\ 99 | and give any other recipients of the Program a copy of this License\ 100 | along with the Program.\ 101 | \ 102 | You may charge a fee for the physical act of transferring a copy, and\ 103 | you may at your option offer warranty protection in exchange for a fee.\ 104 | \ 105 | 2. You may modify your copy or copies of the Program or any portion\ 106 | of it, thus forming a work based on the Program, and copy and\ 107 | distribute such modifications or work under the terms of Section 1\ 108 | above, provided that you also meet all of these conditions:\ 109 | \ 110 | a) You must cause the modified files to carry prominent notices\ 111 | stating that you changed the files and the date of any change.\ 112 | \ 113 | b) You must cause any work that you distribute or publish, that in\ 114 | whole or in part contains or is derived from the Program or any\ 115 | part thereof, to be licensed as a whole at no charge to all third\ 116 | parties under the terms of this License.\ 117 | \ 118 | c) If the modified program normally reads commands interactively\ 119 | when run, you must cause it, when started running for such\ 120 | interactive use in the most ordinary way, to print or display an\ 121 | announcement including an appropriate copyright notice and a\ 122 | notice that there is no warranty (or else, saying that you provide\ 123 | a warranty) and that users may redistribute the program under\ 124 | these conditions, and telling the user how to view a copy of this\ 125 | License. (Exception: if the Program itself is interactive but\ 126 | does not normally print such an announcement, your work based on\ 127 | the Program is not required to print an announcement.)\ 128 | \ 129 | These requirements apply to the modified work as a whole. If\ 130 | identifiable sections of that work are not derived from the Program,\ 131 | and can be reasonably considered independent and separate works in\ 132 | themselves, then this License, and its terms, do not apply to those\ 133 | sections when you distribute them as separate works. But when you\ 134 | distribute the same sections as part of a whole which is a work based\ 135 | on the Program, the distribution of the whole must be on the terms of\ 136 | this License, whose permissions for other licensees extend to the\ 137 | entire whole, and thus to each and every part regardless of who wrote it.\ 138 | \ 139 | Thus, it is not the intent of this section to claim rights or contest\ 140 | your rights to work written entirely by you; rather, the intent is to\ 141 | exercise the right to control the distribution of derivative or\ 142 | collective works based on the Program.\ 143 | \ 144 | In addition, mere aggregation of another work not based on the Program\ 145 | with the Program (or with a work based on the Program) on a volume of\ 146 | a storage or distribution medium does not bring the other work under\ 147 | the scope of this License.\ 148 | \ 149 | 3. You may copy and distribute the Program (or a work based on it,\ 150 | under Section 2) in object code or executable form under the terms of\ 151 | Sections 1 and 2 above provided that you also do one of the following:\ 152 | \ 153 | a) Accompany it with the complete corresponding machine-readable\ 154 | source code, which must be distributed under the terms of Sections\ 155 | 1 and 2 above on a medium customarily used for software interchange; or,\ 156 | \ 157 | b) Accompany it with a written offer, valid for at least three\ 158 | years, to give any third party, for a charge no more than your\ 159 | cost of physically performing source distribution, a complete\ 160 | machine-readable copy of the corresponding source code, to be\ 161 | distributed under the terms of Sections 1 and 2 above on a medium\ 162 | customarily used for software interchange; or,\ 163 | \ 164 | c) Accompany it with the information you received as to the offer\ 165 | to distribute corresponding source code. (This alternative is\ 166 | allowed only for noncommercial distribution and only if you\ 167 | received the program in object code or executable form with such\ 168 | an offer, in accord with Subsection b above.)\ 169 | \ 170 | The source code for a work means the preferred form of the work for\ 171 | making modifications to it. For an executable work, complete source\ 172 | code means all the source code for all modules it contains, plus any\ 173 | associated interface definition files, plus the scripts used to\ 174 | control compilation and installation of the executable. However, as a\ 175 | special exception, the source code distributed need not include\ 176 | anything that is normally distributed (in either source or binary\ 177 | form) with the major components (compiler, kernel, and so on) of the\ 178 | operating system on which the executable runs, unless that component\ 179 | itself accompanies the executable.\ 180 | \ 181 | If distribution of executable or object code is made by offering\ 182 | access to copy from a designated place, then offering equivalent\ 183 | access to copy the source code from the same place counts as\ 184 | distribution of the source code, even though third parties are not\ 185 | compelled to copy the source along with the object code.\ 186 | \ 187 | 4. You may not copy, modify, sublicense, or distribute the Program\ 188 | except as expressly provided under this License. Any attempt\ 189 | otherwise to copy, modify, sublicense or distribute the Program is\ 190 | void, and will automatically terminate your rights under this License.\ 191 | However, parties who have received copies, or rights, from you under\ 192 | this License will not have their licenses terminated so long as such\ 193 | parties remain in full compliance.\ 194 | \ 195 | 5. You are not required to accept this License, since you have not\ 196 | signed it. However, nothing else grants you permission to modify or\ 197 | distribute the Program or its derivative works. These actions are\ 198 | prohibited by law if you do not accept this License. Therefore, by\ 199 | modifying or distributing the Program (or any work based on the\ 200 | Program), you indicate your acceptance of this License to do so, and\ 201 | all its terms and conditions for copying, distributing or modifying\ 202 | the Program or works based on it.\ 203 | \ 204 | 6. Each time you redistribute the Program (or any work based on the\ 205 | Program), the recipient automatically receives a license from the\ 206 | original licensor to copy, distribute or modify the Program subject to\ 207 | these terms and conditions. You may not impose any further\ 208 | restrictions on the recipients' exercise of the rights granted herein.\ 209 | You are not responsible for enforcing compliance by third parties to\ 210 | this License.\ 211 | \ 212 | 7. If, as a consequence of a court judgment or allegation of patent\ 213 | infringement or for any other reason (not limited to patent issues),\ 214 | conditions are imposed on you (whether by court order, agreement or\ 215 | otherwise) that contradict the conditions of this License, they do not\ 216 | excuse you from the conditions of this License. If you cannot\ 217 | distribute so as to satisfy simultaneously your obligations under this\ 218 | License and any other pertinent obligations, then as a consequence you\ 219 | may not distribute the Program at all. For example, if a patent\ 220 | license would not permit royalty-free redistribution of the Program by\ 221 | all those who receive copies directly or indirectly through you, then\ 222 | the only way you could satisfy both it and this License would be to\ 223 | refrain entirely from distribution of the Program.\ 224 | \ 225 | If any portion of this section is held invalid or unenforceable under\ 226 | any particular circumstance, the balance of the section is intended to\ 227 | apply and the section as a whole is intended to apply in other\ 228 | circumstances.\ 229 | \ 230 | It is not the purpose of this section to induce you to infringe any\ 231 | patents or other property right claims or to contest validity of any\ 232 | such claims; this section has the sole purpose of protecting the\ 233 | integrity of the free software distribution system, which is\ 234 | implemented by public license practices. Many people have made\ 235 | generous contributions to the wide range of software distributed\ 236 | through that system in reliance on consistent application of that\ 237 | system; it is up to the author/donor to decide if he or she is willing\ 238 | to distribute software through any other system and a licensee cannot\ 239 | impose that choice.\ 240 | \ 241 | This section is intended to make thoroughly clear what is believed to\ 242 | be a consequence of the rest of this License.\ 243 | \ 244 | 8. If the distribution and/or use of the Program is restricted in\ 245 | certain countries either by patents or by copyrighted interfaces, the\ 246 | original copyright holder who places the Program under this License\ 247 | may add an explicit geographical distribution limitation excluding\ 248 | those countries, so that distribution is permitted only in or among\ 249 | countries not thus excluded. In such case, this License incorporates\ 250 | the limitation as if written in the body of this License.\ 251 | \ 252 | 9. The Free Software Foundation may publish revised and/or new versions\ 253 | of the General Public License from time to time. Such new versions will\ 254 | be similar in spirit to the present version, but may differ in detail to\ 255 | address new problems or concerns.\ 256 | \ 257 | Each version is given a distinguishing version number. If the Program\ 258 | specifies a version number of this License which applies to it and "any\ 259 | later version", you have the option of following the terms and conditions\ 260 | either of that version or of any later version published by the Free\ 261 | Software Foundation. If the Program does not specify a version number of\ 262 | this License, you may choose any version ever published by the Free Software\ 263 | Foundation.\ 264 | \ 265 | 10. If you wish to incorporate parts of the Program into other free\ 266 | programs whose distribution conditions are different, write to the author\ 267 | to ask for permission. For software which is copyrighted by the Free\ 268 | Software Foundation, write to the Free Software Foundation; we sometimes\ 269 | make exceptions for this. Our decision will be guided by the two goals\ 270 | of preserving the free status of all derivatives of our free software and\ 271 | of promoting the sharing and reuse of software generally.\ 272 | \ 273 | NO WARRANTY\ 274 | \ 275 | 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY\ 276 | FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN\ 277 | OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES\ 278 | PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED\ 279 | OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\ 280 | MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS\ 281 | TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE\ 282 | PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,\ 283 | REPAIR OR CORRECTION.\ 284 | \ 285 | 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING\ 286 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR\ 287 | REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,\ 288 | INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING\ 289 | OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED\ 290 | TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY\ 291 | YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER\ 292 | PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE\ 293 | POSSIBILITY OF SUCH DAMAGES.\ 294 | \ 295 | END OF TERMS AND CONDITIONS\ 296 | \ 297 | How to Apply These Terms to Your New Programs\ 298 | \ 299 | If you develop a new program, and you want it to be of the greatest\ 300 | possible use to the public, the best way to achieve this is to make it\ 301 | free software which everyone can redistribute and change under these terms.\ 302 | \ 303 | To do so, attach the following notices to the program. It is safest\ 304 | to attach them to the start of each source file to most effectively\ 305 | convey the exclusion of warranty; and each file should have at least\ 306 | the "copyright" line and a pointer to where the full notice is found.\ 307 | \ 308 | \ 309 | Copyright (C) \ 310 | \ 311 | This program is free software; you can redistribute it and/or modify\ 312 | it under the terms of the GNU General Public License as published by\ 313 | the Free Software Foundation; either version 2 of the License, or\ 314 | (at your option) any later version.\ 315 | \ 316 | This program is distributed in the hope that it will be useful,\ 317 | but WITHOUT ANY WARRANTY; without even the implied warranty of\ 318 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\ 319 | GNU General Public License for more details.\ 320 | \ 321 | You should have received a copy of the GNU General Public License along\ 322 | with this program; if not, write to the Free Software Foundation, Inc.,\ 323 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.\ 324 | \ 325 | Also add information on how to contact you by electronic and paper mail.\ 326 | \ 327 | If the program is interactive, make it output a short notice like this\ 328 | when it starts in an interactive mode:\ 329 | \ 330 | Gnomovision version 69, Copyright (C) year name of author\ 331 | Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.\ 332 | This is free software, and you are welcome to redistribute it\ 333 | under certain conditions; type `show c' for details.\ 334 | \ 335 | The hypothetical commands `show w' and `show c' should show the appropriate\ 336 | parts of the General Public License. Of course, the commands you use may\ 337 | be called something other than `show w' and `show c'; they could even be\ 338 | mouse-clicks or menu items--whatever suits your program.\ 339 | \ 340 | You should also get your employer (if you work as a programmer) or your\ 341 | school, if any, to sign a "copyright disclaimer" for the program, if\ 342 | necessary. Here is a sample; alter the names:\ 343 | \ 344 | Yoyodyne, Inc., hereby disclaims all copyright interest in the program\ 345 | `Gnomovision' (which makes passes at compilers) written by James Hacker.\ 346 | \ 347 | , 1 April 1989\ 348 | Ty Coon, President of Vice\ 349 | \ 350 | This General Public License does not permit incorporating your program into\ 351 | proprietary programs. If your program is a subroutine library, you may\ 352 | consider it more useful to permit linking proprietary applications with the\ 353 | library. If this is what you want to do, use the GNU Lesser General\ 354 | Public License instead of this License.}]]> New > New Project... > iOS > iOSOpenDev.\ 383 | \ 384 | \'95 The `iosod` command-line tool was placed in /opt/iOSOpenDev/bin. This is used by Xcode during Build Phases of projects created from iOSOpenDev templates. It also provides other various functions. To see all of its usages: Open Terminal and type `iosod --help`.\ 385 | \ 386 | \'95 The `iod-setup` command-line tool was placed in /opt/iOSOpenDev/bin. It provides ability to set up different Xcode and iOS SDK versions. To see all of its usages: Open Terminal and type `iod-setup`.\ 387 | \ 388 | \'95 The `iod-uninstall` command-line tool was placed in /opt/iOSOpenDev/bin. It provides ability to uninstall iOSOpenDev. To see all of its usages: Open Terminal and type `iod-uninstall`.\ 389 | }]]>01iod.xml02iod.xmlproperties.titleproperties.customizeOptiondescriptionproperties.anywhereDomainproperties.systemDomain -------------------------------------------------------------------------------- /scripts/iod-setup: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # ----------------------------------------------------------------------- 4 | # iOSOpenDev -- iOS Open Development (http://www.iOSOpenDev.com) 5 | # Copyright (C) 2012-2013 Spencer W.S. James (Kokoabim) 6 | # ----------------------------------------------------------------------- 7 | # This program is free software; you can redistribute it and/or modify 8 | # it under the terms of the GNU General Public License as published by 9 | # the Free Software Foundation; either version 2 of the License, or 10 | # (at your option) any later version. 11 | # This program is distributed in the hope that it will be useful, 12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | # GNU General Public License for more details. 15 | # You should have received a copy of the GNU General Public License along 16 | # with this program; if not, write to the Free Software Foundation, Inc., 17 | # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 18 | # ----------------------------------------------------------------------- 19 | # iOSOpenDev is an independent project and has not been authorized, sponsored, or otherwise approved by Apple Inc. 20 | # IOS is a registered trademark of Cisco and is used under license by Apple Inc. 21 | # Xcode is a registered trademark of Apple Inc. 22 | # ----------------------------------------------------------------------- 23 | 24 | export setCmd="set -eo pipefail" 25 | $setCmd 26 | 27 | # path # 28 | export PATH=/opt/iOSOpenDev/bin:/usr/local/bin:/usr/bin:/usr/sbin:/bin:/sbin:$PATH 29 | 30 | # script # 31 | 32 | export scriptName="${0##*/}" 33 | export scriptVer="1.3.1" 34 | 35 | export iOSOpenDevPath="/opt/iOSOpenDev" 36 | export backupFileExt=".iOSOpenDev" 37 | 38 | export userName="${SUDO_USER-$USER}" 39 | export userGroup=`id -g $userName` 40 | export userHome=`eval echo ~$userName` 41 | export bashProfileFiles=("$userHome/.bash_profile" "$userHome/.bashrc" "$userHome/.zshrc" "$userHome/.bash_login" "$userHome/.profile") 42 | 43 | export tempDirsFile="`mktemp -d -t $scriptName`/tempdirs" 44 | touch "$tempDirsFile" 45 | 46 | unset LANG 47 | 48 | # panic and cleanup # 49 | 50 | function cleanup() 51 | { 52 | local exitCode=$? 53 | set +e 54 | trap - $signals 55 | removeTempData 56 | exit $exitCode 57 | } 58 | function panic() 59 | { 60 | local exitCode=$1 61 | set +e 62 | shift 63 | [[ "$@" == "" ]] || echo "$@" >&2 64 | exit $exitCode 65 | } 66 | export signals="0 1 2 3 15" 67 | trap cleanup $signals 68 | 69 | function removeTempData() 70 | { 71 | local tempDirs 72 | if [[ -f "$tempDirsFile" ]]; then 73 | tempDirs=(`cat "$tempDirsFile"`) 74 | for td in "${tempDirs[@]}"; do 75 | rm -rf "$td" || true 76 | done 77 | rm -rf "`dirname $tempDirsFile`" || true 78 | fi 79 | } 80 | function getTempDir() 81 | { 82 | $setCmd 83 | local tempDir 84 | tempDir=`mktemp -d -t $scriptName` || \ 85 | panic $? "Failed to create temporary directory" 86 | echo "$tempDir" >> "$tempDirsFile" || \ 87 | panic $? "Failed to echo into $tempDirsFile" 88 | echo "$tempDir" 89 | } 90 | 91 | # common functions # 92 | 93 | function downloadFile() # args: sourceUrl, targetPath 94 | { 95 | local sourceUrl="$1" 96 | local targetPath="$2" 97 | local curlPath 98 | 99 | mkdir -p "${targetPath%/*}" || \ 100 | panic $? "Failed to make directory: ${targetPath%/*}" 101 | 102 | curlPath=`which curl` || \ 103 | panic $? "Failed to get curl path" 104 | 105 | "$curlPath" --silent --insecure --output "$targetPath" "$sourceUrl" || \ 106 | panic $? "Failed to download $sourceUrl to $targetPath" 107 | } 108 | 109 | function extractTar() # args: tarPath, outputPath 110 | { 111 | local tarPath="$1" 112 | local outputPath="$2" 113 | 114 | tar -C "$outputPath" -zxf "$tarPath" || \ 115 | panic $? "Failed to extract $tarPath to $outputPath" 116 | } 117 | 118 | function downloadGithubTarball() # args: url, outputDir, title 119 | { 120 | $setcmd 121 | 122 | local url="$1" 123 | local outputDir="$2" 124 | local title="$3" 125 | local tempDirForTar 126 | local tempDirForFiles 127 | local untardDir 128 | local tarFile="file.tar.gz" 129 | 130 | echo "Downloading $title from Github..." 131 | 132 | tempDirForTar=`getTempDir` 133 | tempDirForFiles=`getTempDir` 134 | 135 | downloadFile "$url" "$tempDirForTar/$tarFile" 136 | 137 | extractTar "$tempDirForTar/$tarFile" "$tempDirForFiles" 138 | 139 | untardDir=`find "$tempDirForFiles/"* -type d -depth 0` || \ 140 | panic $? "Failed to get untar'ed directory name of $tempDirForTar/$tarFile" 141 | 142 | mkdir -p "$outputDir" || \ 143 | panic $? "Failed to make directory: $outputDir" 144 | 145 | cp -fR "$untardDir/"* "$outputDir/" 146 | } 147 | 148 | function changeMode() 149 | { 150 | local mode="$1" 151 | local target="$2" 152 | local recursive="$3" 153 | local options 154 | 155 | [[ $recursive != "true" ]] || \ 156 | options="-R" 157 | 158 | if [[ -e "$target" ]]; then 159 | chmod $options "$mode" "$target" || \ 160 | panic $? "Failed to change mode to $mode on $target" 161 | fi 162 | } 163 | 164 | # base argument functions # 165 | 166 | function determineUserBashProfileFile() 167 | { 168 | $setCmd 169 | 170 | local f 171 | local filePath 172 | 173 | for f in "${bashProfileFiles[@]}"; do 174 | if [[ -f "$f" ]]; then 175 | filePath="$f" 176 | echo "" >> "$f" || \ 177 | panic $? "Failed to echo into $f" 178 | break 179 | fi 180 | done 181 | 182 | if [[ $filePath == "" ]]; then 183 | filePath="$bashProfileFiles" 184 | 185 | touch "$filePath" || \ 186 | panic $? "Failed to touch $filePath" 187 | 188 | chown "$userName:$userGroup" "$filePath" || \ 189 | panic $? "Failed to change owner-group of $filePath" 190 | 191 | changeMode 0600 "$filePath" 192 | fi 193 | 194 | # return # 195 | echo "$filePath" 196 | } 197 | 198 | function addToFileIfMissing() # args: filePath, pattern, value 199 | { 200 | local filePath="$1" 201 | local pattern="$2" 202 | local value="$3" 203 | local doesContain 204 | 205 | doesContain=`doesFileContain "$filePath" "$pattern"` 206 | 207 | [[ $doesContain == "true" ]] || \ 208 | echo "$value" >> "$filePath" || \ 209 | panic $? "Failed to echo into $filePath" 210 | } 211 | 212 | function doesFileContain() # args: filePath, pattern 213 | { 214 | $setCmd 215 | 216 | local filePath="$1" 217 | local pattern="$2" 218 | local perlValue 219 | local funcReturn 220 | 221 | perlValue=`perl -ne 'if (/'"$pattern"'/) { print "true"; exit; }' "$filePath"` || \ 222 | panic $? "Failed to perl" 223 | 224 | if [[ $perlValue == "true" ]]; then 225 | funcReturn="true" 226 | else 227 | funcReturn="false" 228 | fi 229 | 230 | # return # 231 | echo $funcReturn 232 | } 233 | 234 | # sdk argument functions # 235 | 236 | function getSdkProperty() 237 | { 238 | $setCmd 239 | 240 | local sdk="$1" 241 | local propertyName="$2" 242 | 243 | propertyValue=`xcodebuild -version -sdk $sdk $propertyName` || \ 244 | panic $? "Failed to get $sdk SDK property $propertyName" 245 | 246 | [[ $propertyValue != "" ]] || \ 247 | panic 1 "Value of $sdk SDK property $propertyName cannot be empty" 248 | 249 | # return # 250 | echo "$propertyValue" 251 | } 252 | 253 | function getPlatformName() 254 | { 255 | $setCmd 256 | 257 | local sdk="$1" 258 | local iosSdkPlatformPath 259 | local platformDir 260 | local platformName 261 | 262 | iosSdkPlatformPath=`getSdkProperty $sdk PlatformPath` 263 | platformDir="${iosSdkPlatformPath##*/}" 264 | platformName="${platformDir%.*}" 265 | 266 | # return # 267 | echo "$platformName" 268 | } 269 | 270 | function writeDefaults() 271 | { 272 | local plistPath="$1" 273 | shift 1 274 | 275 | defaults write "${plistPath%.*}" "$@" || \ 276 | panic $? "Failed to write defaults to $plistPath" 277 | } 278 | 279 | function copyFile() 280 | { 281 | cp -f "$1" "$2" || \ 282 | panic $? "Failed to copy file $1 to $2" 283 | } 284 | 285 | function requireBackup() 286 | { 287 | [[ ! -f "$1" || -f "${1}${backupFileExt}" ]] || \ 288 | copyFile "$1" "${1}${backupFileExt}" 289 | } 290 | 291 | function requireFile() 292 | { 293 | local filePath="$1" 294 | local touchFileIfNotFound="$2" 295 | 296 | if [[ ! -f "$filePath" ]]; then 297 | if [[ $touchFileIfNotFound == "true" ]]; then 298 | touch "$filePath" || \ 299 | panic $? "Failed to touch $filePath" 300 | else 301 | panic 1 "File not found: $filePath" 302 | fi 303 | fi 304 | } 305 | 306 | function modifySdkSettings() 307 | { 308 | local sdk="$1" 309 | local iosSdkPath 310 | local sdkSettingsPList 311 | 312 | iosSdkPath=`getSdkProperty $sdk Path` 313 | 314 | # backup SDKSettings.plist 315 | sdkSettingsPList="$iosSdkPath/SDKSettings.plist" 316 | requireFile "$sdkSettingsPList" false 317 | requireBackup "$sdkSettingsPList" 318 | 319 | # change SDKSettings.plist 320 | writeDefaults "$sdkSettingsPList" DefaultProperties "-dict-add" CODE_SIGNING_REQUIRED "-string" NO 321 | writeDefaults "$sdkSettingsPList" DefaultProperties "-dict-add" ENTITLEMENTS_REQUIRED "-string" NO 322 | writeDefaults "$sdkSettingsPList" DefaultProperties "-dict-add" AD_HOC_CODE_SIGNING_ALLOWED "-string" YES 323 | 324 | # fix mode 325 | changeMode 0644 "$sdkSettingsPList" 326 | } 327 | 328 | function addXcodeSpecs() 329 | { 330 | local sdk="$1" 331 | local platformName="$2" 332 | local iosSdkPlatformPath 333 | local xcspecFileNamePrefix 334 | 335 | iosSdkPlatformPath=`getSdkProperty $sdk PlatformPath` 336 | 337 | # get *.xcspec filename prefix 338 | xcspecFileNamePrefix="$platformName" 339 | [[ ! $xcspecFileNamePrefix =~ "Simulator" ]] || xcspecFileNamePrefix="iPhone Simulator " 340 | 341 | # backup *PackageTypes.xcspec 342 | iosPackagesTypesXCSpec="$iosSdkPlatformPath/Developer/Library/Xcode/Specifications/${xcspecFileNamePrefix}PackageTypes.xcspec" 343 | requireFile "$iosPackagesTypesXCSpec" false 344 | requireBackup "$iosPackagesTypesXCSpec" 345 | 346 | # modify *PackageTypes.xcspec 347 | addXcodeSpec "$iosPackagesTypesXCSpec" "com.apple.package-type.mach-o-executable" '{"ProductReference":{"IsLaunchable":"YES","FileType":"compiled.mach-o.executable","Name":"\$(EXECUTABLE_NAME)"},"DefaultBuildSettings":{"EXECUTABLE_NAME":"\$(EXECUTABLE_PREFIX)\$(PRODUCT_NAME)\$(EXECUTABLE_VARIANT_SUFFIX)\$(EXECUTABLE_SUFFIX)","EXECUTABLE_PATH":"\$(EXECUTABLE_NAME)","EXECUTABLE_SUFFIX":"","EXECUTABLE_PREFIX":""},"Type":"PackageType","Name":"Mach-O Executable","Identifier":"com.apple.package-type.mach-o-executable","Description":"Mach-O executable"}' 348 | addXcodeSpec "$iosPackagesTypesXCSpec" "com.apple.package-type.mach-o-dylib" '{"ProductReference":{"IsLaunchable":"NO","FileType":"compiled.mach-o.dylib","Name":"\$(EXECUTABLE_NAME)"},"DefaultBuildSettings":{"EXECUTABLE_NAME":"\$(EXECUTABLE_PREFIX)\$(PRODUCT_NAME)\$(EXECUTABLE_VARIANT_SUFFIX)\$(EXECUTABLE_SUFFIX)","EXECUTABLE_PATH":"\$(EXECUTABLE_NAME)","EXECUTABLE_SUFFIX":"","EXECUTABLE_PREFIX":""},"Type":"PackageType","Name":"Mach-O Dynamic Library","Identifier":"com.apple.package-type.mach-o-dylib","Description":"Mach-O dynamic library"}' 349 | 350 | # backup *ProductTypes.xcspec 351 | iosProductTypesXCSpec="$iosSdkPlatformPath/Developer/Library/Xcode/Specifications/${xcspecFileNamePrefix}ProductTypes.xcspec" 352 | requireFile "$iosProductTypesXCSpec" false 353 | requireBackup "$iosProductTypesXCSpec" 354 | 355 | # modify *ProductTypes.xcspec 356 | addXcodeSpec "$iosProductTypesXCSpec" "com.apple.product-type.tool" '{"IconNamePrefix":"TargetExecutable","PackageTypes":["com.apple.package-type.mach-o-executable"],"Name":"Command-line Tool","Type":"ProductType","DefaultTargetName":"Command-line Tool","DefaultBuildProperties":{"REZ_EXECUTABLE":"YES","LIBRARY_FLAG_NOSPACE":"YES","FULL_PRODUCT_NAME":"\$(EXECUTABLE_NAME)","INSTALL_PATH":"\/usr\/bin","CODE_SIGNING_ALLOWED":"YES","GCC_INLINES_ARE_PRIVATE_EXTERN":"YES","GCC_SYMBOLS_PRIVATE_EXTERN":"YES","GCC_DYNAMIC_NO_PIC":"NO","FRAMEWORK_FLAG_PREFIX":"-framework","ENTITLEMENTS_ALLOWED":"YES","STRIP_STYLE":"all","EXECUTABLE_PREFIX":"","MACH_O_TYPE":"mh_execute","EXECUTABLE_SUFFIX":"","LIBRARY_FLAG_PREFIX":"-l"},"Identifier":"com.apple.product-type.tool","Class":"PBXToolProductType","Description":"Standalone command-line tool"}' 357 | addXcodeSpec "$iosProductTypesXCSpec" "com.apple.product-type.library.dynamic" '{"IconNamePrefix":"TargetLibrary","PackageTypes":["com.apple.package-type.mach-o-dylib"],"Description":"Dynamic library","Type":"ProductType","DefaultBuildProperties":{"EXECUTABLE_SUFFIX":".\$(EXECUTABLE_EXTENSION)","PRIVATE_HEADERS_FOLDER_PATH":"\/usr\/include","REZ_EXECUTABLE":"YES","FULL_PRODUCT_NAME":"\$(EXECUTABLE_NAME)","LD_DYLIB_INSTALL_NAME":"\$(DYLIB_INSTALL_NAME_BASE:standardizepath)\/\$(EXECUTABLE_PATH)","DYLIB_COMPATIBILITY_VERSION":"1","INSTALL_PATH":"\/usr\/lib","FRAMEWORK_FLAG_PREFIX":"-framework","LIBRARY_FLAG_NOSPACE":"YES","GCC_INLINES_ARE_PRIVATE_EXTERN":"YES","CODE_SIGNING_ALLOWED":"YES","STRIP_STYLE":"debugging","EXECUTABLE_EXTENSION":"dylib","MACH_O_TYPE":"mh_dylib","DYLIB_CURRENT_VERSION":"1","PUBLIC_HEADERS_FOLDER_PATH":"\/usr\/include","DYLIB_INSTALL_NAME_BASE":"\$(INSTALL_PATH)","LIBRARY_FLAG_PREFIX":"-l"},"DefaultTargetName":"Dynamic Library","Class":"PBXDynamicLibraryProductType","Name":"Dynamic Library","Identifier":"com.apple.product-type.library.dynamic"}' 358 | } 359 | 360 | function addXcodeSpec() 361 | { 362 | local specFile="$1" 363 | local specId="$2" 364 | local specData="$3" 365 | local fileContainsSpecId 366 | local tempDir 367 | local tempFile 368 | local defaultsRead 369 | 370 | fileContainsSpecId=`doesFileContain "$specFile" "$specId"` 371 | 372 | if [[ $fileContainsSpecId == "false" ]]; then 373 | 374 | tempDir=`getTempDir` 375 | tempFile="$tempDir/`basename $specFile`.plist" 376 | 377 | plutil -convert json -o "$tempFile" "$specFile" || \ 378 | panic $? "Failed to convert XCSpec file $specFile to JSON to temporary file $tempFile" 379 | 380 | perl -i -pe 's/\]$/,'"$specData"'\]/' "$tempFile" || \ 381 | panic $? "Failed to add XCSpec to temporary file $tempFile" 382 | 383 | plutil -convert binary1 "$tempFile" || \ 384 | panic $? "Failed to convert temporary file $tempFile to binary" 385 | 386 | copyFile "$tempFile" "$specFile" 387 | fi 388 | } 389 | 390 | function readDefaultsValue() 391 | { 392 | $setCmd 393 | 394 | local plistPath="$1" 395 | local propertyName="$2" 396 | local value 397 | 398 | value=`defaults read "${plistPath%.*}" "$propertyName"` || \ 399 | panic $? "Failed to read defaults property $propertyName from $plistPath" 400 | 401 | # return # 402 | echo "$value" 403 | } 404 | 405 | function addSymlinksToPathAvailableDuringBuilds() 406 | { 407 | local sdk="$1" 408 | local iosSdkPlatformPath 409 | 410 | iosSdkPlatformPath=`getSdkProperty $sdk PlatformPath` 411 | 412 | # add symlinks to path that's available during an Xcode Build Phase Run Script 413 | createSymlink "$iOSOpenDevPath/bin/iosod" "$iosSdkPlatformPath/Developer/usr/bin/iosod" 414 | createSymlink "$iOSOpenDevPath/bin/ldid" "$iosSdkPlatformPath/Developer/usr/bin/ldid" 415 | } 416 | 417 | function createSymlink() 418 | { 419 | local sourcePath="$1" 420 | local linkPath="$2" 421 | 422 | rm -f "$linkPath" || \ 423 | panic $? "Failed to remove file: $linkPath" 424 | 425 | ln -fhs "$sourcePath" "$linkPath" || \ 426 | panic $? "Failed to create symbolic link $linkPath -> $sourcePath" 427 | } 428 | 429 | function createSdkPrivateHeaderSymlinks() 430 | { 431 | local sdk="$1" 432 | local iosSdkPath 433 | local privateFWsDir 434 | local privateFwBinaries 435 | local fullPath 436 | local shortPath 437 | local sourcePath 438 | local targetPath 439 | 440 | iosSdkPath=`getSdkProperty $sdk Path` 441 | 442 | [[ -d "$iosSdkPath" ]] || \ 443 | panic 1 "SDK directory not found: $iosSdkPath" 444 | 445 | privateFWsDir="$iosSdkPath/System/Library/PrivateFrameworks" 446 | 447 | [[ -d "$privateFWsDir" ]] || \ 448 | panic 1 "PrivateFramework directory not found: $privateFWsDir" 449 | 450 | privateFwBinaries=($(find "$privateFWsDir" -type f -perm +111 -ipath "*.framework/*")) 451 | 452 | for f in "${privateFwBinaries[@]}"; do 453 | fullPath=`dirname "$f"` 454 | shortPath="${fullPath/#$privateFWsDir}" 455 | 456 | sourcePath="${iOSOpenDevPath}/frameworks${shortPath}/Headers" 457 | targetPath="${fullPath}/Headers" 458 | 459 | if [[ -d "$sourcePath" ]] && [[ ! "$sourcePath" -ef "$targetPath" ]]; then 460 | if [[ -L "$targetPath" ]]; then 461 | echo "Symlink already exists: $targetPath" 462 | elif [[ -e "$targetPath" ]]; then 463 | echo "File or directory already exists: $targetPath" 464 | else 465 | createSymlink "$sourcePath" "$targetPath" 466 | fi 467 | fi 468 | done 469 | } 470 | 471 | # script functions # 472 | 473 | function requireOptionValue() 474 | { 475 | [[ "$2" != "" ]] || \ 476 | panic 1 "Missing value for $1 option" 477 | } 478 | 479 | function showUsage() 480 | { 481 | panic 1 \ 482 | "$scriptName (v${scriptVer}) -- iOSOpenDev Setup 483 | Usages: 484 | $scriptName base 485 | $scriptName sdk [-sdk ] [-d ] [-which] 486 | 487 | Arguments: 488 | base Set up iOSOpenDev base and Xcode templates. 489 | 490 | sdk Set up latest iOS SDK for \"open\" development. 491 | 492 | Options: 493 | -sdk SDK name and, optionally, version as one word to set 494 | up. If version is omitted, latest version of named SDK 495 | is used. If is entirely omitted, latest iOS SDK is 496 | used. 497 | 498 | -d Set environment variable DEVELOPER_DIR to to 499 | target specific Developer Tools. Use this option when 500 | multiple versions of Xcode are installed. 501 | 502 | -which Print which SDK and Developer Tools directory will be 503 | used by default if -sdk and -d are 504 | not used. 505 | " 506 | } 507 | 508 | # begin script ... # 509 | 510 | devToolsDir="`xcode-select --print-path`" || \ 511 | panic $? "Failed to get Xcode developer directory" 512 | 513 | if [[ ! -d "$DEVELOPER_DIR" ]] && [[ -d "$devToolsDir" ]]; then 514 | export DEVELOPER_DIR="$devToolsDir" 515 | fi 516 | 517 | case "$1" in 518 | 519 | base) 520 | 521 | # get base and templates # 522 | 523 | mkdir -p "$iOSOpenDevPath" || \ 524 | panic $? "Failed to make directory: $iOSOpenDevPath" 525 | 526 | downloadGithubTarball "https://codeload.github.com/kokoabim/iOSOpenDev/tar.gz/master" "$iOSOpenDevPath" "iOSOpenDev base" 527 | downloadGithubTarball "https://codeload.github.com/kokoabim/iOSOpenDev-Xcode-Templates/tar.gz/master" "$iOSOpenDevPath/templates" "Xcode templates" 528 | 529 | # create empty frameworks directory # 530 | 531 | mkdir -p "$iOSOpenDevPath/frameworks" || \ 532 | panic $? "Failed to make directory: $iOSOpenDevPath/frameworks" 533 | 534 | # symlink to templates # 535 | 536 | echo "Creating symlink to Xcode templates..." 537 | 538 | userDevDir="$userHome/Library/Developer" 539 | userTemplatesDir="$userDevDir/Xcode/Templates" 540 | 541 | if [[ ! -d "$userTemplatesDir" ]]; then 542 | mkdir -p "$userTemplatesDir" || \ 543 | panic $? "Failed to make directory: $userTemplatesDir" 544 | 545 | chown -R "$userName:$userGroup" "$userDevDir" || \ 546 | panic $? "Failed to change ownership-group of $userDevDir" 547 | fi 548 | 549 | ln -fhs "$iOSOpenDevPath/templates" "$userTemplatesDir/iOSOpenDev" 550 | 551 | # bash profile # 552 | 553 | echo "Modifying Bash personal initialization file..." 554 | 555 | userBashProfileFile=`determineUserBashProfileFile` 556 | 557 | addToFileIfMissing "$userBashProfileFile" "^(export)? *iOSOpenDevPath=.*" "export iOSOpenDevPath=$iOSOpenDevPath" 558 | addToFileIfMissing "$userBashProfileFile" "^(export)? *iOSOpenDevDevice=.*" "export iOSOpenDevDevice=" 559 | addToFileIfMissing "$userBashProfileFile" "^(export)? *PATH=.*(\\\$iOSOpenDevPath\\/bin|${iOSOpenDevPath//\//\\/}\\/bin).*" "export PATH=$iOSOpenDevPath/bin:\$PATH" 560 | ;; 561 | 562 | sdk) 563 | 564 | shift 1 565 | 566 | sdk="iphoneos" # default to latest iphoneos sdk 567 | printWhich="false" 568 | 569 | while [[ $1 != "" ]]; do 570 | case "$1" in 571 | -sdk) 572 | requireOptionValue "$1" "$2" 573 | sdk="$2" 574 | shift 2 575 | ;; 576 | -d) 577 | requireOptionValue "$1" "$2" 578 | export DEVELOPER_DIR="$2" 579 | 580 | [[ -d "$DEVELOPER_DIR" ]] || \ 581 | panic 1 "Directory not found: $DEVELOPER_DIR" 582 | 583 | shift 2 584 | ;; 585 | -which) 586 | printWhich="true" 587 | shift 1 588 | ;; 589 | *) panic 1 "Invalid option: $1" ;; 590 | esac 591 | done 592 | 593 | # get sdk platform-name and version 594 | 595 | platformName=`getPlatformName "$sdk"` 596 | sdkVersion=`getSdkProperty "$sdk" "SDKVersion"` 597 | 598 | [[ "$printWhich" == "false" ]] || \ 599 | panic 1 "SDK: ${platformName}${sdkVersion} 600 | Developer Tools: $DEVELOPER_DIR" 601 | 602 | echo "Setting up $platformName $sdkVersion SDK..." 603 | 604 | # modify SDK settings 605 | 606 | echo "Modifying SDK settings..." 607 | modifySdkSettings "$sdk" 608 | 609 | # symlink to dumped private frameworks header files 610 | 611 | echo "Symlinking to private frameworks header files..." 612 | createSdkPrivateHeaderSymlinks "$sdk" 613 | 614 | # add Xcode specifications 615 | 616 | echo "Adding specifications to platform..." 617 | addXcodeSpecs "$sdk" "$platformName" 618 | 619 | # create symlinks so be available in PATH during Xcode builds 620 | 621 | echo "Creating symlinks in platform bin..." 622 | addSymlinksToPathAvailableDuringBuilds "$sdk" 623 | 624 | ;; 625 | 626 | *) showUsage ;; 627 | esac 628 | 629 | # done # 630 | 631 | exit 0 632 | -------------------------------------------------------------------------------- /scripts/iod-setup_postinstall: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | export iOSOpenDevPath="/opt/iOSOpenDev" 6 | sourceDir="/opt/iOSOpenDevSetup" 7 | scriptPath="$sourceDir/bin/iod-setup" 8 | 9 | if [[ -f "$scriptPath" ]]; then 10 | echo "Running $scriptPath..." 11 | "$scriptPath" base 12 | "$scriptPath" sdk -sdk iphoneos 13 | "$scriptPath" sdk -sdk iphonesimulator 14 | 15 | echo "Copying $scriptPath to $iOSOpenDevPath/bin..." 16 | cp -f "$scriptPath" "$iOSOpenDevPath/bin" 17 | rm -rf "$sourceDir" 18 | 19 | exit 0 20 | else 21 | echo "$scriptPath not found!" 22 | 23 | rm -rf "$sourceDir" 24 | exit 1 25 | fi 26 | -------------------------------------------------------------------------------- /scripts/iod-setup_preinstall: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | setupPath="/opt/iOSOpenDevSetup" 6 | 7 | [[ -d "$setupPath/bin" ]] || \ 8 | mkdir -p "$setupPath/bin" -------------------------------------------------------------------------------- /scripts/iod-uninstall: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # ----------------------------------------------------------------------- 4 | # iOSOpenDev -- iOS Open Development (http://www.iOSOpenDev.com) 5 | # Copyright (C) 2012-2013 Spencer W.S. James (Kokoabim) 6 | # ----------------------------------------------------------------------- 7 | # This program is free software; you can redistribute it and/or modify 8 | # it under the terms of the GNU General Public License as published by 9 | # the Free Software Foundation; either version 2 of the License, or 10 | # (at your option) any later version. 11 | # This program is distributed in the hope that it will be useful, 12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | # GNU General Public License for more details. 15 | # You should have received a copy of the GNU General Public License along 16 | # with this program; if not, write to the Free Software Foundation, Inc., 17 | # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 18 | # ----------------------------------------------------------------------- 19 | # iOSOpenDev is an independent project and has not been authorized, sponsored, or otherwise approved by Apple Inc. 20 | # IOS is a registered trademark of Cisco and is used under license by Apple Inc. 21 | # Xcode is a registered trademark of Apple Inc. 22 | # ----------------------------------------------------------------------- 23 | 24 | export setCmd="set -eo pipefail" 25 | $setCmd 26 | 27 | # path # 28 | export PATH=/opt/iOSOpenDev/bin:/usr/local/bin:/usr/bin:/usr/sbin:/bin:/sbin:$PATH 29 | 30 | # script # 31 | 32 | export scriptName="${0##*/}" 33 | export scriptVer="1.3" 34 | 35 | export iOSOpenDevPath="/opt/iOSOpenDev" 36 | export backupFileExt=".iOSOpenDev" 37 | 38 | export userName="${SUDO_USER-$USER}" 39 | export userGroup=`id -g $userName` 40 | export userHome=`eval echo ~$userName` 41 | export bashProfileFiles=("$userHome/.bash_profile" "$userHome/.bashrc" "$userHome/.zshrc" "$userHome/.bash_login" "$userHome/.profile") 42 | 43 | export tempDirsFile="`mktemp -d -t $scriptName`/tempdirs" 44 | touch "$tempDirsFile" 45 | 46 | unset LANG 47 | 48 | # panic and cleanup # 49 | 50 | function cleanup() 51 | { 52 | local exitCode=$? 53 | set +e 54 | trap - $signals 55 | removeTempData 56 | exit $exitCode 57 | } 58 | function panic() 59 | { 60 | local exitCode=$1 61 | set +e 62 | shift 63 | [[ "$@" == "" ]] || echo "$@" >&2 64 | exit $exitCode 65 | } 66 | export signals="0 1 2 3 15" 67 | trap cleanup $signals 68 | 69 | function removeTempData() 70 | { 71 | local tempDirs 72 | if [[ -f "$tempDirsFile" ]]; then 73 | tempDirs=(`cat "$tempDirsFile"`) 74 | for td in "${tempDirs[@]}"; do 75 | rm -rf "$td" || true 76 | done 77 | rm -rf "`dirname $tempDirsFile`" || true 78 | fi 79 | } 80 | function getTempDir() 81 | { 82 | $setCmd 83 | local tempDir 84 | tempDir=`mktemp -d -t $scriptName` || \ 85 | panic $? "Failed to create temporary directory" 86 | echo "$tempDir" >> "$tempDirsFile" || \ 87 | panic $? "Failed to echo into $tempDirsFile" 88 | echo "$tempDir" 89 | } 90 | 91 | # common functions # 92 | 93 | function copyFile() 94 | { 95 | cp -f "$1" "$2" || \ 96 | panic $? "Failed to copy file $1 to $2" 97 | } 98 | 99 | # sdk argument functions # 100 | 101 | function getSdkProperty() 102 | { 103 | $setCmd 104 | 105 | local sdk="$1" 106 | local propertyName="$2" 107 | 108 | propertyValue=`xcodebuild -version -sdk $sdk $propertyName` || \ 109 | panic $? "Failed to get $sdk SDK property $propertyName" 110 | 111 | [[ $propertyValue != "" ]] || \ 112 | panic 1 "Value of $sdk SDK property $propertyName cannot be empty" 113 | 114 | # return # 115 | echo "$propertyValue" 116 | } 117 | 118 | function getPlatformName() 119 | { 120 | $setCmd 121 | 122 | local sdk="$1" 123 | local iosSdkPlatformPath 124 | local platformDir 125 | local platformName 126 | 127 | iosSdkPlatformPath=`getSdkProperty $sdk PlatformPath` 128 | platformDir="${iosSdkPlatformPath##*/}" 129 | platformName="${platformDir%.*}" 130 | 131 | # return # 132 | echo "$platformName" 133 | } 134 | 135 | function restoreFile() 136 | { 137 | local filePath="$1" 138 | local backedUpFilePath="${filePath}${backupFileExt}" 139 | 140 | if [[ -f "$backedUpFilePath" ]]; then 141 | copyFile "$backedUpFilePath" "$filePath" 142 | rm -f "$backedUpFilePath" 143 | fi 144 | } 145 | 146 | function removeSdkPrivateHeaderSymlinks() 147 | { 148 | local sdk="$1" 149 | local iosSdkPath 150 | local privateFWsDir 151 | local privateFwBinaries 152 | local fullPath 153 | local shortPath 154 | local sourcePath 155 | local targetPath 156 | 157 | iosSdkPath=`getSdkProperty $sdk Path` 158 | 159 | [[ -d "$iosSdkPath" ]] || \ 160 | panic 1 "SDK directory not found: $iosSdkPath" 161 | 162 | privateFWsDir="$iosSdkPath/System/Library/PrivateFrameworks" 163 | 164 | [[ -d "$privateFWsDir" ]] || \ 165 | panic 1 "PrivateFramework directory not found: $privateFWsDir" 166 | 167 | privateFwBinaries=($(find "$privateFWsDir" -type f -perm +111 -ipath "*.framework/*")) 168 | 169 | for f in "${privateFwBinaries[@]}"; do 170 | fullPath=`dirname "$f"` 171 | targetPath="${fullPath}/Headers" 172 | 173 | if [[ -e "$targetPath" ]] && [[ ! -L "$targetPath" ]]; then 174 | echo "Skipping since not a symlink: $targetPath" 175 | elif [[ -L "$targetPath" ]]; then 176 | if [[ -f "$targetPath" ]]; then 177 | echo "Skipping since symlinked to file: $targetPath" 178 | elif [[ -d "$targetPath" ]] || [[ ! -e "$targetPath" ]]; then 179 | rm -f "$targetPath" || \ 180 | panic $? "Failed to remove symlink: $targetPath" 181 | else 182 | echo "Skipping since symlinked to unknown type: $targetPath" 183 | fi 184 | fi 185 | done 186 | } 187 | 188 | # script functions # 189 | 190 | function requireOptionValue() 191 | { 192 | [[ "$2" != "" ]] || \ 193 | panic 1 "Missing value for $1 option" 194 | } 195 | 196 | function showUsage() 197 | { 198 | panic 1 \ 199 | "$scriptName (v${scriptVer}) -- iOSOpenDev Uninstall 200 | Usages: 201 | $scriptName base 202 | $scriptName sdk [-sdk ] [-d ] [-which] 203 | 204 | Arguments: 205 | base Uninstall iOSOpenDev base, Xcode templates and private 206 | framework header files. 207 | 208 | sdk Undo modifications made to latest iOS SDK for \"open\" 209 | development. 210 | 211 | Options: 212 | -sdk SDK name and, optionally, version as one word to set 213 | up. If version is omitted, latest version of named SDK 214 | is used. If is entirely omitted, latest iOS SDK is 215 | used. 216 | 217 | -d Set environment variable DEVELOPER_DIR to to 218 | target specific Developer Tools. Use this option when 219 | multiple versions of Xcode are installed. 220 | 221 | -which Print which SDK and Developer Tools directory will be 222 | used by default if -sdk and -d are 223 | not used. 224 | " 225 | } 226 | 227 | # begin script ... # 228 | 229 | devToolsDir="`xcode-select --print-path`" || \ 230 | panic $? "Failed to get Xcode developer directory" 231 | 232 | if [[ ! -d "$DEVELOPER_DIR" ]] && [[ -d "$devToolsDir" ]]; then 233 | export DEVELOPER_DIR="$devToolsDir" 234 | fi 235 | 236 | case "$1" in 237 | 238 | base) 239 | echo "Uninstalling iOSOpenDev base, Xcode templates and framework header files..." 240 | 241 | # base 242 | 243 | rm -rf "$iOSOpenDevPath" || \ 244 | panic $? "Failed to remove directory: $iOSOpenDevPath" 245 | 246 | # symlink to templates 247 | 248 | userDevDir="$userHome/Library/Developer" 249 | userTemplatesDir="$userDevDir/Xcode/Templates" 250 | symlinkPath="$userTemplatesDir/iOSOpenDev" 251 | 252 | rm -f "$symlinkPath" || \ 253 | panic $? "Failed to remove file: $symlinkPath" 254 | 255 | # bash profile 256 | 257 | for f in "${bashProfileFiles[@]}"; do 258 | if [[ -f "$f" ]]; then 259 | userBashProfileFile="$f" 260 | break 261 | fi 262 | done 263 | 264 | if [[ $userBashProfileFile != "" ]]; then 265 | sed -i "" "s/^export iOSOpenDevPath=.*$//g" "$userBashProfileFile" 266 | sed -i "" "s/^export iOSOpenDevDevice=.*$//g" "$userBashProfileFile" 267 | sed -i "" "s/^export PATH=.*${iOSOpenDevPath//\//\\/}\\/bin:.*$//g" "$userBashProfileFile" 268 | sed -i "" "s/^export PATH=.*\$iOSOpenDevPath\\/bin:.*$//g" "$userBashProfileFile" 269 | fi 270 | ;; 271 | sdk) 272 | shift 1 273 | 274 | sdk="iphoneos" # default to latest iphoneos sdk 275 | printWhich="false" 276 | 277 | while [[ $1 != "" ]]; do 278 | case "$1" in 279 | -sdk) 280 | requireOptionValue "$1" "$2" 281 | sdk="$2" 282 | shift 2 283 | ;; 284 | -d) 285 | requireOptionValue "$1" "$2" 286 | export DEVELOPER_DIR="$2" 287 | shift 2 288 | ;; 289 | -which) 290 | printWhich="true" 291 | shift 1 292 | ;; 293 | *) panic 1 "Invalid option: $1" ;; 294 | esac 295 | done 296 | 297 | iosSdkPath=`getSdkProperty $sdk Path` 298 | iosSdkPlatformPath=`getSdkProperty $sdk PlatformPath` 299 | 300 | # get sdk platform-name and version 301 | 302 | platformName=`getPlatformName "$sdk"` 303 | sdkVersion=`getSdkProperty "$sdk" "SDKVersion"` 304 | 305 | [[ "$printWhich" == "false" ]] || \ 306 | panic 1 "SDK: ${platformName}${sdkVersion} 307 | Developer Tools: $DEVELOPER_DIR" 308 | 309 | echo "Undoing modifications to $platformName $sdkVersion SDK..." 310 | 311 | # restore SDKSettings.plist 312 | 313 | echo "Restoring SDK settings..." 314 | restoreFile "$iosSdkPath/SDKSettings.plist" 315 | 316 | # remove symlinks to dumped private frameworks header files 317 | 318 | echo "Removing symlinks to private frameworks header files..." 319 | removeSdkPrivateHeaderSymlinks "$sdk" 320 | 321 | # restore xcspec files 322 | 323 | echo "Removing specifications from platform..." 324 | 325 | xcspecFileNamePrefix="$platformName" 326 | [[ ! $xcspecFileNamePrefix =~ "Simulator" ]] || \ 327 | xcspecFileNamePrefix="iPhone Simulator " 328 | 329 | restoreFile "$iosSdkPlatformPath/Developer/Library/Xcode/Specifications/${xcspecFileNamePrefix}PackageTypes.xcspec" 330 | restoreFile "$iosSdkPlatformPath/Developer/Library/Xcode/Specifications/${xcspecFileNamePrefix}ProductTypes.xcspec" 331 | ;; 332 | *) showUsage ;; 333 | esac 334 | 335 | # done # 336 | exit 0 -------------------------------------------------------------------------------- /scripts/iod-uninstall_postinstall: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | export iOSOpenDevPath="/opt/iOSOpenDev" 6 | 7 | sourceDir="/opt/iOSOpenDevUninstall" 8 | scriptPath="$sourceDir/bin/iod-uninstall" 9 | 10 | if [[ -f "$scriptPath" ]]; then 11 | echo "Copying $scriptPath to $iOSOpenDevPath/bin..." 12 | cp -f "$scriptPath" "$iOSOpenDevPath/bin" 13 | 14 | rm -rf "$sourceDir" 15 | exit 0 16 | else 17 | echo "$scriptPath not found!" 18 | 19 | rm -rf "$sourceDir" 20 | exit 1 21 | fi 22 | -------------------------------------------------------------------------------- /scripts/iod-uninstall_preinstall: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | targetDir="/opt/iOSOpenDevUninstall/bin" 6 | 7 | [[ -d "$targetDir" ]] || \ 8 | mkdir -p "$targetDir" --------------------------------------------------------------------------------