diff --git a/.github/workflows/issue-assign.yml b/.github/workflows/issue-assign.yml index 3d84c5b405..81ab878572 100644 --- a/.github/workflows/issue-assign.yml +++ b/.github/workflows/issue-assign.yml @@ -20,7 +20,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Assign Issues - uses: Bugheist/assign-issues-action@main + uses: OWASP/BLT-Action@main with: repo-token: ${{ secrets.GITHUB_TOKEN }} repository: ${{ github.repository }} diff --git a/.metadata b/.metadata index 140b92946a..39fcc56ca5 100644 --- a/.metadata +++ b/.metadata @@ -1,10 +1,36 @@ # This file tracks properties of this Flutter project. # Used by Flutter tool to assess capabilities and perform upgrades etc. # -# This file should be version controlled and should not be manually edited. +# This file should be version controlled. version: - revision: 4d7946a68d26794349189cf21b3f68cc6fe61dcb + revision: 9944297138845a94256f1cf37beb88ff9a8e811a channel: stable project_type: app + +# Tracks metadata for the flutter migrate command +migration: + platforms: + - platform: root + create_revision: 9944297138845a94256f1cf37beb88ff9a8e811a + base_revision: 9944297138845a94256f1cf37beb88ff9a8e811a + - platform: android + create_revision: 9944297138845a94256f1cf37beb88ff9a8e811a + base_revision: 9944297138845a94256f1cf37beb88ff9a8e811a + - platform: ios + create_revision: 9944297138845a94256f1cf37beb88ff9a8e811a + base_revision: 9944297138845a94256f1cf37beb88ff9a8e811a + - platform: web + create_revision: 9944297138845a94256f1cf37beb88ff9a8e811a + base_revision: 9944297138845a94256f1cf37beb88ff9a8e811a + + # User provided section + + # List of Local paths (relative to this file) that should be + # ignored by the migrate tool. + # + # Files that are not part of the templates will be ignored by default. + unmanaged_files: + - 'lib/main.dart' + - 'ios/Runner.xcodeproj/project.pbxproj' diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index cdc181f4b4..cf46545124 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,18 +1,18 @@ # Contribution Guide -Thinking of contributing to BugHeist's mobile app? Here's a comprehensive guide to let you join in the fun of the open source world! +Thinking of contributing to BLT's mobile app? Here's a comprehensive guide to let you join in the fun of the open source world! ### Understanding BLT -To be able to contribute to the BugHeist app, you must understand the project, BLT first. To iterate the basics, BLT is a bug logging tool which enables the users (i.e., one of you!) to share the common bugs you find while you surf over the hundreds of different websites or apps. This knowledge of the presence of a bug enables the developers to fix them quickly and thus enhance your browsing experience on that website or that app. This is not the end, you also get rewarded for finding bugs and can also get rewarded in case you are on the top leaderboards of a bug hunt organized by various companies on BugHeist! +To be able to contribute to the BLT app, you must understand the project, BLT first. To iterate the basics, BLT is a bug logging tool which enables the users (i.e., one of you!) to share the common bugs you find while you surf over the hundreds of different websites or apps. This knowledge of the presence of a bug enables the developers to fix them quickly and thus enhance your browsing experience on that website or that app. This is not the end, you also get rewarded for finding bugs and can also get rewarded in case you are on the top leaderboards of a bug hunt organized by various companies on BLT! Open Source FTW! ### This Repository -All of the BugHeist app's code is in this repository. +All of the BLT app's code is in this repository. ### The BLT repository repository -To keep things mantaibale, the website's frontend, backend, and the API's code is in The [BLT repository.](https://www.bugheist.com) +To keep things mantaibale, the website's frontend, backend, and the API's code is in The [BLT repository.](https://github.com/OWASP/BLT) ### Time to contribute! Too much talkin', let's get to the business, yes? We welcome both developers and designers, so we have something for both of you! @@ -20,8 +20,8 @@ Too much talkin', let's get to the business, yes? We welcome both developers and #### _If you are a developer_ Follow the steps below, and you'll be able to set up the dev environment in no time! -- Go to the [BugHeist/Flutter](https://github.com/Bugheist/Flutter) repository. -- Clone the repository, run `git clone https://github.com/Bugheist/Flutter` (you can use any way of your choice). +- Go to the [OWASP/BLT-Flutter](https://github.com/OWASP/BLT-Flutter) repository. +- Clone the repository, run `git clone https://github.com/OWASP/BLT-Flutter` (you can use any way of your choice). - Open the project in an editor of your choice, and then run `flutter run` from the current working directory. ([Haven't installed flutter?](https://docs.flutter.dev/get-started/install) or are [new to flutter?](https://docs.flutter.dev/get-started/codelab)) If you were able to build the app, then you're all set! Check the next section on what to do next. @@ -35,12 +35,12 @@ We value a good user experience empowered by good design practices. You can view
-_Figma link: https://www.figma.com/file/NYD5WZzJywnO338lchnece/BugHeist?node-id=7%3A634_ +_Figma link: https://www.figma.com/file/NYD5WZzJywnO338lchnece/Design?node-id=7%3A634&t=gjDWzr6qy82jpUQa-1_ ### Dev, Set, GO! -If you have set up the dev environment, what are you waiting for? You can do so much! Need a good starting point? Go through the list of [issues](https://github.com/Bugheist/Flutter/issues) on the repository! Have a great new idea that you implemented and want it in the app? [Make a PR](https://github.com/Bugheist/Flutter/pulls), and we'll be sure to consider it! One last thing, while suggesting a screen, please follow the design schemes in the above-shared design file, and make sure that   `flutter analyze` works before submitting that hard-worked pull request of yours! +If you have set up the dev environment, what are you waiting for? You can do so much! Need a good starting point? Go through the list of [issues](https://github.com/OWASP/BLT-Flutter/issues) on the repository! Have a great new idea that you implemented and want it in the app? [Make a PR](https://github.com/OWASP/BLT-Flutter/pulls), and we'll be sure to consider it! One last thing, while suggesting a screen, please follow the design schemes in the above-shared design file, and make sure that   `flutter analyze` works before submitting that hard-worked pull request of yours! #### _Looking forward to what you do!_ -

- The BugHeist Contributors

+

- The BLT Contributors

diff --git a/README.md b/README.md index a723142c0a..bf1dc6aba8 100644 --- a/README.md +++ b/README.md @@ -1,54 +1 @@ - -
- -
-

- -
- -## BugHeist Mobile App -`Report Issues, Win Prizes!` - -
-
-   -   -   -   -

-
- -### Check exiting issues. -Find the bugs and issues in current websites, maybe help fixing 'em too? - -### Report Bugs -Heist those sneaky bugs on different websites and apps & report them. Get rewards too, companies are held accountable! - -### Get Renowned -Fight with other like minded bug and bounty hunters across the word to get on top of the leaderboard! - -## About BugHeist -BugHeist is a bug-hunting & logging tool which allows you, the user or company to hunt for bugs, claim bug hounties and allow you to start bughunting spree/contest respectively. The best part? All of it is opensourced! - -## Contributing -We welcome any contributions big or small. To start contributing, start with anything like opening an issue, pull request, suggesting a documentation etc. - -__If you want to see a complete Contribution Guide, check it out [here.](./CONTRIBUTING.md)__ - -_Please make sure `flutter analyze` works before submitting the pull request._ - -- ### New to flutter? - A few resources to get you started: - - - [Lab: Write your first Flutter app](https://flutter.dev/docs/get-started/codelab) - - [Cookbook: Useful Flutter samples](https://flutter.dev/docs/cookbook) - -- ### Are you a designer? - We got your back! If you want to help up with the UI mockups, design and prototyping refer the below links: - - - New Design file: https://www.figma.com/file/NYD5WZzJywnO338lchnece/BugHeist?node-id=7%3A634 - - Old design file: https://www.figma.com/file/s0xuxeU6O2guoWEfA9OElZ/Bugheist-Full-Design?node-id=513%3A771 - -
- -_Looking for the BugHeist website? Check it out [here](https://www.bugheist.com)!_ +https://owasp.org/www-project-bug-logging-tool/ \ No newline at end of file diff --git a/android/app/build.gradle b/android/app/build.gradle index 30f1857b8b..67fde91064 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -35,7 +35,7 @@ android { defaultConfig { // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). - applicationId "com.apps.bugheist" + applicationId "com.apps.blt" minSdkVersion 18 targetSdkVersion 30 versionCode flutterVersionCode.toInteger() diff --git a/android/app/src/debug/AndroidManifest.xml b/android/app/src/debug/AndroidManifest.xml index 3f0bd632a6..5ce955c628 100644 --- a/android/app/src/debug/AndroidManifest.xml +++ b/android/app/src/debug/AndroidManifest.xml @@ -1,5 +1,5 @@ + package="com.apps.blt"> diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml index cecbcb8b0c..c5ea6bf85d 100644 --- a/android/app/src/main/AndroidManifest.xml +++ b/android/app/src/main/AndroidManifest.xml @@ -1,8 +1,8 @@ + package="com.apps.blt"> diff --git a/android/app/src/main/res/drawable/blt_logo.xml b/android/app/src/main/res/drawable/blt_logo.xml new file mode 100644 index 0000000000..fd12e6d390 --- /dev/null +++ b/android/app/src/main/res/drawable/blt_logo.xml @@ -0,0 +1,69 @@ + + + + + + + + + + + + + + + + + + + + + + + diff --git a/android/app/src/main/res/drawable/launch_background.xml b/android/app/src/main/res/drawable/launch_background.xml index 3120564598..af9dd43efb 100644 --- a/android/app/src/main/res/drawable/launch_background.xml +++ b/android/app/src/main/res/drawable/launch_background.xml @@ -5,6 +5,6 @@ diff --git a/android/app/src/profile/AndroidManifest.xml b/android/app/src/profile/AndroidManifest.xml index 3f0bd632a6..5ce955c628 100644 --- a/android/app/src/profile/AndroidManifest.xml +++ b/android/app/src/profile/AndroidManifest.xml @@ -1,5 +1,5 @@ + package="com.apps.blt"> diff --git a/assets/TnC.md b/assets/TnC.md index 6a1886ac02..c27e3df688 100644 --- a/assets/TnC.md +++ b/assets/TnC.md @@ -1,10 +1,10 @@ -By using the Bugheist.com web site ("Service"), or any services of Bugheist ("Bugheist"), you are agreeing to be bound by the following terms and conditions ("Terms of Service"). IF YOU ARE ENTERING INTO THIS AGREEMENT ON BEHALF OF A COMPANY OR OTHER LEGAL ENTITY, YOU REPRESENT THAT YOU HAVE THE AUTHORITY TO BIND SUCH ENTITY, ITS AFFILIATES AND ALL USERS WHO ACCESS OUR SERVICES THROUGH YOUR ACCOUNT TO THESE TERMS AND CONDITIONS, IN WHICH CASE THE TERMS "YOU" OR "YOUR" SHALL REFER TO SUCH ENTITY, ITS AFFILIATES AND USERS ASSOCIATED WITH IT. IF YOU DO NOT HAVE SUCH AUTHORITY, OR IF YOU DO NOT AGREE WITH THESE TERMS AND CONDITIONS, YOU MUST NOT ACCEPT THIS AGREEMENT AND MAY NOT USE THE SERVICES. +By using the blt.owasp.org web site ("Service"), or any services of BLT ("BLT"), you are agreeing to be bound by the following terms and conditions ("Terms of Service"). IF YOU ARE ENTERING INTO THIS AGREEMENT ON BEHALF OF A COMPANY OR OTHER LEGAL ENTITY, YOU REPRESENT THAT YOU HAVE THE AUTHORITY TO BIND SUCH ENTITY, ITS AFFILIATES AND ALL USERS WHO ACCESS OUR SERVICES THROUGH YOUR ACCOUNT TO THESE TERMS AND CONDITIONS, IN WHICH CASE THE TERMS "YOU" OR "YOUR" SHALL REFER TO SUCH ENTITY, ITS AFFILIATES AND USERS ASSOCIATED WITH IT. IF YOU DO NOT HAVE SUCH AUTHORITY, OR IF YOU DO NOT AGREE WITH THESE TERMS AND CONDITIONS, YOU MUST NOT ACCEPT THIS AGREEMENT AND MAY NOT USE THE SERVICES. -Please note that if you are accessing any Bugheist service in your capacity as a government entity, there are special terms that may apply to you. +Please note that if you are accessing any BLT service in your capacity as a government entity, there are special terms that may apply to you. -If Bugheist makes material changes to these Terms, we will notify you by email or by posting a notice on our site before the changes are effective. Any new features that augment or enhance the current Service, including the release of new tools and resources, shall be subject to the Terms of Service. Continued use of the Service after any such changes shall constitute your consent to such changes. You can review the most current version of the Terms of Service at any time at: http://www.bugheist.com/terms +If BLT makes material changes to these Terms, we will notify you by email or by posting a notice on our site before the changes are effective. Any new features that augment or enhance the current Service, including the release of new tools and resources, shall be subject to the Terms of Service. Continued use of the Service after any such changes shall constitute your consent to such changes. You can review the most current version of the Terms of Service at any time at: https://www.blt.owasp.org//terms -Violation of any of the terms below will result in the termination of your Account. While Bugheist prohibits such conduct and Content on the Service, you understand and agree that Bugheist cannot be responsible for the Content posted on the Service and you nonetheless may be exposed to such materials. You agree to use the Service at your own risk. +Violation of any of the terms below will result in the termination of your Account. While BLT prohibits such conduct and Content on the Service, you understand and agree that BLT cannot be responsible for the Content posted on the Service and you nonetheless may be exposed to such materials. You agree to use the Service at your own risk. 1. You must be 13 years or older to use this Service. @@ -14,7 +14,7 @@ Violation of any of the terms below will result in the termination of your Accou 4. Your login may only be used by one person - a single login shared by multiple people is not permitted. You may create separate logins for as many people as your plan allows. -5. You are responsible for maintaining the security of your account and password. Bugheist cannot and will not be liable for any loss or damage from your failure to comply with this security obligation. +5. You are responsible for maintaining the security of your account and password. BLT cannot and will not be liable for any loss or damage from your failure to comply with this security obligation. 6. You are responsible for all Content posted and activity that occurs under your account (even when Content is posted by others who have accounts under your account). @@ -23,13 +23,13 @@ Violation of any of the terms below will result in the termination of your Accou 8. You may not use the Service for any illegal or unauthorized purpose. You must not, in the use of the Service, violate any laws in your jurisdiction (including but not limited to copyright or trademark laws). -Customers may access their Bugheist account data via an API (Application Program Interface). Any use of the API, including use of the API through a third-party product that accesses Bugheist, is bound by these Terms of Service plus the following specific terms: +Customers may access their BLT account data via an API (Application Program Interface). Any use of the API, including use of the API through a third-party product that accesses BLT, is bound by these Terms of Service plus the following specific terms: -1. You expressly understand and agree that Bugheist shall not be liable for any direct, indirect, incidental, special, consequential or exemplary damages, including but not limited to, damages for loss of profits, goodwill, use, data or other intangible losses (even if Bugheist has been advised of the possibility of such damages), resulting from your use of the API or third-party products that access data via the API. +1. You expressly understand and agree that BLT shall not be liable for any direct, indirect, incidental, special, consequential or exemplary damages, including but not limited to, damages for loss of profits, goodwill, use, data or other intangible losses (even if BLT has been advised of the possibility of such damages), resulting from your use of the API or third-party products that access data via the API. -2. Abuse or excessively frequent requests to Bugheist via the API may result in the temporary or permanent suspension of your account's access to the API. Bugheist, in its sole discretion, will determine abuse or excessive usage of the API. Bugheist will make a reasonable attempt via email to warn the account owner prior to suspension. +2. Abuse or excessively frequent requests to BLT via the API may result in the temporary or permanent suspension of your account's access to the API. BLT, in its sole discretion, will determine abuse or excessive usage of the API. BLT will make a reasonable attempt via email to warn the account owner prior to suspension. -3. Bugheist reserves the right at any time to modify or discontinue, temporarily or permanently, your access to the API (or any part thereof) with or without notice. +3. BLT reserves the right at any time to modify or discontinue, temporarily or permanently, your access to the API (or any part thereof) with or without notice. ``` ``` @@ -42,9 +42,9 @@ Customers may access their Bugheist account data via an API (Application Program 4. All fees are exclusive of all taxes, levies, or duties imposed by taxing authorities, and you shall be responsible for payment of all such taxes, levies, or duties, excluding only United States (federal or state) taxes. 5. For any upgrade or downgrade in plan level while on a monthly billing cycle, the credit card that you provided will automatically be charged the new rate on your next billing cycle. -For upgrades or downgrades while on a yearly plan, Bugheist will immediately charge or refund the difference in plan cost, prorated for the remaining time in your yearly billing cycle. +For upgrades or downgrades while on a yearly plan, BLT will immediately charge or refund the difference in plan cost, prorated for the remaining time in your yearly billing cycle. -6. Downgrading your Service may cause the loss of Content, features, or capacity of your Account. Bugheist does not accept any liability for such loss. +6. Downgrading your Service may cause the loss of Content, features, or capacity of your Account. BLT does not accept any liability for such loss. ``` ``` @@ -55,31 +55,31 @@ For upgrades or downgrades while on a yearly plan, Bugheist will immediately cha 3. If you cancel the Service before the end of your current paid up month, your cancellation will take effect immediately and you will not be charged again. -4. Bugheist, in its sole discretion, has the right to suspend or terminate your account and refuse any and all current or future use of the Service, or any other Bugheist service, for any reason at any time. Such termination of the Service will result in the deactivation or deletion of your Account or your access to your Account, and the forfeiture and relinquishment of all Content in your Account. Bugheist reserves the right to refuse service to anyone for any reason at any time. +4. BLT, in its sole discretion, has the right to suspend or terminate your account and refuse any and all current or future use of the Service, or any other BLT service, for any reason at any time. Such termination of the Service will result in the deactivation or deletion of your Account or your access to your Account, and the forfeiture and relinquishment of all Content in your Account. BLT reserves the right to refuse service to anyone for any reason at any time. ``` ``` 1. We claim no intellectual property rights over the material you provide to the Service. Your profile and materials uploaded remain yours. However, by setting your pages to be viewed publicly, you agree to allow others to view your Content. By setting your repositories to be viewed publicly, you agree to allow others to view and fork your repositories. -2. Bugheist does not pre-screen Content, but Bugheist and its designee have the right (but not the obligation) in their sole discretion to refuse or remove any Content that is available via the Service. +2. BLT does not pre-screen Content, but BLT and its designee have the right (but not the obligation) in their sole discretion to refuse or remove any Content that is available via the Service. -3. You shall defend Bugheist against any claim, demand, suit or proceeding made or brought against Bugheist by a third party alleging that Your Content, or Your use of the Service in violation of this Agreement, infringes or misappropriates the intellectual property rights of a third party or violates applicable law, and shall indemnify Bugheist for any damages finally awarded against, and for reasonable attorney’s fees incurred by, Bugheist in connection with any such claim, demand, suit or proceeding; provided, that Bugheist (a) promptly gives You written notice of the claim, demand, suit or proceeding; (b) gives You sole control of the defense and settlement of the claim, demand, suit or proceeding (provided that You may not settle any claim, demand, suit or proceeding unless the settlement unconditionally releases Bugheist of all liability); and (c) provides to You all reasonable assistance, at Your expense. +3. You shall defend BLT against any claim, demand, suit or proceeding made or brought against BLT by a third party alleging that Your Content, or Your use of the Service in violation of this Agreement, infringes or misappropriates the intellectual property rights of a third party or violates applicable law, and shall indemnify BLT for any damages finally awarded against, and for reasonable attorney’s fees incurred by, BLT in connection with any such claim, demand, suit or proceeding; provided, that BLT (a) promptly gives You written notice of the claim, demand, suit or proceeding; (b) gives You sole control of the defense and settlement of the claim, demand, suit or proceeding (provided that You may not settle any claim, demand, suit or proceeding unless the settlement unconditionally releases BLT of all liability); and (c) provides to You all reasonable assistance, at Your expense. ``` ``` 1. Your use of the Service is at your sole risk. The service is provided on an "as is" and "as available" basis. -2. Support for Bugheist services is only available in English, via email. +2. Support for BLT services is only available in English, via email. -3. You understand that Bugheist uses third party vendors and hosting partners to provide the necessary hardware, software, networking, storage, and related technology required to run the Service. +3. You understand that BLT uses third party vendors and hosting partners to provide the necessary hardware, software, networking, storage, and related technology required to run the Service. -4. You must not modify, adapt or hack the Service or modify another website so as to falsely imply that it is associated with the Service, Bugheist, or any other Bugheist service. +4. You must not modify, adapt or hack the Service or modify another website so as to falsely imply that it is associated with the Service, BLT, or any other BLT service. 5. We may, but have no obligation to, remove Content and Accounts containing Content that we determine in our sole discretion are unlawful, offensive, threatening, libelous, defamatory, pornographic, obscene or otherwise objectionable or violates any party's intellectual property or these Terms of Service. -6. Verbal, physical, written or other abuse (including threats of abuse or retribution) of any Bugheist customer, employee, member, or officer will result in immediate account termination. +6. Verbal, physical, written or other abuse (including threats of abuse or retribution) of any BLT customer, employee, member, or officer will result in immediate account termination. 7. You understand that the technical processing and transmission of the Service, including your Content, may be transfered unencrypted and involve (a) transmissions over various networks; and (b) changes to conform and adapt to technical requirements of connecting networks or devices. @@ -87,12 +87,10 @@ For upgrades or downgrades while on a yearly plan, Bugheist will immediately cha 9. You must not transmit any worms or viruses or any code of a destructive nature. -10. If your bandwidth usage significantly exceeds the average bandwidth usage (as determined solely by Bugheist) of other Bugheist customers, we reserve the right to immediately disable your account or throttle your file hosting until you can reduce your bandwidth consumption. +10. If your bandwidth usage significantly exceeds the average bandwidth usage (as determined solely by BLT) of other BLT customers, we reserve the right to immediately disable your account or throttle your file hosting until you can reduce your bandwidth consumption. -11. Bugheist does not warrant that (i) the service will meet your specific requirements, (ii) the service will be uninterrupted, timely, secure, or error-free, (iii) the results that may be obtained from the use of the service will be accurate or reliable, (iv) the quality of any products, services, information, or other material purchased or obtained by you through the service will meet your expectations, and (v) any errors in the Service will be corrected. +11. BLT does not warrant that (i) the service will meet your specific requirements, (ii) the service will be uninterrupted, timely, secure, or error-free, (iii) the results that may be obtained from the use of the service will be accurate or reliable, (iv) the quality of any products, services, information, or other material purchased or obtained by you through the service will meet your expectations, and (v) any errors in the Service will be corrected. -12. You expressly understand and agree that Bugheist shall not be liable for any direct, indirect, incidental, special, consequential or exemplary damages, including but not limited to, damages for loss of profits, goodwill, use, data or other intangible losses (even if Bugheist has been advised of the possibility of such damages), resulting from: (i) the use or the inability to use the service; (ii) the cost of procurement of substitute goods and services resulting from any goods, data, information or services purchased or obtained or messages received or transactions entered into through or from the service; (iii) unauthorized access to or alteration of your transmissions or data; (iv) statements or conduct of any third party on the service; (v) or any other matter relating to the service. +12. You expressly understand and agree that BLT shall not be liable for any direct, indirect, incidental, special, consequential or exemplary damages, including but not limited to, damages for loss of profits, goodwill, use, data or other intangible losses (even if BLT has been advised of the possibility of such damages), resulting from: (i) the use or the inability to use the service; (ii) the cost of procurement of substitute goods and services resulting from any goods, data, information or services purchased or obtained or messages received or transactions entered into through or from the service; (iii) unauthorized access to or alteration of your transmissions or data; (iv) statements or conduct of any third party on the service; (v) or any other matter relating to the service. -13. The failure of Bugheist to exercise or enforce any right or provision of the Terms of Service shall not constitute a waiver of such right or provision. The Terms of Service constitutes the entire agreement between you and Bugheist and govern your use of the Service, superseding any prior agreements between you and Bugheist (including, but not limited to, any prior versions of the Terms of Service). You agree that these Terms of Service and Your use of the Service are governed under California law. - -14. Questions about the Terms of Service should be sent to support@bugheist.com. +13. The failure of BLT to exercise or enforce any right or provision of the Terms of Service shall not constitute a waiver of such right or provision. The Terms of Service constitutes the entire agreement between you and BLT and govern your use of the Service, superseding any prior agreements between you and BLT (including, but not limited to, any prior versions of the Terms of Service). You agree that these Terms of Service and Your use of the Service are governed under California law. diff --git a/assets/blt_logo.svg b/assets/blt_logo.svg new file mode 100644 index 0000000000..8b6f61f5c7 --- /dev/null +++ b/assets/blt_logo.svg @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/bugheist_logo.svg b/assets/bugheist_logo.svg deleted file mode 100644 index 828c278bc0..0000000000 --- a/assets/bugheist_logo.svg +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - - - - - - - diff --git a/assets/github/gh_screen1.png b/assets/github/gh_screen1.png index 00edc9009c..762e9a0ce8 100644 Binary files a/assets/github/gh_screen1.png and b/assets/github/gh_screen1.png differ diff --git a/assets/github/gh_screen2.png b/assets/github/gh_screen2.png index 6c6b6eaf2f..15e0ea769b 100644 Binary files a/assets/github/gh_screen2.png and b/assets/github/gh_screen2.png differ diff --git a/assets/github/gh_screen3.png b/assets/github/gh_screen3.png index 74ee00931c..f66c025657 100644 Binary files a/assets/github/gh_screen3.png and b/assets/github/gh_screen3.png differ diff --git a/assets/github/gh_screen4.png b/assets/github/gh_screen4.png index c4597fefa6..99de6f4685 100644 Binary files a/assets/github/gh_screen4.png and b/assets/github/gh_screen4.png differ diff --git a/assets/logo_white.svg b/assets/logo_white.svg index 635a91fe4b..91cb1470c0 100644 --- a/assets/logo_white.svg +++ b/assets/logo_white.svg @@ -1,14 +1,23 @@ - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + diff --git a/assets/privacy_policy.md b/assets/privacy_policy.md index 29d8e79492..3aa3bda2f7 100644 --- a/assets/privacy_policy.md +++ b/assets/privacy_policy.md @@ -1,6 +1,6 @@ # Privacy Policy -We want to make sure you, as a Customer or Finder, understand what information we collect from you and why. We also want you to know about our information use practices so that you can make good decisions about how you use Bugheist. +We want to make sure you, as a Customer or Finder, understand what information we collect from you and why. We also want you to know about our information use practices so that you can make good decisions about how you use BLT. This Privacy Policy explains what information we collect from and about you, (collectively, "Your Information") and what we do with it. @@ -8,10 +8,10 @@ _Please read this Privacy Policy carefully._ ## Information Collection - __Direct Collection__ - - When you create an account with Bugheist, you are required to provide us with profile information, including your name, company name (if applicable), username, password, and email address. Bugheist stores this information to help identify you when you log in. + - When you create an account with BLT, you are required to provide us with profile information, including your name, company name (if applicable), username, password, and email address. BLT stores this information to help identify you when you log in. - __Indirect Collection__ - - We receive some information automatically when you visit Bugheist. This includes information about the device, browser, and operating system you use when accessing our site and Services and your IP address. If you visit Bugheist when you are logged into your account, we also collect the user identification number we assign you when you open your account. + - We receive some information automatically when you visit BLT. This includes information about the device, browser, and operating system you use when accessing our site and Services and your IP address. If you visit BLT when you are logged into your account, we also collect the user identification number we assign you when you open your account. - __Cookie Policy__ - - When you log in to your account, Bugheist will place cookie(s) for the purpose of creating the session, knowing when you're logged in, and recognizing you as the same authenticated user across accounts. These cookie(s) contain an encrypted user identifier. + - When you log in to your account, BLT will place cookie(s) for the purpose of creating the session, knowing when you're logged in, and recognizing you as the same authenticated user across accounts. These cookie(s) contain an encrypted user identifier. diff --git a/ios/.gitignore b/ios/.gitignore index e96ef602b8..7a7f9873ad 100644 --- a/ios/.gitignore +++ b/ios/.gitignore @@ -1,3 +1,4 @@ +**/dgph *.mode1v3 *.mode2v3 *.moved-aside @@ -18,6 +19,7 @@ Flutter/App.framework Flutter/Flutter.framework Flutter/Flutter.podspec Flutter/Generated.xcconfig +Flutter/ephemeral/ Flutter/app.flx Flutter/app.zip Flutter/flutter_assets/ diff --git a/ios/Flutter/AppFrameworkInfo.plist b/ios/Flutter/AppFrameworkInfo.plist index bce9839ecb..9625e105df 100644 --- a/ios/Flutter/AppFrameworkInfo.plist +++ b/ios/Flutter/AppFrameworkInfo.plist @@ -7,7 +7,7 @@ CFBundleExecutable App CFBundleIdentifier - com.apps.bugheist.flutter + io.flutter.flutter.app CFBundleInfoDictionaryVersion 6.0 CFBundleName @@ -21,6 +21,6 @@ CFBundleVersion 1.0 MinimumOSVersion - 9.0 + 11.0 diff --git a/ios/Flutter/Debug.xcconfig b/ios/Flutter/Debug.xcconfig index ec97fc6f30..592ceee85b 100644 --- a/ios/Flutter/Debug.xcconfig +++ b/ios/Flutter/Debug.xcconfig @@ -1,2 +1 @@ -#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" #include "Generated.xcconfig" diff --git a/ios/Flutter/Release.xcconfig b/ios/Flutter/Release.xcconfig index c4855bfe20..592ceee85b 100644 --- a/ios/Flutter/Release.xcconfig +++ b/ios/Flutter/Release.xcconfig @@ -1,2 +1 @@ -#include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" #include "Generated.xcconfig" diff --git a/ios/Podfile b/ios/Podfile deleted file mode 100644 index 8db0384910..0000000000 --- a/ios/Podfile +++ /dev/null @@ -1,45 +0,0 @@ -# Uncomment this line to define a global platform for your project -platform :ios, '12.0' - -# CocoaPods analytics sends network stats synchronously affecting flutter build latency. -ENV['COCOAPODS_DISABLE_STATS'] = 'true' - -project 'Runner', { - 'Debug' => :debug, - 'Profile' => :release, - 'Release' => :release, -} - -def flutter_root - generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__) - unless File.exist?(generated_xcode_build_settings_path) - raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first" - end - - File.foreach(generated_xcode_build_settings_path) do |line| - matches = line.match(/FLUTTER_ROOT\=(.*)/) - return matches[1].strip if matches - end - raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get" -end - -require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root) - -flutter_ios_podfile_setup - -target 'Runner' do - use_frameworks! - use_modular_headers! - - flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__)) -end - -post_install do |installer| - installer.pods_project.targets.each do |target| - flutter_additional_ios_build_settings(target) - target.build_configurations.each do |config| - config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '10.0' - config.build_settings['ENABLE_BITCODE'] = 'NO' - end - end -end diff --git a/ios/Podfile.lock b/ios/Podfile.lock deleted file mode 100644 index bbf532e091..0000000000 --- a/ios/Podfile.lock +++ /dev/null @@ -1,34 +0,0 @@ -PODS: - - Flutter (1.0.0) - - image_picker (0.0.1): - - Flutter - - receive_sharing_intent (0.0.1): - - Flutter - - shared_preferences_ios (0.0.1): - - Flutter - -DEPENDENCIES: - - Flutter (from `Flutter`) - - image_picker (from `.symlinks/plugins/image_picker/ios`) - - receive_sharing_intent (from `.symlinks/plugins/receive_sharing_intent/ios`) - - shared_preferences_ios (from `.symlinks/plugins/shared_preferences_ios/ios`) - -EXTERNAL SOURCES: - Flutter: - :path: Flutter - image_picker: - :path: ".symlinks/plugins/image_picker/ios" - receive_sharing_intent: - :path: ".symlinks/plugins/receive_sharing_intent/ios" - shared_preferences_ios: - :path: ".symlinks/plugins/shared_preferences_ios/ios" - -SPEC CHECKSUMS: - Flutter: 50d75fe2f02b26cc09d224853bb45737f8b3214a - image_picker: 50e7c7ff960e5f58faa4d1f4af84a771c671bc4a - receive_sharing_intent: c0d87310754e74c0f9542947e7cbdf3a0335a3b1 - shared_preferences_ios: 548a61f8053b9b8a49ac19c1ffbc8b92c50d68ad - -PODFILE CHECKSUM: 4e8f8b2be68aeea4c0d5beb6ff1e79fface1d048 - -COCOAPODS: 1.10.1 diff --git a/ios/Runner.xcodeproj/project.pbxproj b/ios/Runner.xcodeproj/project.pbxproj index 65c22ec82f..f51413a7f9 100644 --- a/ios/Runner.xcodeproj/project.pbxproj +++ b/ios/Runner.xcodeproj/project.pbxproj @@ -3,44 +3,19 @@ archiveVersion = 1; classes = { }; - objectVersion = 51; + objectVersion = 54; objects = { /* Begin PBXBuildFile section */ 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; }; - 27C23E12D0EF074F57012BC4 /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A891DF077FC246BD2F6C2BFF /* Pods_Runner.framework */; }; 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; }; - 408939F426297DBD0078BC16 /* ShareViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 408939F326297DBD0078BC16 /* ShareViewController.swift */; }; - 408939F726297DBD0078BC16 /* MainInterface.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 408939F526297DBD0078BC16 /* MainInterface.storyboard */; }; - 408939FB26297DBD0078BC16 /* ShareExtension.appex in Embed App Extensions */ = {isa = PBXBuildFile; fileRef = 408939F126297DBD0078BC16 /* ShareExtension.appex */; settings = {ATTRIBUTES = (RemoveHeadersOnCopy, ); }; }; 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; }; 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; }; 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; }; 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; }; /* End PBXBuildFile section */ -/* Begin PBXContainerItemProxy section */ - 408939F926297DBD0078BC16 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 97C146E61CF9000F007C117D /* Project object */; - proxyType = 1; - remoteGlobalIDString = 408939F026297DBD0078BC16; - remoteInfo = ShareExtension; - }; -/* End PBXContainerItemProxy section */ - /* Begin PBXCopyFilesBuildPhase section */ - 408939FC26297DBD0078BC16 /* Embed App Extensions */ = { - isa = PBXCopyFilesBuildPhase; - buildActionMask = 2147483647; - dstPath = ""; - dstSubfolderSpec = 13; - files = ( - 408939FB26297DBD0078BC16 /* ShareExtension.appex in Embed App Extensions */, - ); - name = "Embed App Extensions"; - runOnlyForDeploymentPostprocessing = 0; - }; 9705A1C41CF9048500538489 /* Embed Frameworks */ = { isa = PBXCopyFilesBuildPhase; buildActionMask = 2147483647; @@ -56,14 +31,7 @@ /* Begin PBXFileReference section */ 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; }; 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; }; - 3416B132902F68664AE6BF93 /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = ""; }; 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; }; - 408939F126297DBD0078BC16 /* ShareExtension.appex */ = {isa = PBXFileReference; explicitFileType = "wrapper.app-extension"; includeInIndex = 0; path = ShareExtension.appex; sourceTree = BUILT_PRODUCTS_DIR; }; - 408939F326297DBD0078BC16 /* ShareViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ShareViewController.swift; sourceTree = ""; }; - 408939F626297DBD0078BC16 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/MainInterface.storyboard; sourceTree = ""; }; - 408939F826297DBD0078BC16 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - 40893A02262983D30078BC16 /* Runner.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = Runner.entitlements; sourceTree = ""; }; - 40893A03262985530078BC16 /* ShareExtension.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = ShareExtension.entitlements; sourceTree = ""; }; 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = ""; }; 74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; }; @@ -74,59 +42,19 @@ 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - A20069F6EBCE1B02DD12C2E7 /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = ""; }; - A36576DA9B8785EE67BF9F65 /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = ""; }; - A891DF077FC246BD2F6C2BFF /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ - 408939EE26297DBD0078BC16 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; 97C146EB1CF9000F007C117D /* Frameworks */ = { isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 27C23E12D0EF074F57012BC4 /* Pods_Runner.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ - 2220C6D2234CE65D6B8E3C3F /* Frameworks */ = { - isa = PBXGroup; - children = ( - A891DF077FC246BD2F6C2BFF /* Pods_Runner.framework */, - ); - name = Frameworks; - sourceTree = ""; - }; - 408939F226297DBD0078BC16 /* ShareExtension */ = { - isa = PBXGroup; - children = ( - 40893A03262985530078BC16 /* ShareExtension.entitlements */, - 408939F326297DBD0078BC16 /* ShareViewController.swift */, - 408939F526297DBD0078BC16 /* MainInterface.storyboard */, - 408939F826297DBD0078BC16 /* Info.plist */, - ); - path = ShareExtension; - sourceTree = ""; - }; - 446705EAA7C34A79D184F0B2 /* Pods */ = { - isa = PBXGroup; - children = ( - A20069F6EBCE1B02DD12C2E7 /* Pods-Runner.debug.xcconfig */, - A36576DA9B8785EE67BF9F65 /* Pods-Runner.release.xcconfig */, - 3416B132902F68664AE6BF93 /* Pods-Runner.profile.xcconfig */, - ); - path = Pods; - sourceTree = ""; - }; 9740EEB11CF90186004384FC /* Flutter */ = { isa = PBXGroup; children = ( @@ -143,10 +71,7 @@ children = ( 9740EEB11CF90186004384FC /* Flutter */, 97C146F01CF9000F007C117D /* Runner */, - 408939F226297DBD0078BC16 /* ShareExtension */, 97C146EF1CF9000F007C117D /* Products */, - 446705EAA7C34A79D184F0B2 /* Pods */, - 2220C6D2234CE65D6B8E3C3F /* Frameworks */, ); sourceTree = ""; }; @@ -154,7 +79,6 @@ isa = PBXGroup; children = ( 97C146EE1CF9000F007C117D /* Runner.app */, - 408939F126297DBD0078BC16 /* ShareExtension.appex */, ); name = Products; sourceTree = ""; @@ -162,7 +86,6 @@ 97C146F01CF9000F007C117D /* Runner */ = { isa = PBXGroup; children = ( - 40893A02262983D30078BC16 /* Runner.entitlements */, 97C146FA1CF9000F007C117D /* Main.storyboard */, 97C146FD1CF9000F007C117D /* Assets.xcassets */, 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */, @@ -178,41 +101,20 @@ /* End PBXGroup section */ /* Begin PBXNativeTarget section */ - 408939F026297DBD0078BC16 /* ShareExtension */ = { - isa = PBXNativeTarget; - buildConfigurationList = 40893A0026297DBD0078BC16 /* Build configuration list for PBXNativeTarget "ShareExtension" */; - buildPhases = ( - 408939ED26297DBD0078BC16 /* Sources */, - 408939EE26297DBD0078BC16 /* Frameworks */, - 408939EF26297DBD0078BC16 /* Resources */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = ShareExtension; - productName = ShareExtension; - productReference = 408939F126297DBD0078BC16 /* ShareExtension.appex */; - productType = "com.apple.product-type.app-extension"; - }; 97C146ED1CF9000F007C117D /* Runner */ = { isa = PBXNativeTarget; buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */; buildPhases = ( - ABCEC53F654D8310A188C6C5 /* [CP] Check Pods Manifest.lock */, 9740EEB61CF901F6004384FC /* Run Script */, 97C146EA1CF9000F007C117D /* Sources */, 97C146EB1CF9000F007C117D /* Frameworks */, 97C146EC1CF9000F007C117D /* Resources */, 9705A1C41CF9048500538489 /* Embed Frameworks */, 3B06AD1E1E4923F5004D2608 /* Thin Binary */, - 408939FC26297DBD0078BC16 /* Embed App Extensions */, - EA5080D10BF2AB42928EFF2F /* [CP] Embed Pods Frameworks */, ); buildRules = ( ); dependencies = ( - 408939FA26297DBD0078BC16 /* PBXTargetDependency */, ); name = Runner; productName = Runner; @@ -225,13 +127,9 @@ 97C146E61CF9000F007C117D /* Project object */ = { isa = PBXProject; attributes = { - LastSwiftUpdateCheck = 1240; LastUpgradeCheck = 1300; ORGANIZATIONNAME = ""; TargetAttributes = { - 408939F026297DBD0078BC16 = { - CreatedOnToolsVersion = 12.4; - }; 97C146ED1CF9000F007C117D = { CreatedOnToolsVersion = 7.3.1; LastSwiftMigration = 1100; @@ -252,20 +150,11 @@ projectRoot = ""; targets = ( 97C146ED1CF9000F007C117D /* Runner */, - 408939F026297DBD0078BC16 /* ShareExtension */, ); }; /* End PBXProject section */ /* Begin PBXResourcesBuildPhase section */ - 408939EF26297DBD0078BC16 /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 408939F726297DBD0078BC16 /* MainInterface.storyboard in Resources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; 97C146EC1CF9000F007C117D /* Resources */ = { isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; @@ -282,6 +171,7 @@ /* Begin PBXShellScriptBuildPhase section */ 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { isa = PBXShellScriptBuildPhase; + alwaysOutOfDate = 1; buildActionMask = 2147483647; files = ( ); @@ -296,6 +186,7 @@ }; 9740EEB61CF901F6004384FC /* Run Script */ = { isa = PBXShellScriptBuildPhase; + alwaysOutOfDate = 1; buildActionMask = 2147483647; files = ( ); @@ -308,56 +199,9 @@ shellPath = /bin/sh; shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build"; }; - ABCEC53F654D8310A188C6C5 /* [CP] Check Pods Manifest.lock */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputFileListPaths = ( - ); - inputPaths = ( - "${PODS_PODFILE_DIR_PATH}/Podfile.lock", - "${PODS_ROOT}/Manifest.lock", - ); - name = "[CP] Check Pods Manifest.lock"; - outputFileListPaths = ( - ); - outputPaths = ( - "$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; - showEnvVarsInLog = 0; - }; - EA5080D10BF2AB42928EFF2F /* [CP] Embed Pods Frameworks */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-input-files.xcfilelist", - ); - name = "[CP] Embed Pods Frameworks"; - outputFileListPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks-${CONFIGURATION}-output-files.xcfilelist", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Runner/Pods-Runner-frameworks.sh\"\n"; - showEnvVarsInLog = 0; - }; /* End PBXShellScriptBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ - 408939ED26297DBD0078BC16 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 408939F426297DBD0078BC16 /* ShareViewController.swift in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; 97C146EA1CF9000F007C117D /* Sources */ = { isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; @@ -369,23 +213,7 @@ }; /* End PBXSourcesBuildPhase section */ -/* Begin PBXTargetDependency section */ - 408939FA26297DBD0078BC16 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - target = 408939F026297DBD0078BC16 /* ShareExtension */; - targetProxy = 408939F926297DBD0078BC16 /* PBXContainerItemProxy */; - }; -/* End PBXTargetDependency section */ - /* Begin PBXVariantGroup section */ - 408939F526297DBD0078BC16 /* MainInterface.storyboard */ = { - isa = PBXVariantGroup; - children = ( - 408939F626297DBD0078BC16 /* Base */, - ); - name = MainInterface.storyboard; - sourceTree = ""; - }; 97C146FA1CF9000F007C117D /* Main.storyboard */ = { isa = PBXVariantGroup; children = ( @@ -428,7 +256,6 @@ CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; CLANG_WARN_STRICT_PROTOTYPES = YES; CLANG_WARN_SUSPICIOUS_MOVE = YES; @@ -447,7 +274,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 12.0; + IPHONEOS_DEPLOYMENT_TARGET = 11.0; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; SUPPORTED_PLATFORMS = iphoneos; @@ -460,19 +287,16 @@ isa = XCBuildConfiguration; baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; buildSettings = { - ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; - CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; - DEVELOPMENT_TEAM = HRA3AUNUHS; ENABLE_BITCODE = NO; INFOPLIST_FILE = Runner/Info.plist; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", ); - PRODUCT_BUNDLE_IDENTIFIER = com.apps.bugheist; + PRODUCT_BUNDLE_IDENTIFIER = com.apps.blt; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; SWIFT_VERSION = 5.0; @@ -480,96 +304,6 @@ }; name = Profile; }; - 408939FD26297DBD0078BC16 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; - CLANG_ENABLE_OBJC_WEAK = YES; - CLANG_WARN_DOCUMENTATION_COMMENTS = YES; - CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; - CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; - CODE_SIGN_ENTITLEMENTS = ShareExtension/ShareExtension.entitlements; - CODE_SIGN_STYLE = Automatic; - DEVELOPMENT_TEAM = HRA3AUNUHS; - GCC_C_LANGUAGE_STANDARD = gnu11; - INFOPLIST_FILE = ShareExtension/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 14.4; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/Frameworks", - "@executable_path/../../Frameworks", - ); - MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; - MTL_FAST_MATH = YES; - PRODUCT_BUNDLE_IDENTIFIER = com.apps.bugheist.ShareExtension; - PRODUCT_NAME = "$(TARGET_NAME)"; - SKIP_INSTALL = YES; - SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; - SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_VERSION = 5.0; - TARGETED_DEVICE_FAMILY = "1,2"; - }; - name = Debug; - }; - 408939FE26297DBD0078BC16 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; - CLANG_ENABLE_OBJC_WEAK = YES; - CLANG_WARN_DOCUMENTATION_COMMENTS = YES; - CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; - CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; - CODE_SIGN_ENTITLEMENTS = ShareExtension/ShareExtension.entitlements; - CODE_SIGN_STYLE = Automatic; - DEVELOPMENT_TEAM = HRA3AUNUHS; - GCC_C_LANGUAGE_STANDARD = gnu11; - INFOPLIST_FILE = ShareExtension/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 14.4; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/Frameworks", - "@executable_path/../../Frameworks", - ); - MTL_FAST_MATH = YES; - PRODUCT_BUNDLE_IDENTIFIER = com.apps.bugheist.ShareExtension; - PRODUCT_NAME = "$(TARGET_NAME)"; - SKIP_INSTALL = YES; - SWIFT_VERSION = 5.0; - TARGETED_DEVICE_FAMILY = "1,2"; - }; - name = Release; - }; - 408939FF26297DBD0078BC16 /* Profile */ = { - isa = XCBuildConfiguration; - buildSettings = { - CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; - CLANG_ENABLE_OBJC_WEAK = YES; - CLANG_WARN_DOCUMENTATION_COMMENTS = YES; - CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; - CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; - CODE_SIGN_ENTITLEMENTS = ShareExtension/ShareExtension.entitlements; - CODE_SIGN_STYLE = Automatic; - DEVELOPMENT_TEAM = HRA3AUNUHS; - GCC_C_LANGUAGE_STANDARD = gnu11; - INFOPLIST_FILE = ShareExtension/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 14.4; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/Frameworks", - "@executable_path/../../Frameworks", - ); - MTL_FAST_MATH = YES; - PRODUCT_BUNDLE_IDENTIFIER = com.apps.bugheist.ShareExtension; - PRODUCT_NAME = "$(TARGET_NAME)"; - SKIP_INSTALL = YES; - SWIFT_VERSION = 5.0; - TARGETED_DEVICE_FAMILY = "1,2"; - }; - name = Profile; - }; 97C147031CF9000F007C117D /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { @@ -593,7 +327,6 @@ CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; CLANG_WARN_STRICT_PROTOTYPES = YES; CLANG_WARN_SUSPICIOUS_MOVE = YES; @@ -618,7 +351,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 12.0; + IPHONEOS_DEPLOYMENT_TARGET = 11.0; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; @@ -649,7 +382,6 @@ CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; CLANG_WARN_STRICT_PROTOTYPES = YES; CLANG_WARN_SUSPICIOUS_MOVE = YES; @@ -668,7 +400,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 12.0; + IPHONEOS_DEPLOYMENT_TARGET = 11.0; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; SUPPORTED_PLATFORMS = iphoneos; @@ -683,19 +415,16 @@ isa = XCBuildConfiguration; baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; buildSettings = { - ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; - CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; - DEVELOPMENT_TEAM = HRA3AUNUHS; ENABLE_BITCODE = NO; INFOPLIST_FILE = Runner/Info.plist; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", ); - PRODUCT_BUNDLE_IDENTIFIER = com.apps.bugheist; + PRODUCT_BUNDLE_IDENTIFIER = com.apps.blt; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; @@ -708,19 +437,16 @@ isa = XCBuildConfiguration; baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; buildSettings = { - ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; CLANG_ENABLE_MODULES = YES; - CODE_SIGN_ENTITLEMENTS = Runner/Runner.entitlements; CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; - DEVELOPMENT_TEAM = HRA3AUNUHS; ENABLE_BITCODE = NO; INFOPLIST_FILE = Runner/Info.plist; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", ); - PRODUCT_BUNDLE_IDENTIFIER = com.apps.bugheist; + PRODUCT_BUNDLE_IDENTIFIER = com.apps.blt; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; SWIFT_VERSION = 5.0; @@ -731,16 +457,6 @@ /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ - 40893A0026297DBD0078BC16 /* Build configuration list for PBXNativeTarget "ShareExtension" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 408939FD26297DBD0078BC16 /* Debug */, - 408939FE26297DBD0078BC16 /* Release */, - 408939FF26297DBD0078BC16 /* Profile */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */ = { isa = XCConfigurationList; buildConfigurations = ( @@ -764,4 +480,4 @@ /* End XCConfigurationList section */ }; rootObject = 97C146E61CF9000F007C117D /* Project object */; -} \ No newline at end of file +} diff --git a/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme index 6dd6010f86..c87d15a335 100644 --- a/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme +++ b/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme @@ -1,6 +1,6 @@ - - diff --git a/ios/Runner/Info.plist b/ios/Runner/Info.plist index 5b1953af22..2dd8d12597 100644 --- a/ios/Runner/Info.plist +++ b/ios/Runner/Info.plist @@ -4,6 +4,8 @@ CFBundleDevelopmentRegion $(DEVELOPMENT_LANGUAGE) + CFBundleDisplayName + Blt CFBundleExecutable $(EXECUTABLE_NAME) CFBundleIdentifier @@ -11,7 +13,7 @@ CFBundleInfoDictionaryVersion 6.0 CFBundleName - bugheist + blt CFBundlePackageType APPL CFBundleShortVersionString @@ -26,7 +28,7 @@ LaunchScreen UIMainStoryboardFile Main - ITSAppUsesNonExemptEncryption + ITSAppUsesNonExemptEncryption UISupportedInterfaceOrientations @@ -64,4 +66,4 @@ - + \ No newline at end of file diff --git a/ios/Runner/Runner.entitlements b/ios/Runner/Runner.entitlements deleted file mode 100644 index 32f73a0224..0000000000 --- a/ios/Runner/Runner.entitlements +++ /dev/null @@ -1,14 +0,0 @@ - - - - - com.apple.developer.associated-domains - - applinks:bugheist.com - - - - aps-environment - development - - diff --git a/ios/ShareExtension/Base.lproj/MainInterface.storyboard b/ios/ShareExtension/Base.lproj/MainInterface.storyboard deleted file mode 100644 index 286a50894d..0000000000 --- a/ios/ShareExtension/Base.lproj/MainInterface.storyboard +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/ios/ShareExtension/Info.plist b/ios/ShareExtension/Info.plist deleted file mode 100644 index 8d3b199b3e..0000000000 --- a/ios/ShareExtension/Info.plist +++ /dev/null @@ -1,60 +0,0 @@ - - - - - CFBundleDevelopmentRegion - $(DEVELOPMENT_LANGUAGE) - CFBundleDisplayName - ShareExtension - CFBundleExecutable - $(EXECUTABLE_NAME) - CFBundleIdentifier - $(PRODUCT_BUNDLE_IDENTIFIER) - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - $(PRODUCT_NAME) - CFBundlePackageType - $(PRODUCT_BUNDLE_PACKAGE_TYPE) - CFBundleShortVersionString - 1.0 - CFBundleVersion - 1 - NSExtension - - NSExtensionAttributes - - PHSupportedMediaTypes - - - Video - - Image - - NSExtensionActivationRule - - - NSExtensionActivationSupportsText - - - NSExtensionActivationSupportsWebURLWithMaxCount - 1 - - NSExtensionActivationSupportsImageWithMaxCount - 100 - - NSExtensionActivationSupportsMovieWithMaxCount - 100 - - - NSExtensionActivationSupportsFileWithMaxCount - 1 - - - NSExtensionMainStoryboard - MainInterface - NSExtensionPointIdentifier - com.apple.share-services - - - diff --git a/ios/ShareExtension/ShareExtension.entitlements b/ios/ShareExtension/ShareExtension.entitlements deleted file mode 100644 index 26975e49bd..0000000000 --- a/ios/ShareExtension/ShareExtension.entitlements +++ /dev/null @@ -1,10 +0,0 @@ - - - - - com.apple.developer.associated-domains - - applinks:bugheist.com - - - diff --git a/ios/ShareExtension/ShareViewController.swift b/ios/ShareExtension/ShareViewController.swift deleted file mode 100644 index 769220cb4b..0000000000 --- a/ios/ShareExtension/ShareViewController.swift +++ /dev/null @@ -1,342 +0,0 @@ -// -// ShareViewController.swift -// ShareExtension -// -// Created by BugHeist on 16/04/21. -// - -import UIKit -import Social -import MobileCoreServices -import Photos - -class ShareViewController: SLComposeServiceViewController { - // This should be your host app bundle identifier - let hostAppBundleIdentifier = "com.apps.bugheist" - let sharedKey = "ShareKey" - var sharedMedia: [SharedMediaFile] = [] - var sharedText: [String] = [] - let imageContentType = kUTTypeImage as String - let videoContentType = kUTTypeMovie as String - let textContentType = kUTTypeText as String - let urlContentType = kUTTypeURL as String - let fileURLType = kUTTypeFileURL as String; - - override func isContentValid() -> Bool { - return true - } - - override func viewDidLoad() { - super.viewDidLoad(); - } - - override func viewDidAppear(_ animated: Bool) { - super.viewDidAppear(animated) - - // This is called after the user selects Post. Do the upload of contentText and/or NSExtensionContext attachments. - if let content = extensionContext!.inputItems[0] as? NSExtensionItem { - if let contents = content.attachments { - for (index, attachment) in (contents).enumerated() { - if attachment.hasItemConformingToTypeIdentifier(imageContentType) { - handleImages(content: content, attachment: attachment, index: index) - } else if attachment.hasItemConformingToTypeIdentifier(textContentType) { - handleText(content: content, attachment: attachment, index: index) - } else if attachment.hasItemConformingToTypeIdentifier(fileURLType) { - handleFiles(content: content, attachment: attachment, index: index) - } else if attachment.hasItemConformingToTypeIdentifier(urlContentType) { - handleUrl(content: content, attachment: attachment, index: index) - } else if attachment.hasItemConformingToTypeIdentifier(videoContentType) { - handleVideos(content: content, attachment: attachment, index: index) - } - } - } - } - } - - override func didSelectPost() { - print("didSelectPost"); - } - - override func configurationItems() -> [Any]! { - // To add configuration options via table cells at the bottom of the sheet, return an array of SLComposeSheetConfigurationItem here. - return [] - } - - private func handleText (content: NSExtensionItem, attachment: NSItemProvider, index: Int) { - attachment.loadItem(forTypeIdentifier: textContentType, options: nil) { [weak self] data, error in - - if error == nil, let item = data as? String, let this = self { - - this.sharedText.append(item) - - // If this is the last item, save imagesData in userDefaults and redirect to host app - if index == (content.attachments?.count)! - 1 { - let userDefaults = UserDefaults(suiteName: "group.\(this.hostAppBundleIdentifier)") - userDefaults?.set(this.sharedText, forKey: this.sharedKey) - userDefaults?.synchronize() - this.redirectToHostApp(type: .text) - } - - } else { - self?.dismissWithError() - } - } - } - - private func handleUrl (content: NSExtensionItem, attachment: NSItemProvider, index: Int) { - attachment.loadItem(forTypeIdentifier: urlContentType, options: nil) { [weak self] data, error in - - if error == nil, let item = data as? URL, let this = self { - - this.sharedText.append(item.absoluteString) - - // If this is the last item, save imagesData in userDefaults and redirect to host app - if index == (content.attachments?.count)! - 1 { - let userDefaults = UserDefaults(suiteName: "group.\(this.hostAppBundleIdentifier)") - userDefaults?.set(this.sharedText, forKey: this.sharedKey) - userDefaults?.synchronize() - this.redirectToHostApp(type: .text) - } - - } else { - self?.dismissWithError() - } - } - } - - private func handleImages (content: NSExtensionItem, attachment: NSItemProvider, index: Int) { - attachment.loadItem(forTypeIdentifier: imageContentType, options: nil) { [weak self] data, error in - - if error == nil, let url = data as? URL, let this = self { - - // Always copy - let fileName = this.getFileName(from: url, type: .image) - let newPath = FileManager.default - .containerURL(forSecurityApplicationGroupIdentifier: "group.\(this.hostAppBundleIdentifier)")! - .appendingPathComponent(fileName) - let copied = this.copyFile(at: url, to: newPath) - if(copied) { - this.sharedMedia.append(SharedMediaFile(path: newPath.absoluteString, thumbnail: nil, duration: nil, type: .image)) - } - - // If this is the last item, save imagesData in userDefaults and redirect to host app - if index == (content.attachments?.count)! - 1 { - let userDefaults = UserDefaults(suiteName: "group.\(this.hostAppBundleIdentifier)") - userDefaults?.set(this.toData(data: this.sharedMedia), forKey: this.sharedKey) - userDefaults?.synchronize() - this.redirectToHostApp(type: .media) - } - - } else { - self?.dismissWithError() - } - } - } - - private func handleVideos (content: NSExtensionItem, attachment: NSItemProvider, index: Int) { - attachment.loadItem(forTypeIdentifier: videoContentType, options: nil) { [weak self] data, error in - - if error == nil, let url = data as? URL, let this = self { - - // Always copy - let fileName = this.getFileName(from: url, type: .video) - let newPath = FileManager.default - .containerURL(forSecurityApplicationGroupIdentifier: "group.\(this.hostAppBundleIdentifier)")! - .appendingPathComponent(fileName) - let copied = this.copyFile(at: url, to: newPath) - if(copied) { - guard let sharedFile = this.getSharedMediaFile(forVideo: newPath) else { - return - } - this.sharedMedia.append(sharedFile) - } - - // If this is the last item, save imagesData in userDefaults and redirect to host app - if index == (content.attachments?.count)! - 1 { - let userDefaults = UserDefaults(suiteName: "group.\(this.hostAppBundleIdentifier)") - userDefaults?.set(this.toData(data: this.sharedMedia), forKey: this.sharedKey) - userDefaults?.synchronize() - this.redirectToHostApp(type: .media) - } - - } else { - self?.dismissWithError() - } - } - } - - private func handleFiles (content: NSExtensionItem, attachment: NSItemProvider, index: Int) { - attachment.loadItem(forTypeIdentifier: fileURLType, options: nil) { [weak self] data, error in - - if error == nil, let url = data as? URL, let this = self { - - // Always copy - let fileName = this.getFileName(from :url, type: .file) - let newPath = FileManager.default - .containerURL(forSecurityApplicationGroupIdentifier: "group.\(this.hostAppBundleIdentifier)")! - .appendingPathComponent(fileName) - let copied = this.copyFile(at: url, to: newPath) - if (copied) { - this.sharedMedia.append(SharedMediaFile(path: newPath.absoluteString, thumbnail: nil, duration: nil, type: .file)) - } - - if index == (content.attachments?.count)! - 1 { - let userDefaults = UserDefaults(suiteName: "group.\(this.hostAppBundleIdentifier)") - userDefaults?.set(this.toData(data: this.sharedMedia), forKey: this.sharedKey) - userDefaults?.synchronize() - this.redirectToHostApp(type: .file) - } - - } else { - self?.dismissWithError() - } - } - } - - private func dismissWithError() { - print("[ERROR] Error loading data!") - let alert = UIAlertController(title: "Error", message: "Error loading data", preferredStyle: .alert) - - let action = UIAlertAction(title: "Error", style: .cancel) { _ in - self.dismiss(animated: true, completion: nil) - } - - alert.addAction(action) - present(alert, animated: true, completion: nil) - extensionContext!.completeRequest(returningItems: [], completionHandler: nil) - } - - private func redirectToHostApp(type: RedirectType) { - let url = URL(string: "ShareMedia://dataUrl=\(sharedKey)#\(type)") - var responder = self as UIResponder? - let selectorOpenURL = sel_registerName("openURL:") - - while (responder != nil) { - if (responder?.responds(to: selectorOpenURL))! { - let _ = responder?.perform(selectorOpenURL, with: url) - } - responder = responder!.next - } - extensionContext!.completeRequest(returningItems: [], completionHandler: nil) - } - - enum RedirectType { - case media - case text - case file - } - - func getExtension(from url: URL, type: SharedMediaType) -> String { - let parts = url.lastPathComponent.components(separatedBy: ".") - var ex: String? = nil - if (parts.count > 1) { - ex = parts.last - } - - if (ex == nil) { - switch type { - case .image: - ex = "PNG" - case .video: - ex = "MP4" - case .file: - ex = "TXT" - } - } - return ex ?? "Unknown" - } - - func getFileName(from url: URL, type: SharedMediaType) -> String { - var name = url.lastPathComponent - - if (name.isEmpty) { - name = UUID().uuidString + "." + getExtension(from: url, type: type) - } - - return name - } - - func copyFile(at srcURL: URL, to dstURL: URL) -> Bool { - do { - if FileManager.default.fileExists(atPath: dstURL.path) { - try FileManager.default.removeItem(at: dstURL) - } - try FileManager.default.copyItem(at: srcURL, to: dstURL) - } catch (let error) { - print("Cannot copy item at \(srcURL) to \(dstURL): \(error)") - return false - } - return true - } - - private func getSharedMediaFile(forVideo: URL) -> SharedMediaFile? { - let asset = AVAsset(url: forVideo) - let duration = (CMTimeGetSeconds(asset.duration) * 1000).rounded() - let thumbnailPath = getThumbnailPath(for: forVideo) - - if FileManager.default.fileExists(atPath: thumbnailPath.path) { - return SharedMediaFile(path: forVideo.absoluteString, thumbnail: thumbnailPath.absoluteString, duration: duration, type: .video) - } - - var saved = false - let assetImgGenerate = AVAssetImageGenerator(asset: asset) - assetImgGenerate.appliesPreferredTrackTransform = true - // let scale = UIScreen.main.scale - assetImgGenerate.maximumSize = CGSize(width: 360, height: 360) - do { - let img = try assetImgGenerate.copyCGImage(at: CMTimeMakeWithSeconds(600, preferredTimescale: Int32(1.0)), actualTime: nil) - try UIImage.pngData(UIImage(cgImage: img))()?.write(to: thumbnailPath) - saved = true - } catch { - saved = false - } - - return saved ? SharedMediaFile(path: forVideo.absoluteString, thumbnail: thumbnailPath.absoluteString, duration: duration, type: .video) : nil - - } - - private func getThumbnailPath(for url: URL) -> URL { - let fileName = Data(url.lastPathComponent.utf8).base64EncodedString().replacingOccurrences(of: "==", with: "") - let path = FileManager.default - .containerURL(forSecurityApplicationGroupIdentifier: "group.\(hostAppBundleIdentifier)")! - .appendingPathComponent("\(fileName).jpg") - return path - } - - class SharedMediaFile: Codable { - var path: String; // can be image, video or url path. It can also be text content - var thumbnail: String?; // video thumbnail - var duration: Double?; // video duration in milliseconds - var type: SharedMediaType; - - - init(path: String, thumbnail: String?, duration: Double?, type: SharedMediaType) { - self.path = path - self.thumbnail = thumbnail - self.duration = duration - self.type = type - } - - // Debug method to print out SharedMediaFile details in the console - func toString() { - print("[SharedMediaFile] \n\tpath: \(self.path)\n\tthumbnail: \(self.thumbnail)\n\tduration: \(self.duration)\n\ttype: \(self.type)") - } - } - - enum SharedMediaType: Int, Codable { - case image - case video - case file - } - - func toData(data: [SharedMediaFile]) -> Data { - let encodedData = try? JSONEncoder().encode(data) - return encodedData! - } -} - -extension Array { - subscript (safe index: UInt) -> Element? { - return Int(index) < count ? self[Int(index)] : nil - } -} \ No newline at end of file diff --git a/lib/main.dart b/lib/main.dart index fa4a5f1404..195c9fe138 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -7,6 +7,6 @@ void main() { SystemChrome.setPreferredOrientations([ DeviceOrientation.portraitUp, DeviceOrientation.portraitDown, - ]).then((value) => runApp(BugHeist())); - runApp(BugHeist()); + ]).then((value) => runApp(BLT())); + runApp(BLT()); } diff --git a/lib/src/app.dart b/lib/src/app.dart index cd90adfbd4..b41d82abe8 100644 --- a/lib/src/app.dart +++ b/lib/src/app.dart @@ -1,20 +1,20 @@ import 'dart:async'; -import 'package:bugheist/src/pages/onboarding_main_page.dart'; -import 'package:bugheist/src/routes/routing.dart'; +import 'package:blt/src/pages/onboarding_main_page.dart'; +import 'package:blt/src/routes/routing.dart'; import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:receive_sharing_intent/receive_sharing_intent.dart'; -/// ### The BugHeist app's root widget -class BugHeist extends StatefulWidget { - const BugHeist({Key? key}) : super(key: key); +/// ### The BLT app's root widget +class BLT extends StatefulWidget { + const BLT({Key? key}) : super(key: key); @override - BugHeistState createState() => BugHeistState(); + BLTState createState() => BLTState(); } -class BugHeistState extends State { +class BLTState extends State { late StreamSubscription _intentDataStreamSubscription; late List _sharedFiles; //late String _sharedText; @@ -85,7 +85,7 @@ class BugHeistState extends State { scaffoldMessengerKey: _messengerKey, debugShowCheckedModeBanner: false, onGenerateRoute: RouteManager.generateRoute, - title: 'BugHeist', + title: 'BLT', theme: ThemeData( // useMaterial3: true, primarySwatch: Colors.red, diff --git a/lib/src/components/appbar.dart b/lib/src/components/appbar.dart index 5e8f2a8cb9..d070f98c5f 100644 --- a/lib/src/components/appbar.dart +++ b/lib/src/components/appbar.dart @@ -8,7 +8,7 @@ import '../components/searchbar.dart'; AppBar buildAppBar({required BuildContext context}) { return AppBar( title: SvgPicture.asset( - 'assets/bugheist_logo.svg', + 'assets/blt_logo.svg', fit: BoxFit.cover, height: 30, ), @@ -20,7 +20,7 @@ AppBar buildAppBar({required BuildContext context}) { onPressed: () { showSearch( context: context, - delegate: BugHeistSearchDelegate(), + delegate: BLTSearchDelegate(), ); // do something }, diff --git a/lib/src/components/onboarding/data/onboard_page_data.dart b/lib/src/components/onboarding/data/onboard_page_data.dart index 7850fd3aef..cf5271ad9a 100644 --- a/lib/src/components/onboarding/data/onboard_page_data.dart +++ b/lib/src/components/onboarding/data/onboard_page_data.dart @@ -10,15 +10,15 @@ List onboardData = [ 0, 'assets/logo_white.svg', 'INSIGHT', - 'BugHeist', - 'BugHeist is a bug-hunting & logging tool which allows you, the user or company to hunt for bugs, claim bug hounties and allow you to start bughunting spree/contest respectively.', + 'BLT', + 'BLT is a bug-hunting & logging tool which allows you, the user or company to hunt for bugs, claim bug hounties and allow you to start bughunting spree/contest respectively.', ), OnboardPageModel( Colors.white, Color(0xFFDC4654), Color(0xFFE6E6E6), 1, - 'assets/bugheist_logo.svg', + 'assets/blt_logo.svg', 'EARN', 'POINTS', '(+1) Invite friends\n(+2) Verify other bug reports\n(+3) Fix issues on websites, apps or hardware\n(+4) Find a bug on a new site or app', diff --git a/lib/src/components/onboarding/onboarding.dart b/lib/src/components/onboarding/onboarding.dart index 0a04dad7d3..09af649273 100644 --- a/lib/src/components/onboarding/onboarding.dart +++ b/lib/src/components/onboarding/onboarding.dart @@ -75,7 +75,7 @@ class _OnboardingState extends State { Padding( padding: const EdgeInsets.only(left: 20.0), child: Text( - 'Explore BugHeist', + 'Explore BLT', style: TextStyle( fontSize: 22, fontWeight: FontWeight.bold, diff --git a/lib/src/components/searchbar.dart b/lib/src/components/searchbar.dart index 4b980a164f..29ce7cfc2a 100644 --- a/lib/src/components/searchbar.dart +++ b/lib/src/components/searchbar.dart @@ -6,7 +6,7 @@ import '../models/issuedata_model.dart'; import '../components/issue_intro_card.dart'; /// The search bar of app for searching issues based on keyword. -class BugHeistSearchDelegate extends SearchDelegate { +class BLTSearchDelegate extends SearchDelegate { @override List? buildActions(BuildContext context) { return [ diff --git a/lib/src/constants/about_constants.dart b/lib/src/constants/about_constants.dart index 1e8d5f127d..c79ee57df8 100644 --- a/lib/src/constants/about_constants.dart +++ b/lib/src/constants/about_constants.dart @@ -1,26 +1,26 @@ // Constants for the About Page -final String aboutBugHeist = +final String aboutBLT = """Software code allows us to buy a gift for Mom or Dad on amazon.com in 7 seconds, watch our favorite “House of Cards” episode on Netflix or read Yelp reviews about a new restaurant.\n When we can’t access the information we’re looking for on the internet within seconds, we are not happy. \nThis is where you come into the picture. - \nBugHeist wants you to identify the software (and hardware) bugs that delay downloads, freeze screens, create payloads that deliver malware to websites and generate other issues."""; + \nBLT wants you to identify the software (and hardware) bugs that delay downloads, freeze screens, create payloads that deliver malware to websites and generate other issues."""; final String forYou = '''\u2022 Points. -\u2022 Money if you join a BugHeist Sponsored Bug Hunt. +\u2022 Money if you join a BLT Sponsored Bug Hunt. \u2022 Jackpot money listed on the Leaderboard. \u2022 Money if someone tips you for finding a bug through the tip button. \u2022 Experience to add to your résumé or portfolio.'''; -final String forTesters = '''1. Create a User Account to log into BugHeist. +final String forTesters = '''1. Create a User Account to log into BLT. 2. Describe the software or hardware bug you found. 3. Attach a screenshot of the bug. 4. Submit the information. 5. Win money through company-sponsored Bug Hunts, tips or the Grand Prize/Jackpot.We may also have 'heists' where each bug is worth a specific amount based on what the company sets. -6. If you participate in BugHeist’s sponsored Bug Hunts, you could win prize money known as tips.'''; +6. If you participate in BLT’s sponsored Bug Hunts, you could win prize money known as tips.'''; final String forOrgs = ''' We want everyone to love your website and apps.\n You want to keep your customers happy by giving them a consistent bug-free user experience. -BugHeist offers monthly Bug Hunts through 4 different subscription plans to help you achieve this. +BLT offers the ability to start a bug hunt and have testers from around the world test your site. '''; diff --git a/lib/src/global/variables.dart b/lib/src/global/variables.dart index ef36e2c078..bbe87fe933 100644 --- a/lib/src/global/variables.dart +++ b/lib/src/global/variables.dart @@ -1,4 +1,4 @@ -import 'package:bugheist/src/models/user_model.dart'; +import 'package:blt/src/models/user_model.dart'; // Global variables used throughout the app. diff --git a/lib/src/models/company_model.dart b/lib/src/models/company_model.dart index 979f939706..39fc20cafb 100644 --- a/lib/src/models/company_model.dart +++ b/lib/src/models/company_model.dart @@ -1,6 +1,6 @@ import 'dart:ui'; -/// Model class for a company/domain on BugHeist +/// Model class for a company/domain on BLT class Company { int? id; final String companyName; diff --git a/lib/src/models/issue_model.dart b/lib/src/models/issue_model.dart index d077bfc171..d03a3df2ce 100644 --- a/lib/src/models/issue_model.dart +++ b/lib/src/models/issue_model.dart @@ -2,7 +2,7 @@ import 'package:intl/intl.dart'; import './user_model.dart'; -/// Model class for an issue posted on BugHeist. +/// Model class for an issue posted on BLT. class Issue { final int? id; final User? user; diff --git a/lib/src/models/issuedata_model.dart b/lib/src/models/issuedata_model.dart index 94b0cc75f1..b715fb9a0d 100644 --- a/lib/src/models/issuedata_model.dart +++ b/lib/src/models/issuedata_model.dart @@ -1,4 +1,4 @@ -import 'package:bugheist/src/models/issue_model.dart'; +import 'package:blt/src/models/issue_model.dart'; /// Model class for the paginated data sent on requesting issues. class IssueData { diff --git a/lib/src/models/user_model.dart b/lib/src/models/user_model.dart index 4f055d3405..8c012819c7 100644 --- a/lib/src/models/user_model.dart +++ b/lib/src/models/user_model.dart @@ -1,4 +1,4 @@ -/// Model class for a user signed up on BugHeist. +/// Model class for a user signed up on BLT. class User { int? id; String? username; diff --git a/lib/src/pages/auth/forgot.dart b/lib/src/pages/auth/forgot.dart index 6a8f5ef1e4..e7ecab9385 100644 --- a/lib/src/pages/auth/forgot.dart +++ b/lib/src/pages/auth/forgot.dart @@ -1,4 +1,4 @@ -import 'package:bugheist/src/util/api/auth_api.dart'; +import 'package:blt/src/util/api/auth_api.dart'; import 'package:flutter/material.dart'; import 'package:flutter_svg/flutter_svg.dart'; import 'package:google_fonts/google_fonts.dart'; diff --git a/lib/src/pages/auth/login.dart b/lib/src/pages/auth/login.dart index 30a0797594..8eb5dbdbea 100644 --- a/lib/src/pages/auth/login.dart +++ b/lib/src/pages/auth/login.dart @@ -1,5 +1,5 @@ -import 'package:bugheist/src/providers/authstate_provider.dart'; -import 'package:bugheist/src/routes/routing.dart'; +import 'package:blt/src/providers/authstate_provider.dart'; +import 'package:blt/src/routes/routing.dart'; import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:flutter_svg/flutter_svg.dart'; diff --git a/lib/src/pages/auth/signup.dart b/lib/src/pages/auth/signup.dart index 7f09998bd4..9bde05e059 100644 --- a/lib/src/pages/auth/signup.dart +++ b/lib/src/pages/auth/signup.dart @@ -1,4 +1,4 @@ -import 'package:bugheist/src/util/api/auth_api.dart'; +import 'package:blt/src/util/api/auth_api.dart'; import 'package:flutter/material.dart'; import 'package:flutter_svg/flutter_svg.dart'; import 'package:google_fonts/google_fonts.dart'; diff --git a/lib/src/pages/drawer/about.dart b/lib/src/pages/drawer/about.dart index fc8506afed..4739981960 100644 --- a/lib/src/pages/drawer/about.dart +++ b/lib/src/pages/drawer/about.dart @@ -1,9 +1,9 @@ -import 'package:bugheist/src/constants/about_constants.dart'; +import 'package:blt/src/constants/about_constants.dart'; import 'package:flutter/material.dart'; import 'package:flutter_svg/flutter_svg.dart'; import 'package:google_fonts/google_fonts.dart'; -/// Page for describing the BugHeist project. +/// Page for describing the BLT project. class AboutPage extends StatelessWidget { const AboutPage({Key? key}) : super(key: key); @@ -30,14 +30,14 @@ class AboutPage extends StatelessWidget { Container( padding: EdgeInsets.fromLTRB(0, 36, 0, 24), child: SvgPicture.asset( - 'assets/bugheist_logo.svg', + 'assets/blt_logo.svg', width: 169.42, ), ), Container( padding: EdgeInsets.fromLTRB(0, 0, 0, 24), child: Text( - aboutBugHeist, + aboutBLT, style: GoogleFonts.aBeeZee( textStyle: TextStyle( color: Color(0xFF737373), diff --git a/lib/src/pages/drawer/company_dashboard.dart b/lib/src/pages/drawer/company_dashboard.dart index d23e11eba6..a43806730c 100644 --- a/lib/src/pages/drawer/company_dashboard.dart +++ b/lib/src/pages/drawer/company_dashboard.dart @@ -62,7 +62,7 @@ class _CompanyDashBoardPageState extends ConsumerState { Navigator.of(context).pop(); }, ), - title: Text("BugHeist"), + title: Text("BLT"), actions: [ IconButton( onPressed: () {}, @@ -97,9 +97,7 @@ class _CompanyDashBoardPageState extends ConsumerState { decoration: BoxDecoration( color: companyColor.withOpacity(0.5), image: DecorationImage( - image: NetworkImage( - "https://storage.googleapis.com/bhfiles/logos/https:/bugheist.com.jpg", - ), + image: AssetImage("assets/logo.png"), fit: BoxFit.cover, ), boxShadow: [ @@ -117,7 +115,7 @@ class _CompanyDashBoardPageState extends ConsumerState { child: Row( children: [ Text( - "BugHeist", + "BLT", style: GoogleFonts.ubuntu( textStyle: TextStyle( fontWeight: FontWeight.bold, diff --git a/lib/src/pages/drawer/legal.dart b/lib/src/pages/drawer/legal.dart index 7ef89cb05e..b25f5887ea 100644 --- a/lib/src/pages/drawer/legal.dart +++ b/lib/src/pages/drawer/legal.dart @@ -5,7 +5,7 @@ import 'package:google_fonts/google_fonts.dart'; import 'package:flutter_markdown/flutter_markdown.dart'; /// Page stating the legal Terms and Conditions and Privacy -/// Policy applying to the BugHeist project. +/// Policy applying to the BLT project. class LegalPage extends StatelessWidget { const LegalPage({Key? key}) : super(key: key); @@ -32,14 +32,14 @@ class LegalPage extends StatelessWidget { Container( padding: EdgeInsets.fromLTRB(0, 36, 0, 24), child: SvgPicture.asset( - 'assets/bugheist_logo.svg', + 'assets/blt_logo.svg', width: 169.42, ), ), Container( padding: EdgeInsets.fromLTRB(0, 0, 0, 24), child: Text( - "By using the BugHeist app, you agree to the following terms and conditions and privacy policy. ", + "By using the BLT app, you agree to the following terms and conditions and privacy policy. ", style: GoogleFonts.aBeeZee( textStyle: TextStyle( color: Color(0xFF737373), diff --git a/lib/src/pages/error.dart b/lib/src/pages/error.dart index d837e4927d..b24f595483 100644 --- a/lib/src/pages/error.dart +++ b/lib/src/pages/error.dart @@ -1,4 +1,4 @@ -import 'package:bugheist/src/routes/routing.dart'; +import 'package:blt/src/routes/routing.dart'; import 'package:flutter/material.dart'; import 'package:google_fonts/google_fonts.dart'; import 'package:flutter_svg/flutter_svg.dart'; @@ -49,7 +49,7 @@ class ErrorPage extends StatelessWidget { height: 12, ), Text( - "You have found a bug on BugHeist!\nFeel free to report it or go to home", + "You have found a bug on BLT!\nFeel free to report it or go to home", style: GoogleFonts.aBeeZee( textStyle: TextStyle( color: Color(0xFF737373), diff --git a/lib/src/pages/home/feed.dart b/lib/src/pages/home/feed.dart index 5887268136..ef4c9d31ec 100644 --- a/lib/src/pages/home/feed.dart +++ b/lib/src/pages/home/feed.dart @@ -4,7 +4,7 @@ import 'package:flutter_riverpod/flutter_riverpod.dart'; import '../../global/variables.dart'; -/// Page for showing social activity of BugHeist, new issues, +/// Page for showing social activity of BLT, new issues, /// top premium subscribers. class Feed extends ConsumerStatefulWidget { const Feed({Key? key}) : super(key: key); @@ -40,7 +40,7 @@ class _FeedState extends ConsumerState { height: 10, ), Text( - "Check the latest happenings in the world of BugHeist!", + "Check the latest happenings in the world of BLT!", style: GoogleFonts.aBeeZee( textStyle: TextStyle( color: Color(0xFF737373), diff --git a/lib/src/pages/home/home.dart b/lib/src/pages/home/home.dart index 1a8b7c9efd..fc83a87008 100644 --- a/lib/src/pages/home/home.dart +++ b/lib/src/pages/home/home.dart @@ -1,12 +1,12 @@ -import 'package:bugheist/src/global/variables.dart'; -// import 'package:bugheist/src/pages/home/feed.dart'; -import 'package:bugheist/src/pages/home/issues.dart'; -import 'package:bugheist/src/pages/home/leaderboard.dart'; -import 'package:bugheist/src/pages/home/report_bug.dart'; -import 'package:bugheist/src/providers/authstate_provider.dart'; -import 'package:bugheist/src/providers/login_provider.dart'; -import 'package:bugheist/src/routes/routing.dart'; -import 'package:bugheist/src/util/enums/login_type.dart'; +import 'package:blt/src/global/variables.dart'; +// import 'package:blt/src/pages/home/feed.dart'; +import 'package:blt/src/pages/home/issues.dart'; +import 'package:blt/src/pages/home/leaderboard.dart'; +import 'package:blt/src/pages/home/report_bug.dart'; +import 'package:blt/src/providers/authstate_provider.dart'; +import 'package:blt/src/providers/login_provider.dart'; +import 'package:blt/src/routes/routing.dart'; +import 'package:blt/src/util/enums/login_type.dart'; import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:google_fonts/google_fonts.dart'; diff --git a/lib/src/pages/home/issues.dart b/lib/src/pages/home/issues.dart index 049dab6466..60b0b6c65a 100644 --- a/lib/src/pages/home/issues.dart +++ b/lib/src/pages/home/issues.dart @@ -1,4 +1,4 @@ -import 'package:bugheist/src/providers/issuelist_provider.dart'; +import 'package:blt/src/providers/issuelist_provider.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:google_fonts/google_fonts.dart'; diff --git a/lib/src/pages/home/leaderboard.dart b/lib/src/pages/home/leaderboard.dart index a3aa668c77..904bd1b0c8 100644 --- a/lib/src/pages/home/leaderboard.dart +++ b/lib/src/pages/home/leaderboard.dart @@ -432,7 +432,7 @@ class _LeaderBoardState extends ConsumerState { ), ), Text( - "Take a look at the most active companies on BugHeist!", + "Take a look at the most active companies on BLT!", style: GoogleFonts.aBeeZee( textStyle: TextStyle( color: Color(0xFF737373), diff --git a/lib/src/pages/home/profile.dart b/lib/src/pages/home/profile.dart index aa6f11571e..f9978e52ec 100644 --- a/lib/src/pages/home/profile.dart +++ b/lib/src/pages/home/profile.dart @@ -1,4 +1,4 @@ -import 'package:bugheist/src/util/api/user_api.dart'; +import 'package:blt/src/util/api/user_api.dart'; import 'package:flutter/material.dart'; import 'package:google_fonts/google_fonts.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; @@ -16,7 +16,7 @@ import '../../util/endpoints/issue_endpoints.dart'; import '../../pages/welcome.dart'; -/// Page that displays the stats of a user registered on BugHeist, +/// Page that displays the stats of a user registered on BLT, /// shows dummy data for Guest login. class UserProfile extends ConsumerStatefulWidget { const UserProfile({ diff --git a/lib/src/pages/home/report_bug.dart b/lib/src/pages/home/report_bug.dart index 2f2810b23d..494f9173d9 100644 --- a/lib/src/pages/home/report_bug.dart +++ b/lib/src/pages/home/report_bug.dart @@ -4,7 +4,8 @@ import 'dart:io'; import 'dart:typed_data'; import 'dart:ui'; -import 'package:bugheist/src/util/api/general_api.dart'; +import 'package:blt/src/util/api/general_api.dart'; +import 'package:blt/src/util/endpoints/general_endpoints.dart'; import 'package:flutter/gestures.dart'; import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; @@ -279,7 +280,7 @@ class _ReportFormState extends ConsumerState { "Ensure you are not submitting a duplicate bug by checking here: ", ), TextSpan( - text: "bugheist.com/issue/${m["id"]}", + text: "${GeneralEndPoints.domain}issue/${m["id"]}", style: GoogleFonts.aBeeZee( textStyle: TextStyle( color: Color(0xFF4A93F8), @@ -289,7 +290,7 @@ class _ReportFormState extends ConsumerState { recognizer: TapGestureRecognizer() ..onTap = () async { Uri site = Uri.parse( - "https://www.bugheist.com/issue/${m["id"]}"); + "${GeneralEndPoints.baseUrl}issue/${m["id"]}"); try { await launchUrl(site, mode: LaunchMode.externalApplication); diff --git a/lib/src/pages/leaderboards/company_scoreboard.dart b/lib/src/pages/leaderboards/company_scoreboard.dart index 1e8a9906b0..2e704fa097 100644 --- a/lib/src/pages/leaderboards/company_scoreboard.dart +++ b/lib/src/pages/leaderboards/company_scoreboard.dart @@ -1,3 +1,4 @@ +import 'package:blt/src/util/endpoints/leaderboard_endpoints.dart'; import 'package:flutter/material.dart'; import 'package:google_fonts/google_fonts.dart'; @@ -5,7 +6,7 @@ import '../../routes/routing.dart'; import '../../util/api/company_api.dart'; import '../../util/api/leaderboard_api.dart'; -/// Page showing the top contributing companies on BugHeist. +/// Page showing the top contributing companies on BLT. class CompanyScoreBoardPage extends StatefulWidget { const CompanyScoreBoardPage({Key? key}) : super(key: key); @@ -50,7 +51,7 @@ class _CompanyScoreBoardPageState extends State { @override void initState() { - var paginatedUrl = 'https://www.bugheist.com/api/v1/scoreboard/'; + var paginatedUrl = LeaderboardEndpoints.companyScoreboard; _getObj = LeaderboardApiClient.getScoreBoardData(paginatedUrl); super.initState(); } @@ -97,7 +98,7 @@ class _CompanyScoreBoardPageState extends State { Container( padding: EdgeInsets.fromLTRB(0, 0, 0, 16), child: Text( - "These are the most active companies that are on BugHeist.", + "These are the most active companies that are on BLT.", style: GoogleFonts.aBeeZee( textStyle: TextStyle( color: Color(0xFF737373), diff --git a/lib/src/pages/leaderboards/global_leaderboard.dart b/lib/src/pages/leaderboards/global_leaderboard.dart index 49a2e52b59..867f0ee027 100644 --- a/lib/src/pages/leaderboards/global_leaderboard.dart +++ b/lib/src/pages/leaderboards/global_leaderboard.dart @@ -3,6 +3,7 @@ import 'package:flutter/material.dart'; import 'package:google_fonts/google_fonts.dart'; import '../../util/api/leaderboard_api.dart'; +import '../../util/endpoints/leaderboard_endpoints.dart'; /// Page showing the all time top contributing users. class GlobalLeaderBoardPage extends StatefulWidget { @@ -17,7 +18,7 @@ class _GlobalLeaderBoardPageState extends State { @override void initState() { - var paginatedUrl = 'https://www.bugheist.com/api/v1/userscore/'; + var paginatedUrl = LeaderboardEndpoints.globalLeaderboard; _getObj = LeaderboardApiClient.getLeaderData(paginatedUrl); super.initState(); } @@ -101,7 +102,7 @@ class _GlobalLeaderBoardPageState extends State { Container( padding: EdgeInsets.fromLTRB(0, 0, 0, 16), child: Text( - "These are the all time best bug finders on BugHeist.", + "These are the all time best bug finders on BLT.", style: GoogleFonts.aBeeZee( textStyle: TextStyle( color: Color(0xFF737373), diff --git a/lib/src/pages/leaderboards/monthly_leaderboard.dart b/lib/src/pages/leaderboards/monthly_leaderboard.dart index ff89cc9f9a..a333d98bcb 100644 --- a/lib/src/pages/leaderboards/monthly_leaderboard.dart +++ b/lib/src/pages/leaderboards/monthly_leaderboard.dart @@ -1,3 +1,4 @@ +import 'package:blt/src/util/endpoints/leaderboard_endpoints.dart'; import 'package:flutter/material.dart'; import 'package:google_fonts/google_fonts.dart'; @@ -47,7 +48,7 @@ class _MonthlyLeaderBoardPageState extends State { @override void initState() { - var paginatedUrl = 'https://www.bugheist.com/api/v1/userscore/'; + var paginatedUrl = LeaderboardEndpoints.globalLeaderboard; _getObj = LeaderboardApiClient.getLeaderData(paginatedUrl); super.initState(); } @@ -94,7 +95,7 @@ class _MonthlyLeaderBoardPageState extends State { Container( padding: EdgeInsets.fromLTRB(0, 0, 0, 16), child: Text( - "These are the most active users on BugHeist this month.", + "These are the most active users on BLT this month.", style: GoogleFonts.aBeeZee( textStyle: TextStyle( color: Color(0xFF737373), diff --git a/lib/src/pages/onboarding_main_page.dart b/lib/src/pages/onboarding_main_page.dart index d6f269692d..60d0f3ade6 100644 --- a/lib/src/pages/onboarding_main_page.dart +++ b/lib/src/pages/onboarding_main_page.dart @@ -1,7 +1,7 @@ import 'package:flutter/material.dart'; import '../components/onboarding/onboarding.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; -import 'package:bugheist/src/providers/authstate_provider.dart'; +import 'package:blt/src/providers/authstate_provider.dart'; import '../util/api/general_api.dart'; diff --git a/lib/src/pages/welcome.dart b/lib/src/pages/welcome.dart index b5bcd83a76..c983e304b4 100644 --- a/lib/src/pages/welcome.dart +++ b/lib/src/pages/welcome.dart @@ -1,4 +1,4 @@ -import 'package:bugheist/src/providers/authstate_provider.dart'; +import 'package:blt/src/providers/authstate_provider.dart'; import 'package:flutter/material.dart'; import 'package:flutter/scheduler.dart'; import 'package:flutter_svg/flutter_svg.dart'; diff --git a/lib/src/providers/authstate_provider.dart b/lib/src/providers/authstate_provider.dart index 3cb7c0ebf7..6eafb30548 100644 --- a/lib/src/providers/authstate_provider.dart +++ b/lib/src/providers/authstate_provider.dart @@ -1,4 +1,4 @@ -import 'package:bugheist/src/util/api/user_api.dart'; +import 'package:blt/src/util/api/user_api.dart'; import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:flutter_secure_storage/flutter_secure_storage.dart'; diff --git a/lib/src/providers/leaderboards/companyscoreboard_provider.dart b/lib/src/providers/leaderboards/companyscoreboard_provider.dart index 1103121524..d2b502e544 100644 --- a/lib/src/providers/leaderboards/companyscoreboard_provider.dart +++ b/lib/src/providers/leaderboards/companyscoreboard_provider.dart @@ -1,6 +1,6 @@ -import 'package:bugheist/src/models/company_model.dart'; -import 'package:bugheist/src/util/api/leaderboard_api.dart'; -import 'package:bugheist/src/util/endpoints/leaderboard_endpoints.dart'; +import 'package:blt/src/models/company_model.dart'; +import 'package:blt/src/util/api/leaderboard_api.dart'; +import 'package:blt/src/util/endpoints/leaderboard_endpoints.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; /// The provider which exposes the state management diff --git a/lib/src/providers/leaderboards/globalleaderboard_povider.dart b/lib/src/providers/leaderboards/globalleaderboard_povider.dart index 921646c0d2..25639cbbfb 100644 --- a/lib/src/providers/leaderboards/globalleaderboard_povider.dart +++ b/lib/src/providers/leaderboards/globalleaderboard_povider.dart @@ -1,6 +1,6 @@ -import 'package:bugheist/src/models/leader_model.dart'; -import 'package:bugheist/src/util/api/leaderboard_api.dart'; -import 'package:bugheist/src/util/endpoints/leaderboard_endpoints.dart'; +import 'package:blt/src/models/leader_model.dart'; +import 'package:blt/src/util/api/leaderboard_api.dart'; +import 'package:blt/src/util/endpoints/leaderboard_endpoints.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; /// The provider which exposes the state management diff --git a/lib/src/providers/login_provider.dart b/lib/src/providers/login_provider.dart index d665006355..21469cfce6 100644 --- a/lib/src/providers/login_provider.dart +++ b/lib/src/providers/login_provider.dart @@ -1,4 +1,4 @@ -import 'package:bugheist/src/util/enums/login_type.dart'; +import 'package:blt/src/util/enums/login_type.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; /// The provider which exposes the state management for diff --git a/lib/src/routes/routing.dart b/lib/src/routes/routing.dart index f9c7d13661..24167a886c 100644 --- a/lib/src/routes/routing.dart +++ b/lib/src/routes/routing.dart @@ -1,13 +1,11 @@ -// import 'package:bugheist/pages/login.dart'; -import 'package:bugheist/src/models/issue_model.dart'; -import 'package:bugheist/src/pages/auth/forgot.dart'; -import 'package:bugheist/src/pages/auth/signup.dart'; -import 'package:bugheist/src/pages/error.dart'; -import 'package:bugheist/src/pages/home/home.dart'; -import 'package:bugheist/src/pages/drawer/legal.dart'; -import 'package:bugheist/src/pages/auth/login.dart'; -import 'package:bugheist/src/pages/home/profile.dart'; -// import 'package:bugheist/src/pages/signup.dart'; +import 'package:blt/src/models/issue_model.dart'; +import 'package:blt/src/pages/auth/forgot.dart'; +import 'package:blt/src/pages/auth/signup.dart'; +import 'package:blt/src/pages/error.dart'; +import 'package:blt/src/pages/home/home.dart'; +import 'package:blt/src/pages/drawer/legal.dart'; +import 'package:blt/src/pages/auth/login.dart'; +import 'package:blt/src/pages/home/profile.dart'; import 'package:flutter/material.dart'; import '../models/company_model.dart'; diff --git a/lib/src/util/api/auth_api.dart b/lib/src/util/api/auth_api.dart index da756fdf3b..e762fd8a96 100644 --- a/lib/src/util/api/auth_api.dart +++ b/lib/src/util/api/auth_api.dart @@ -1,7 +1,7 @@ import 'dart:convert'; -import 'package:bugheist/src/models/user_model.dart'; -import 'package:bugheist/src/util/endpoints/auth_endpoints.dart'; +import 'package:blt/src/models/user_model.dart'; +import 'package:blt/src/util/endpoints/auth_endpoints.dart'; import 'package:flutter/material.dart'; import 'package:http/http.dart' as http; @@ -53,7 +53,7 @@ class AuthApiClient { return isLoggedOut; } - /// Request a new user signup on BugHeist. + /// Request a new user signup on BLT. static Future signup( String username, String email, diff --git a/lib/src/util/api/company_api.dart b/lib/src/util/api/company_api.dart index e1d57f747d..08e4ae6310 100644 --- a/lib/src/util/api/company_api.dart +++ b/lib/src/util/api/company_api.dart @@ -1,6 +1,6 @@ import 'dart:convert'; -import 'package:bugheist/src/util/endpoints/company_endpoints.dart'; +import 'package:blt/src/util/endpoints/company_endpoints.dart'; import 'package:http/http.dart' as http; import '../../models/company_model.dart'; diff --git a/lib/src/util/api/general_api.dart b/lib/src/util/api/general_api.dart index fe6c1a70d5..5339a43767 100644 --- a/lib/src/util/api/general_api.dart +++ b/lib/src/util/api/general_api.dart @@ -1,6 +1,6 @@ import 'dart:convert'; -import 'package:bugheist/src/util/endpoints/general_endpoints.dart'; +import 'package:blt/src/util/endpoints/general_endpoints.dart'; import 'package:http/http.dart' as http; /// Class for accessing the general client. diff --git a/lib/src/util/api/issues_api.dart b/lib/src/util/api/issues_api.dart index 23577cd0aa..ea46056f48 100644 --- a/lib/src/util/api/issues_api.dart +++ b/lib/src/util/api/issues_api.dart @@ -1,8 +1,8 @@ import 'dart:convert'; -import 'package:bugheist/src/global/variables.dart'; -import 'package:bugheist/src/models/user_model.dart'; -import 'package:bugheist/src/routes/routing.dart'; -import 'package:bugheist/src/util/endpoints/issue_endpoints.dart'; +import 'package:blt/src/global/variables.dart'; +import 'package:blt/src/models/user_model.dart'; +import 'package:blt/src/routes/routing.dart'; +import 'package:blt/src/util/endpoints/issue_endpoints.dart'; import 'package:flutter/material.dart'; import 'package:http/http.dart' as http; import '../../models/issuedata_model.dart'; diff --git a/lib/src/util/api/leaderboard_api.dart b/lib/src/util/api/leaderboard_api.dart index 75179fc38b..d78211ab1e 100644 --- a/lib/src/util/api/leaderboard_api.dart +++ b/lib/src/util/api/leaderboard_api.dart @@ -1,4 +1,4 @@ -import 'package:bugheist/src/models/company_model.dart'; +import 'package:blt/src/models/company_model.dart'; import 'package:http/http.dart' as http; import 'dart:convert'; import '../../models/leader_model.dart'; diff --git a/lib/src/util/api/user_api.dart b/lib/src/util/api/user_api.dart index 096a8336b5..1f152497cc 100644 --- a/lib/src/util/api/user_api.dart +++ b/lib/src/util/api/user_api.dart @@ -1,8 +1,8 @@ import 'dart:convert'; -import 'package:bugheist/src/util/endpoints/user_endpoints.dart'; +import 'package:blt/src/util/endpoints/user_endpoints.dart'; import 'package:http/http.dart' as http; -import 'package:bugheist/src/models/user_model.dart'; +import 'package:blt/src/models/user_model.dart'; import 'package:image_picker/image_picker.dart'; class UserApiClient { diff --git a/lib/src/util/endpoints/auth_endpoints.dart b/lib/src/util/endpoints/auth_endpoints.dart index dff0170a46..744057e4d8 100644 --- a/lib/src/util/endpoints/auth_endpoints.dart +++ b/lib/src/util/endpoints/auth_endpoints.dart @@ -1,16 +1,16 @@ +import 'general_endpoints.dart'; + /// Class to access the API's authentication endpoints. class AuthEndPoints { AuthEndPoints._(); - static const String baseUrl = "https://www.bugheist.com/"; - - static const String baseUrl2 = "https://www.bugheist.com/auth/"; + static const String authBaseUrl = GeneralEndPoints.baseUrl + "auth/"; - static const String emailpasswordLogin = baseUrl + "authenticate/"; + static const String emailpasswordLogin = GeneralEndPoints.baseUrl + "authenticate/"; - static const String logout = baseUrl2 + "logout/"; + static const String logout = authBaseUrl + "logout/"; - static const String register = baseUrl2 + "registration/"; + static const String register = authBaseUrl + "registration/"; - static const String reset = baseUrl2 + "password/reset/"; + static const String reset = authBaseUrl + "password/reset/"; } diff --git a/lib/src/util/endpoints/company_endpoints.dart b/lib/src/util/endpoints/company_endpoints.dart index bee7dcd7e0..1499d52570 100644 --- a/lib/src/util/endpoints/company_endpoints.dart +++ b/lib/src/util/endpoints/company_endpoints.dart @@ -1,8 +1,8 @@ -/// Class for API endpoints needed to access companies/domains on bugheist. +import 'package:blt/src/util/endpoints/general_endpoints.dart'; + +/// Class for API endpoints needed to access companies/domains on BLT. class CompanyEndpoints { CompanyEndpoints._(); - static const String baseUrl = "https://www.bugheist.com/api/v1/"; - - static const String domain = baseUrl + "domain/"; + static const String domain = GeneralEndPoints.apiBaseUrl + "domain/"; } diff --git a/lib/src/util/endpoints/general_endpoints.dart b/lib/src/util/endpoints/general_endpoints.dart index 04e7f1e8ad..ac3568ec8c 100644 --- a/lib/src/util/endpoints/general_endpoints.dart +++ b/lib/src/util/endpoints/general_endpoints.dart @@ -2,9 +2,13 @@ class GeneralEndPoints { GeneralEndPoints._(); - static const String baseUrl = "https://www.bugheist.com/api/v1/"; + static const String domain = "www.owasp.org/BLT/"; - static const String stats = baseUrl + "stats/"; + static const String baseUrl = "https://www.owasp.org/BLT/"; - static const String duplicateURL = baseUrl + "urlcheck/"; + static const String apiBaseUrl = baseUrl + "api/v1/"; + + static const String stats = apiBaseUrl + "stats/"; + + static const String duplicateURL = apiBaseUrl + "urlcheck/"; } diff --git a/lib/src/util/endpoints/issue_endpoints.dart b/lib/src/util/endpoints/issue_endpoints.dart index 653e5fa3d1..7d8454d84c 100644 --- a/lib/src/util/endpoints/issue_endpoints.dart +++ b/lib/src/util/endpoints/issue_endpoints.dart @@ -1,14 +1,14 @@ -/// Class for API endpoints to access issues on BugHeist. +import 'general_endpoints.dart'; + +/// Class for API endpoints to access issues on BLT. class IssueEndPoints { IssueEndPoints._(); - static const String baseUrl = "https://www.bugheist.com/api/v1/"; - - static const String issues = baseUrl + "issues/"; + static const String issues = GeneralEndPoints.apiBaseUrl + "issues/"; - static const String userIssues = baseUrl + "userissues/"; + static const String userIssues = GeneralEndPoints.apiBaseUrl + "userissues/"; - static const String likeIssues = baseUrl + "issue/like/"; + static const String likeIssues = GeneralEndPoints.apiBaseUrl + "issue/like/"; - static const String flagIssues = baseUrl + "issue/flag/"; + static const String flagIssues = GeneralEndPoints.apiBaseUrl + "issue/flag/"; } diff --git a/lib/src/util/endpoints/leaderboard_endpoints.dart b/lib/src/util/endpoints/leaderboard_endpoints.dart index 43dcb05f05..349608811f 100644 --- a/lib/src/util/endpoints/leaderboard_endpoints.dart +++ b/lib/src/util/endpoints/leaderboard_endpoints.dart @@ -1,8 +1,9 @@ +import 'general_endpoints.dart'; + class LeaderboardEndpoints { LeaderboardEndpoints._(); - static const String baseUrl = "https://www.bugheist.com/api/v1/"; + static const String globalLeaderboard = GeneralEndPoints.apiBaseUrl + "userscore/"; - static const String globalLeaderboard = baseUrl + "userscore/"; - static const String companyScoreboard = baseUrl + "scoreboard/"; + static const String companyScoreboard = GeneralEndPoints.apiBaseUrl + "scoreboard/"; } diff --git a/lib/src/util/endpoints/user_endpoints.dart b/lib/src/util/endpoints/user_endpoints.dart index 734d2615a5..2ba1fdddf2 100644 --- a/lib/src/util/endpoints/user_endpoints.dart +++ b/lib/src/util/endpoints/user_endpoints.dart @@ -1,10 +1,10 @@ -/// Class for API endpoints needed to access users data on BugHeist. +import 'general_endpoints.dart'; + +/// Class for API endpoints needed to access users data on BLT. class UserEndPoints { UserEndPoints._(); - static const String baseUrl = "https://www.bugheist.com/"; - - static const String userInfo = baseUrl + "api/v1/profile/"; + static const String userInfo = GeneralEndPoints.apiBaseUrl + "profile/"; - static const String userData = baseUrl + "api/v1/profile/auth/user/"; + static const String userData = GeneralEndPoints.apiBaseUrl + "profile/auth/user/"; } diff --git a/pubspec.yaml b/pubspec.yaml index d0422d0657..087a471e2f 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,5 +1,5 @@ -name: bugheist -description: The Bugheist App +name: blt +description: The BLT-Flutter App version: 1.0.1+1 diff --git a/windows/.gitignore b/windows/.gitignore deleted file mode 100644 index d492d0d98c..0000000000 --- a/windows/.gitignore +++ /dev/null @@ -1,17 +0,0 @@ -flutter/ephemeral/ - -# Visual Studio user-specific files. -*.suo -*.user -*.userosscache -*.sln.docstates - -# Visual Studio build-related files. -x64/ -x86/ - -# Visual Studio cache files -# files ending in .cache can be ignored -*.[Cc]ache -# but keep track of directories ending in .cache -!*.[Cc]ache/ diff --git a/windows/CMakeLists.txt b/windows/CMakeLists.txt deleted file mode 100644 index 93627deb6c..0000000000 --- a/windows/CMakeLists.txt +++ /dev/null @@ -1,95 +0,0 @@ -cmake_minimum_required(VERSION 3.14) -project(bugheist_flutter LANGUAGES CXX) - -set(BINARY_NAME "bugheist_flutter") - -cmake_policy(SET CMP0063 NEW) - -set(CMAKE_INSTALL_RPATH "$ORIGIN/lib") - -# Configure build options. -get_property(IS_MULTICONFIG GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG) -if(IS_MULTICONFIG) - set(CMAKE_CONFIGURATION_TYPES "Debug;Profile;Release" - CACHE STRING "" FORCE) -else() - if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) - set(CMAKE_BUILD_TYPE "Debug" CACHE - STRING "Flutter build mode" FORCE) - set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS - "Debug" "Profile" "Release") - endif() -endif() - -set(CMAKE_EXE_LINKER_FLAGS_PROFILE "${CMAKE_EXE_LINKER_FLAGS_RELEASE}") -set(CMAKE_SHARED_LINKER_FLAGS_PROFILE "${CMAKE_SHARED_LINKER_FLAGS_RELEASE}") -set(CMAKE_C_FLAGS_PROFILE "${CMAKE_C_FLAGS_RELEASE}") -set(CMAKE_CXX_FLAGS_PROFILE "${CMAKE_CXX_FLAGS_RELEASE}") - -# Use Unicode for all projects. -add_definitions(-DUNICODE -D_UNICODE) - -# Compilation settings that should be applied to most targets. -function(APPLY_STANDARD_SETTINGS TARGET) - target_compile_features(${TARGET} PUBLIC cxx_std_17) - target_compile_options(${TARGET} PRIVATE /W4 /WX /wd"4100") - target_compile_options(${TARGET} PRIVATE /EHsc) - target_compile_definitions(${TARGET} PRIVATE "_HAS_EXCEPTIONS=0") - target_compile_definitions(${TARGET} PRIVATE "$<$:_DEBUG>") -endfunction() - -set(FLUTTER_MANAGED_DIR "${CMAKE_CURRENT_SOURCE_DIR}/flutter") - -# Flutter library and tool build rules. -add_subdirectory(${FLUTTER_MANAGED_DIR}) - -# Application build -add_subdirectory("runner") - -# Generated plugin build rules, which manage building the plugins and adding -# them to the application. -include(flutter/generated_plugins.cmake) - - -# === Installation === -# Support files are copied into place next to the executable, so that it can -# run in place. This is done instead of making a separate bundle (as on Linux) -# so that building and running from within Visual Studio will work. -set(BUILD_BUNDLE_DIR "$") -# Make the "install" step default, as it's required to run. -set(CMAKE_VS_INCLUDE_INSTALL_TO_DEFAULT_BUILD 1) -if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) - set(CMAKE_INSTALL_PREFIX "${BUILD_BUNDLE_DIR}" CACHE PATH "..." FORCE) -endif() - -set(INSTALL_BUNDLE_DATA_DIR "${CMAKE_INSTALL_PREFIX}/data") -set(INSTALL_BUNDLE_LIB_DIR "${CMAKE_INSTALL_PREFIX}") - -install(TARGETS ${BINARY_NAME} RUNTIME DESTINATION "${CMAKE_INSTALL_PREFIX}" - COMPONENT Runtime) - -install(FILES "${FLUTTER_ICU_DATA_FILE}" DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" - COMPONENT Runtime) - -install(FILES "${FLUTTER_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" - COMPONENT Runtime) - -if(PLUGIN_BUNDLED_LIBRARIES) - install(FILES "${PLUGIN_BUNDLED_LIBRARIES}" - DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" - COMPONENT Runtime) -endif() - -# Fully re-copy the assets directory on each build to avoid having stale files -# from a previous install. -set(FLUTTER_ASSET_DIR_NAME "flutter_assets") -install(CODE " - file(REMOVE_RECURSE \"${INSTALL_BUNDLE_DATA_DIR}/${FLUTTER_ASSET_DIR_NAME}\") - " COMPONENT Runtime) -install(DIRECTORY "${PROJECT_BUILD_DIR}/${FLUTTER_ASSET_DIR_NAME}" - DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" COMPONENT Runtime) - -# Install the AOT library on non-Debug builds only. -install(FILES "${AOT_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" - CONFIGURATIONS Profile;Release - COMPONENT Runtime) diff --git a/windows/flutter/CMakeLists.txt b/windows/flutter/CMakeLists.txt deleted file mode 100644 index b2e4bd8d65..0000000000 --- a/windows/flutter/CMakeLists.txt +++ /dev/null @@ -1,103 +0,0 @@ -cmake_minimum_required(VERSION 3.14) - -set(EPHEMERAL_DIR "${CMAKE_CURRENT_SOURCE_DIR}/ephemeral") - -# Configuration provided via flutter tool. -include(${EPHEMERAL_DIR}/generated_config.cmake) - -# TODO: Move the rest of this into files in ephemeral. See -# https://github.com/flutter/flutter/issues/57146. -set(WRAPPER_ROOT "${EPHEMERAL_DIR}/cpp_client_wrapper") - -# === Flutter Library === -set(FLUTTER_LIBRARY "${EPHEMERAL_DIR}/flutter_windows.dll") - -# Published to parent scope for install step. -set(FLUTTER_LIBRARY ${FLUTTER_LIBRARY} PARENT_SCOPE) -set(FLUTTER_ICU_DATA_FILE "${EPHEMERAL_DIR}/icudtl.dat" PARENT_SCOPE) -set(PROJECT_BUILD_DIR "${PROJECT_DIR}/build/" PARENT_SCOPE) -set(AOT_LIBRARY "${PROJECT_DIR}/build/windows/app.so" PARENT_SCOPE) - -list(APPEND FLUTTER_LIBRARY_HEADERS - "flutter_export.h" - "flutter_windows.h" - "flutter_messenger.h" - "flutter_plugin_registrar.h" - "flutter_texture_registrar.h" -) -list(TRANSFORM FLUTTER_LIBRARY_HEADERS PREPEND "${EPHEMERAL_DIR}/") -add_library(flutter INTERFACE) -target_include_directories(flutter INTERFACE - "${EPHEMERAL_DIR}" -) -target_link_libraries(flutter INTERFACE "${FLUTTER_LIBRARY}.lib") -add_dependencies(flutter flutter_assemble) - -# === Wrapper === -list(APPEND CPP_WRAPPER_SOURCES_CORE - "core_implementations.cc" - "standard_codec.cc" -) -list(TRANSFORM CPP_WRAPPER_SOURCES_CORE PREPEND "${WRAPPER_ROOT}/") -list(APPEND CPP_WRAPPER_SOURCES_PLUGIN - "plugin_registrar.cc" -) -list(TRANSFORM CPP_WRAPPER_SOURCES_PLUGIN PREPEND "${WRAPPER_ROOT}/") -list(APPEND CPP_WRAPPER_SOURCES_APP - "flutter_engine.cc" - "flutter_view_controller.cc" -) -list(TRANSFORM CPP_WRAPPER_SOURCES_APP PREPEND "${WRAPPER_ROOT}/") - -# Wrapper sources needed for a plugin. -add_library(flutter_wrapper_plugin STATIC - ${CPP_WRAPPER_SOURCES_CORE} - ${CPP_WRAPPER_SOURCES_PLUGIN} -) -apply_standard_settings(flutter_wrapper_plugin) -set_target_properties(flutter_wrapper_plugin PROPERTIES - POSITION_INDEPENDENT_CODE ON) -set_target_properties(flutter_wrapper_plugin PROPERTIES - CXX_VISIBILITY_PRESET hidden) -target_link_libraries(flutter_wrapper_plugin PUBLIC flutter) -target_include_directories(flutter_wrapper_plugin PUBLIC - "${WRAPPER_ROOT}/include" -) -add_dependencies(flutter_wrapper_plugin flutter_assemble) - -# Wrapper sources needed for the runner. -add_library(flutter_wrapper_app STATIC - ${CPP_WRAPPER_SOURCES_CORE} - ${CPP_WRAPPER_SOURCES_APP} -) -apply_standard_settings(flutter_wrapper_app) -target_link_libraries(flutter_wrapper_app PUBLIC flutter) -target_include_directories(flutter_wrapper_app PUBLIC - "${WRAPPER_ROOT}/include" -) -add_dependencies(flutter_wrapper_app flutter_assemble) - -# === Flutter tool backend === -# _phony_ is a non-existent file to force this command to run every time, -# since currently there's no way to get a full input/output list from the -# flutter tool. -set(PHONY_OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/_phony_") -set_source_files_properties("${PHONY_OUTPUT}" PROPERTIES SYMBOLIC TRUE) -add_custom_command( - OUTPUT ${FLUTTER_LIBRARY} ${FLUTTER_LIBRARY_HEADERS} - ${CPP_WRAPPER_SOURCES_CORE} ${CPP_WRAPPER_SOURCES_PLUGIN} - ${CPP_WRAPPER_SOURCES_APP} - ${PHONY_OUTPUT} - COMMAND ${CMAKE_COMMAND} -E env - ${FLUTTER_TOOL_ENVIRONMENT} - "${FLUTTER_ROOT}/packages/flutter_tools/bin/tool_backend.bat" - windows-x64 $ - VERBATIM -) -add_custom_target(flutter_assemble DEPENDS - "${FLUTTER_LIBRARY}" - ${FLUTTER_LIBRARY_HEADERS} - ${CPP_WRAPPER_SOURCES_CORE} - ${CPP_WRAPPER_SOURCES_PLUGIN} - ${CPP_WRAPPER_SOURCES_APP} -) diff --git a/windows/flutter/generated_plugin_registrant.cc b/windows/flutter/generated_plugin_registrant.cc deleted file mode 100644 index 0c50753854..0000000000 --- a/windows/flutter/generated_plugin_registrant.cc +++ /dev/null @@ -1,14 +0,0 @@ -// -// Generated file. Do not edit. -// - -// clang-format off - -#include "generated_plugin_registrant.h" - -#include - -void RegisterPlugins(flutter::PluginRegistry* registry) { - FlutterSecureStorageWindowsPluginRegisterWithRegistrar( - registry->GetRegistrarForPlugin("FlutterSecureStorageWindowsPlugin")); -} diff --git a/windows/flutter/generated_plugin_registrant.h b/windows/flutter/generated_plugin_registrant.h deleted file mode 100644 index dc139d85a9..0000000000 --- a/windows/flutter/generated_plugin_registrant.h +++ /dev/null @@ -1,15 +0,0 @@ -// -// Generated file. Do not edit. -// - -// clang-format off - -#ifndef GENERATED_PLUGIN_REGISTRANT_ -#define GENERATED_PLUGIN_REGISTRANT_ - -#include - -// Registers Flutter plugins. -void RegisterPlugins(flutter::PluginRegistry* registry); - -#endif // GENERATED_PLUGIN_REGISTRANT_ diff --git a/windows/flutter/generated_plugins.cmake b/windows/flutter/generated_plugins.cmake deleted file mode 100644 index 4fc759c48f..0000000000 --- a/windows/flutter/generated_plugins.cmake +++ /dev/null @@ -1,24 +0,0 @@ -# -# Generated file, do not edit. -# - -list(APPEND FLUTTER_PLUGIN_LIST - flutter_secure_storage_windows -) - -list(APPEND FLUTTER_FFI_PLUGIN_LIST -) - -set(PLUGIN_BUNDLED_LIBRARIES) - -foreach(plugin ${FLUTTER_PLUGIN_LIST}) - add_subdirectory(flutter/ephemeral/.plugin_symlinks/${plugin}/windows plugins/${plugin}) - target_link_libraries(${BINARY_NAME} PRIVATE ${plugin}_plugin) - list(APPEND PLUGIN_BUNDLED_LIBRARIES $) - list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${plugin}_bundled_libraries}) -endforeach(plugin) - -foreach(ffi_plugin ${FLUTTER_FFI_PLUGIN_LIST}) - add_subdirectory(flutter/ephemeral/.plugin_symlinks/${ffi_plugin}/windows plugins/${ffi_plugin}) - list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${ffi_plugin}_bundled_libraries}) -endforeach(ffi_plugin) diff --git a/windows/runner/CMakeLists.txt b/windows/runner/CMakeLists.txt deleted file mode 100644 index de2d8916b7..0000000000 --- a/windows/runner/CMakeLists.txt +++ /dev/null @@ -1,17 +0,0 @@ -cmake_minimum_required(VERSION 3.14) -project(runner LANGUAGES CXX) - -add_executable(${BINARY_NAME} WIN32 - "flutter_window.cpp" - "main.cpp" - "utils.cpp" - "win32_window.cpp" - "${FLUTTER_MANAGED_DIR}/generated_plugin_registrant.cc" - "Runner.rc" - "runner.exe.manifest" -) -apply_standard_settings(${BINARY_NAME}) -target_compile_definitions(${BINARY_NAME} PRIVATE "NOMINMAX") -target_link_libraries(${BINARY_NAME} PRIVATE flutter flutter_wrapper_app) -target_include_directories(${BINARY_NAME} PRIVATE "${CMAKE_SOURCE_DIR}") -add_dependencies(${BINARY_NAME} flutter_assemble) diff --git a/windows/runner/Runner.rc b/windows/runner/Runner.rc deleted file mode 100644 index c5fdcb3e07..0000000000 --- a/windows/runner/Runner.rc +++ /dev/null @@ -1,121 +0,0 @@ -// Microsoft Visual C++ generated resource script. -// -#pragma code_page(65001) -#include "resource.h" - -#define APSTUDIO_READONLY_SYMBOLS -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 2 resource. -// -#include "winres.h" - -///////////////////////////////////////////////////////////////////////////// -#undef APSTUDIO_READONLY_SYMBOLS - -///////////////////////////////////////////////////////////////////////////// -// English (United States) resources - -#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) -LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US - -#ifdef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// TEXTINCLUDE -// - -1 TEXTINCLUDE -BEGIN - "resource.h\0" -END - -2 TEXTINCLUDE -BEGIN - "#include ""winres.h""\r\n" - "\0" -END - -3 TEXTINCLUDE -BEGIN - "\r\n" - "\0" -END - -#endif // APSTUDIO_INVOKED - - -///////////////////////////////////////////////////////////////////////////// -// -// Icon -// - -// Icon with lowest ID value placed first to ensure application icon -// remains consistent on all systems. -IDI_APP_ICON ICON "resources\\app_icon.ico" - - -///////////////////////////////////////////////////////////////////////////// -// -// Version -// - -#ifdef FLUTTER_BUILD_NUMBER -#define VERSION_AS_NUMBER FLUTTER_BUILD_NUMBER -#else -#define VERSION_AS_NUMBER 1,0,0 -#endif - -#ifdef FLUTTER_BUILD_NAME -#define VERSION_AS_STRING #FLUTTER_BUILD_NAME -#else -#define VERSION_AS_STRING "1.0.0" -#endif - -VS_VERSION_INFO VERSIONINFO - FILEVERSION VERSION_AS_NUMBER - PRODUCTVERSION VERSION_AS_NUMBER - FILEFLAGSMASK VS_FFI_FILEFLAGSMASK -#ifdef _DEBUG - FILEFLAGS VS_FF_DEBUG -#else - FILEFLAGS 0x0L -#endif - FILEOS VOS__WINDOWS32 - FILETYPE VFT_APP - FILESUBTYPE 0x0L -BEGIN - BLOCK "StringFileInfo" - BEGIN - BLOCK "040904e4" - BEGIN - VALUE "CompanyName", "com.apps" "\0" - VALUE "FileDescription", "bugheist_flutter" "\0" - VALUE "FileVersion", VERSION_AS_STRING "\0" - VALUE "InternalName", "bugheist_flutter" "\0" - VALUE "LegalCopyright", "Copyright (C) 2022 com.apps. All rights reserved." "\0" - VALUE "OriginalFilename", "bugheist_flutter.exe" "\0" - VALUE "ProductName", "bugheist_flutter" "\0" - VALUE "ProductVersion", VERSION_AS_STRING "\0" - END - END - BLOCK "VarFileInfo" - BEGIN - VALUE "Translation", 0x409, 1252 - END -END - -#endif // English (United States) resources -///////////////////////////////////////////////////////////////////////////// - - - -#ifndef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 3 resource. -// - - -///////////////////////////////////////////////////////////////////////////// -#endif // not APSTUDIO_INVOKED diff --git a/windows/runner/flutter_window.cpp b/windows/runner/flutter_window.cpp deleted file mode 100644 index b43b9095ea..0000000000 --- a/windows/runner/flutter_window.cpp +++ /dev/null @@ -1,61 +0,0 @@ -#include "flutter_window.h" - -#include - -#include "flutter/generated_plugin_registrant.h" - -FlutterWindow::FlutterWindow(const flutter::DartProject& project) - : project_(project) {} - -FlutterWindow::~FlutterWindow() {} - -bool FlutterWindow::OnCreate() { - if (!Win32Window::OnCreate()) { - return false; - } - - RECT frame = GetClientArea(); - - // The size here must match the window dimensions to avoid unnecessary surface - // creation / destruction in the startup path. - flutter_controller_ = std::make_unique( - frame.right - frame.left, frame.bottom - frame.top, project_); - // Ensure that basic setup of the controller was successful. - if (!flutter_controller_->engine() || !flutter_controller_->view()) { - return false; - } - RegisterPlugins(flutter_controller_->engine()); - SetChildContent(flutter_controller_->view()->GetNativeWindow()); - return true; -} - -void FlutterWindow::OnDestroy() { - if (flutter_controller_) { - flutter_controller_ = nullptr; - } - - Win32Window::OnDestroy(); -} - -LRESULT -FlutterWindow::MessageHandler(HWND hwnd, UINT const message, - WPARAM const wparam, - LPARAM const lparam) noexcept { - // Give Flutter, including plugins, an opportunity to handle window messages. - if (flutter_controller_) { - std::optional result = - flutter_controller_->HandleTopLevelWindowProc(hwnd, message, wparam, - lparam); - if (result) { - return *result; - } - } - - switch (message) { - case WM_FONTCHANGE: - flutter_controller_->engine()->ReloadSystemFonts(); - break; - } - - return Win32Window::MessageHandler(hwnd, message, wparam, lparam); -} diff --git a/windows/runner/flutter_window.h b/windows/runner/flutter_window.h deleted file mode 100644 index 6da0652f05..0000000000 --- a/windows/runner/flutter_window.h +++ /dev/null @@ -1,33 +0,0 @@ -#ifndef RUNNER_FLUTTER_WINDOW_H_ -#define RUNNER_FLUTTER_WINDOW_H_ - -#include -#include - -#include - -#include "win32_window.h" - -// A window that does nothing but host a Flutter view. -class FlutterWindow : public Win32Window { - public: - // Creates a new FlutterWindow hosting a Flutter view running |project|. - explicit FlutterWindow(const flutter::DartProject& project); - virtual ~FlutterWindow(); - - protected: - // Win32Window: - bool OnCreate() override; - void OnDestroy() override; - LRESULT MessageHandler(HWND window, UINT const message, WPARAM const wparam, - LPARAM const lparam) noexcept override; - - private: - // The project to run. - flutter::DartProject project_; - - // The Flutter instance hosted by this window. - std::unique_ptr flutter_controller_; -}; - -#endif // RUNNER_FLUTTER_WINDOW_H_ diff --git a/windows/runner/main.cpp b/windows/runner/main.cpp deleted file mode 100644 index cbb46f30a0..0000000000 --- a/windows/runner/main.cpp +++ /dev/null @@ -1,43 +0,0 @@ -#include -#include -#include - -#include "flutter_window.h" -#include "utils.h" - -int APIENTRY wWinMain(_In_ HINSTANCE instance, _In_opt_ HINSTANCE prev, - _In_ wchar_t *command_line, _In_ int show_command) { - // Attach to console when present (e.g., 'flutter run') or create a - // new console when running with a debugger. - if (!::AttachConsole(ATTACH_PARENT_PROCESS) && ::IsDebuggerPresent()) { - CreateAndAttachConsole(); - } - - // Initialize COM, so that it is available for use in the library and/or - // plugins. - ::CoInitializeEx(nullptr, COINIT_APARTMENTTHREADED); - - flutter::DartProject project(L"data"); - - std::vector command_line_arguments = - GetCommandLineArguments(); - - project.set_dart_entrypoint_arguments(std::move(command_line_arguments)); - - FlutterWindow window(project); - Win32Window::Point origin(10, 10); - Win32Window::Size size(1280, 720); - if (!window.CreateAndShow(L"bugheist_flutter", origin, size)) { - return EXIT_FAILURE; - } - window.SetQuitOnClose(true); - - ::MSG msg; - while (::GetMessage(&msg, nullptr, 0, 0)) { - ::TranslateMessage(&msg); - ::DispatchMessage(&msg); - } - - ::CoUninitialize(); - return EXIT_SUCCESS; -} diff --git a/windows/runner/resource.h b/windows/runner/resource.h deleted file mode 100644 index 66a65d1e4a..0000000000 --- a/windows/runner/resource.h +++ /dev/null @@ -1,16 +0,0 @@ -//{{NO_DEPENDENCIES}} -// Microsoft Visual C++ generated include file. -// Used by Runner.rc -// -#define IDI_APP_ICON 101 - -// Next default values for new objects -// -#ifdef APSTUDIO_INVOKED -#ifndef APSTUDIO_READONLY_SYMBOLS -#define _APS_NEXT_RESOURCE_VALUE 102 -#define _APS_NEXT_COMMAND_VALUE 40001 -#define _APS_NEXT_CONTROL_VALUE 1001 -#define _APS_NEXT_SYMED_VALUE 101 -#endif -#endif diff --git a/windows/runner/resources/app_icon.ico b/windows/runner/resources/app_icon.ico deleted file mode 100644 index c04e20caf6..0000000000 Binary files a/windows/runner/resources/app_icon.ico and /dev/null differ diff --git a/windows/runner/runner.exe.manifest b/windows/runner/runner.exe.manifest deleted file mode 100644 index c977c4a425..0000000000 --- a/windows/runner/runner.exe.manifest +++ /dev/null @@ -1,20 +0,0 @@ - - - - - PerMonitorV2 - - - - - - - - - - - - - - - diff --git a/windows/runner/utils.cpp b/windows/runner/utils.cpp deleted file mode 100644 index d19bdbbcc3..0000000000 --- a/windows/runner/utils.cpp +++ /dev/null @@ -1,64 +0,0 @@ -#include "utils.h" - -#include -#include -#include -#include - -#include - -void CreateAndAttachConsole() { - if (::AllocConsole()) { - FILE *unused; - if (freopen_s(&unused, "CONOUT$", "w", stdout)) { - _dup2(_fileno(stdout), 1); - } - if (freopen_s(&unused, "CONOUT$", "w", stderr)) { - _dup2(_fileno(stdout), 2); - } - std::ios::sync_with_stdio(); - FlutterDesktopResyncOutputStreams(); - } -} - -std::vector GetCommandLineArguments() { - // Convert the UTF-16 command line arguments to UTF-8 for the Engine to use. - int argc; - wchar_t** argv = ::CommandLineToArgvW(::GetCommandLineW(), &argc); - if (argv == nullptr) { - return std::vector(); - } - - std::vector command_line_arguments; - - // Skip the first argument as it's the binary name. - for (int i = 1; i < argc; i++) { - command_line_arguments.push_back(Utf8FromUtf16(argv[i])); - } - - ::LocalFree(argv); - - return command_line_arguments; -} - -std::string Utf8FromUtf16(const wchar_t* utf16_string) { - if (utf16_string == nullptr) { - return std::string(); - } - int target_length = ::WideCharToMultiByte( - CP_UTF8, WC_ERR_INVALID_CHARS, utf16_string, - -1, nullptr, 0, nullptr, nullptr); - if (target_length == 0) { - return std::string(); - } - std::string utf8_string; - utf8_string.resize(target_length); - int converted_length = ::WideCharToMultiByte( - CP_UTF8, WC_ERR_INVALID_CHARS, utf16_string, - -1, utf8_string.data(), - target_length, nullptr, nullptr); - if (converted_length == 0) { - return std::string(); - } - return utf8_string; -} diff --git a/windows/runner/utils.h b/windows/runner/utils.h deleted file mode 100644 index 3879d54755..0000000000 --- a/windows/runner/utils.h +++ /dev/null @@ -1,19 +0,0 @@ -#ifndef RUNNER_UTILS_H_ -#define RUNNER_UTILS_H_ - -#include -#include - -// Creates a console for the process, and redirects stdout and stderr to -// it for both the runner and the Flutter library. -void CreateAndAttachConsole(); - -// Takes a null-terminated wchar_t* encoded in UTF-16 and returns a std::string -// encoded in UTF-8. Returns an empty std::string on failure. -std::string Utf8FromUtf16(const wchar_t* utf16_string); - -// Gets the command line arguments passed in as a std::vector, -// encoded in UTF-8. Returns an empty std::vector on failure. -std::vector GetCommandLineArguments(); - -#endif // RUNNER_UTILS_H_ diff --git a/windows/runner/win32_window.cpp b/windows/runner/win32_window.cpp deleted file mode 100644 index c10f08dc7d..0000000000 --- a/windows/runner/win32_window.cpp +++ /dev/null @@ -1,245 +0,0 @@ -#include "win32_window.h" - -#include - -#include "resource.h" - -namespace { - -constexpr const wchar_t kWindowClassName[] = L"FLUTTER_RUNNER_WIN32_WINDOW"; - -// The number of Win32Window objects that currently exist. -static int g_active_window_count = 0; - -using EnableNonClientDpiScaling = BOOL __stdcall(HWND hwnd); - -// Scale helper to convert logical scaler values to physical using passed in -// scale factor -int Scale(int source, double scale_factor) { - return static_cast(source * scale_factor); -} - -// Dynamically loads the |EnableNonClientDpiScaling| from the User32 module. -// This API is only needed for PerMonitor V1 awareness mode. -void EnableFullDpiSupportIfAvailable(HWND hwnd) { - HMODULE user32_module = LoadLibraryA("User32.dll"); - if (!user32_module) { - return; - } - auto enable_non_client_dpi_scaling = - reinterpret_cast( - GetProcAddress(user32_module, "EnableNonClientDpiScaling")); - if (enable_non_client_dpi_scaling != nullptr) { - enable_non_client_dpi_scaling(hwnd); - FreeLibrary(user32_module); - } -} - -} // namespace - -// Manages the Win32Window's window class registration. -class WindowClassRegistrar { - public: - ~WindowClassRegistrar() = default; - - // Returns the singleton registar instance. - static WindowClassRegistrar* GetInstance() { - if (!instance_) { - instance_ = new WindowClassRegistrar(); - } - return instance_; - } - - // Returns the name of the window class, registering the class if it hasn't - // previously been registered. - const wchar_t* GetWindowClass(); - - // Unregisters the window class. Should only be called if there are no - // instances of the window. - void UnregisterWindowClass(); - - private: - WindowClassRegistrar() = default; - - static WindowClassRegistrar* instance_; - - bool class_registered_ = false; -}; - -WindowClassRegistrar* WindowClassRegistrar::instance_ = nullptr; - -const wchar_t* WindowClassRegistrar::GetWindowClass() { - if (!class_registered_) { - WNDCLASS window_class{}; - window_class.hCursor = LoadCursor(nullptr, IDC_ARROW); - window_class.lpszClassName = kWindowClassName; - window_class.style = CS_HREDRAW | CS_VREDRAW; - window_class.cbClsExtra = 0; - window_class.cbWndExtra = 0; - window_class.hInstance = GetModuleHandle(nullptr); - window_class.hIcon = - LoadIcon(window_class.hInstance, MAKEINTRESOURCE(IDI_APP_ICON)); - window_class.hbrBackground = 0; - window_class.lpszMenuName = nullptr; - window_class.lpfnWndProc = Win32Window::WndProc; - RegisterClass(&window_class); - class_registered_ = true; - } - return kWindowClassName; -} - -void WindowClassRegistrar::UnregisterWindowClass() { - UnregisterClass(kWindowClassName, nullptr); - class_registered_ = false; -} - -Win32Window::Win32Window() { - ++g_active_window_count; -} - -Win32Window::~Win32Window() { - --g_active_window_count; - Destroy(); -} - -bool Win32Window::CreateAndShow(const std::wstring& title, - const Point& origin, - const Size& size) { - Destroy(); - - const wchar_t* window_class = - WindowClassRegistrar::GetInstance()->GetWindowClass(); - - const POINT target_point = {static_cast(origin.x), - static_cast(origin.y)}; - HMONITOR monitor = MonitorFromPoint(target_point, MONITOR_DEFAULTTONEAREST); - UINT dpi = FlutterDesktopGetDpiForMonitor(monitor); - double scale_factor = dpi / 96.0; - - HWND window = CreateWindow( - window_class, title.c_str(), WS_OVERLAPPEDWINDOW | WS_VISIBLE, - Scale(origin.x, scale_factor), Scale(origin.y, scale_factor), - Scale(size.width, scale_factor), Scale(size.height, scale_factor), - nullptr, nullptr, GetModuleHandle(nullptr), this); - - if (!window) { - return false; - } - - return OnCreate(); -} - -// static -LRESULT CALLBACK Win32Window::WndProc(HWND const window, - UINT const message, - WPARAM const wparam, - LPARAM const lparam) noexcept { - if (message == WM_NCCREATE) { - auto window_struct = reinterpret_cast(lparam); - SetWindowLongPtr(window, GWLP_USERDATA, - reinterpret_cast(window_struct->lpCreateParams)); - - auto that = static_cast(window_struct->lpCreateParams); - EnableFullDpiSupportIfAvailable(window); - that->window_handle_ = window; - } else if (Win32Window* that = GetThisFromHandle(window)) { - return that->MessageHandler(window, message, wparam, lparam); - } - - return DefWindowProc(window, message, wparam, lparam); -} - -LRESULT -Win32Window::MessageHandler(HWND hwnd, - UINT const message, - WPARAM const wparam, - LPARAM const lparam) noexcept { - switch (message) { - case WM_DESTROY: - window_handle_ = nullptr; - Destroy(); - if (quit_on_close_) { - PostQuitMessage(0); - } - return 0; - - case WM_DPICHANGED: { - auto newRectSize = reinterpret_cast(lparam); - LONG newWidth = newRectSize->right - newRectSize->left; - LONG newHeight = newRectSize->bottom - newRectSize->top; - - SetWindowPos(hwnd, nullptr, newRectSize->left, newRectSize->top, newWidth, - newHeight, SWP_NOZORDER | SWP_NOACTIVATE); - - return 0; - } - case WM_SIZE: { - RECT rect = GetClientArea(); - if (child_content_ != nullptr) { - // Size and position the child window. - MoveWindow(child_content_, rect.left, rect.top, rect.right - rect.left, - rect.bottom - rect.top, TRUE); - } - return 0; - } - - case WM_ACTIVATE: - if (child_content_ != nullptr) { - SetFocus(child_content_); - } - return 0; - } - - return DefWindowProc(window_handle_, message, wparam, lparam); -} - -void Win32Window::Destroy() { - OnDestroy(); - - if (window_handle_) { - DestroyWindow(window_handle_); - window_handle_ = nullptr; - } - if (g_active_window_count == 0) { - WindowClassRegistrar::GetInstance()->UnregisterWindowClass(); - } -} - -Win32Window* Win32Window::GetThisFromHandle(HWND const window) noexcept { - return reinterpret_cast( - GetWindowLongPtr(window, GWLP_USERDATA)); -} - -void Win32Window::SetChildContent(HWND content) { - child_content_ = content; - SetParent(content, window_handle_); - RECT frame = GetClientArea(); - - MoveWindow(content, frame.left, frame.top, frame.right - frame.left, - frame.bottom - frame.top, true); - - SetFocus(child_content_); -} - -RECT Win32Window::GetClientArea() { - RECT frame; - GetClientRect(window_handle_, &frame); - return frame; -} - -HWND Win32Window::GetHandle() { - return window_handle_; -} - -void Win32Window::SetQuitOnClose(bool quit_on_close) { - quit_on_close_ = quit_on_close; -} - -bool Win32Window::OnCreate() { - // No-op; provided for subclasses. - return true; -} - -void Win32Window::OnDestroy() { - // No-op; provided for subclasses. -} diff --git a/windows/runner/win32_window.h b/windows/runner/win32_window.h deleted file mode 100644 index 17ba431125..0000000000 --- a/windows/runner/win32_window.h +++ /dev/null @@ -1,98 +0,0 @@ -#ifndef RUNNER_WIN32_WINDOW_H_ -#define RUNNER_WIN32_WINDOW_H_ - -#include - -#include -#include -#include - -// A class abstraction for a high DPI-aware Win32 Window. Intended to be -// inherited from by classes that wish to specialize with custom -// rendering and input handling -class Win32Window { - public: - struct Point { - unsigned int x; - unsigned int y; - Point(unsigned int x, unsigned int y) : x(x), y(y) {} - }; - - struct Size { - unsigned int width; - unsigned int height; - Size(unsigned int width, unsigned int height) - : width(width), height(height) {} - }; - - Win32Window(); - virtual ~Win32Window(); - - // Creates and shows a win32 window with |title| and position and size using - // |origin| and |size|. New windows are created on the default monitor. Window - // sizes are specified to the OS in physical pixels, hence to ensure a - // consistent size to will treat the width height passed in to this function - // as logical pixels and scale to appropriate for the default monitor. Returns - // true if the window was created successfully. - bool CreateAndShow(const std::wstring& title, - const Point& origin, - const Size& size); - - // Release OS resources associated with window. - void Destroy(); - - // Inserts |content| into the window tree. - void SetChildContent(HWND content); - - // Returns the backing Window handle to enable clients to set icon and other - // window properties. Returns nullptr if the window has been destroyed. - HWND GetHandle(); - - // If true, closing this window will quit the application. - void SetQuitOnClose(bool quit_on_close); - - // Return a RECT representing the bounds of the current client area. - RECT GetClientArea(); - - protected: - // Processes and route salient window messages for mouse handling, - // size change and DPI. Delegates handling of these to member overloads that - // inheriting classes can handle. - virtual LRESULT MessageHandler(HWND window, - UINT const message, - WPARAM const wparam, - LPARAM const lparam) noexcept; - - // Called when CreateAndShow is called, allowing subclass window-related - // setup. Subclasses should return false if setup fails. - virtual bool OnCreate(); - - // Called when Destroy is called. - virtual void OnDestroy(); - - private: - friend class WindowClassRegistrar; - - // OS callback called by message pump. Handles the WM_NCCREATE message which - // is passed when the non-client area is being created and enables automatic - // non-client DPI scaling so that the non-client area automatically - // responsponds to changes in DPI. All other messages are handled by - // MessageHandler. - static LRESULT CALLBACK WndProc(HWND const window, - UINT const message, - WPARAM const wparam, - LPARAM const lparam) noexcept; - - // Retrieves a class instance pointer for |window| - static Win32Window* GetThisFromHandle(HWND const window) noexcept; - - bool quit_on_close_ = false; - - // window handle for top level window. - HWND window_handle_ = nullptr; - - // window handle for hosted content. - HWND child_content_ = nullptr; -}; - -#endif // RUNNER_WIN32_WINDOW_H_