Skip to content

Commit

Permalink
Typo Corrections and Markdown Standardization
Browse files Browse the repository at this point in the history
  • Loading branch information
lucasrpatten committed Feb 14, 2023
1 parent 1ad187e commit 61e5366
Show file tree
Hide file tree
Showing 18 changed files with 118 additions and 120 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.vscode
6 changes: 3 additions & 3 deletions clients/build-yourself-contribution-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,9 @@ Building yourself will cause you to lose the ability to insert GIFs from your ke

1. Install NuGet package manager
2. Go to Visual Studio Installer -> Modify Build Tools -> Individual Components and install the latest Windows 10 SDK
3. Run the following commands:
3. Run the following commands:

```
```cmd
<stash content commit changes>
flutter clean
git reset
Expand Down Expand Up @@ -77,7 +77,7 @@ Make sure you've completed [#pre-requisites](build-yourself-contribution-guide.m
4. Make your changes
5. Run the app using `flutter run` or the green play button at the top of your IDE
6. Test your changes
7. Commit and PR!
7. Commit and PR!
Make sure you don't commit your changes to comment out `onContentCommit`.
Expand Down
6 changes: 3 additions & 3 deletions clients/desktop-app-installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Github Releases
Microsoft Store Download
{% endembed %}

### Standalone Executable
### Standalone Executable (Windows)

1. Download `bluebubbles_standalone.exe` from GitHub releases (linked above)
2. Run the installer
Expand All @@ -31,7 +31,7 @@ Microsoft Store Download
BlueBubbles on Flathub
{% endembed %}

### Standalone Executable
### Standalone Executable (Linux)

1. Download `bluebubbles_linux.zip` from GitHub Releases (linked above)
2. Unzip `bluebubbles_linux.zip`
Expand All @@ -48,6 +48,6 @@ Note: You might need to install the following dependencies:&#x20;

You can use the following command:

```
```bash
sudo apt-get -y install libnotify-dev vlc libvlc-dev appindicator3-0.1 libappindicator3-dev
```
6 changes: 3 additions & 3 deletions clients/dev/flutter/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ Check the sidebar for all the documentation! **(WIP)**

## Flutter "Review"

As mentioned in [#why-flutter](../../#why-flutter "mention"), we chose Flutter over building something in React Native, or in Java itself. When deciding our framework, we never had full cross platform in mind, and rather we were focusing on the ease of development. While native Android would definitely provide the best overall user experience, we decided to make a small tradeoff on this aspect to utilize Flutter's ease of use, scaleability, and quick turnaround times.
As mentioned in [#why-flutter](../../#why-flutter "mention"), we chose Flutter over building something in React Native, or in Java itself. When deciding our framework, we never had full cross platform in mind, and rather we were focusing on the ease of development. While native Android would definitely provide the best overall user experience, we decided to make a small tradeoff on this aspect to utilize Flutter's ease of use, scalability, and quick turnaround times.

### What We Love

By far and away, the best thing about Flutter has to be the ease of development. Flutter layouting and UI is ridiculously easy to understand, and creating great UI is a simple task. We also really like Dart syntax, it makes code very readable and has a lot of great features to make coding easier.
By far and away, the best thing about Flutter has to be the ease of development. Flutter layout design and UI is ridiculously easy to understand, and creating great UI is a simple task. We also really like Dart syntax, it makes code very readable and has a lot of great features to make coding easier.

Pub has been a great package repo - There are so many high quality packages available to drop into your project and eliminate the need for a ton of boilerplate code. We use everything from small UI packages to larger state / framework / dependency mangement packages.
Pub has been a great package repo - There are so many high quality packages available to drop into your project and eliminate the need for a ton of boilerplate code. We use everything from small UI packages to larger state / framework / dependency management packages.

There is definitely much more to like, but it isn't important to list all that here.

Expand Down
4 changes: 2 additions & 2 deletions clients/dev/flutter/objectbox.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ description: >-

## Intro

Initially, our app used the [`sqflite` ](https://pub.dev/packages/sqflite)package as our database (i.e. SQLite). The iMessage database on macOS is an SQLite database, so it made the most sense for our app to emulate the same structure (which it did, we copied the CREATE statements for each table and used them to build our own internal database).
Initially, our app used the [`sqflite`](https://pub.dev/packages/sqflite) package as our database (i.e. SQLite). The iMessage database on macOS is an SQLite database, so it made the most sense for our app to emulate the same structure (which it did, we copied the CREATE statements for each table and used them to build our own internal database).

This worked well for the most part, but we hit a major roadblock when we decided to port our app to desktop platforms using Flutter and the [`sqflite_common_ffi`](https://pub.dev/packages/sqflite\_common\_ffi) package - The speeds decreased dramatically. A simple DB call could take upwards of 5-10 seconds, and this was causing significant delay for actions like loading chats, message threads, etc which should normally take up to 1 second.

As a result, we decided to look into alternative databases. We landed on two potential ones: [`sqlite3` ](https://pub.dev/packages/sqlite3)and [`objectbox`](https://pub.dev/packages/objectbox). We first tried `sqlite3` to avoid a huge migration of code, but it was the same issue - speeds were too slow on desktop. Then, we moved to `objectbox`. The speed issue was resolved, but we discovered a whole host of other issues that required some hacky workarounds and advanced Dart coding to resolve, and this page will discuss that in depth.
As a result, we decided to look into alternative databases. We landed on two potential ones: [`sqlite3`](https://pub.dev/packages/sqlite3) and [`objectbox`](https://pub.dev/packages/objectbox). We first tried `sqlite3` to avoid a huge migration of code, but it was the same issue - speeds were too slow on desktop. Then, we moved to `objectbox`. The speed issue was resolved, but we discovered a whole host of other issues that required some hacky workarounds and advanced Dart coding to resolve, and this page will discuss that in depth.

## Web Support

Expand Down
4 changes: 1 addition & 3 deletions home/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@ description: Landing page for our documentation

# BlueBubbles Documentation

![](.gitbook/assets/image.png)


![BlueBubbles On Phone and Desktop](.gitbook/assets/image.png)

Hey there, and welcome to the BlueBubbles documentation! This will provide links to the main documentation, as well as quick links to popular BlueBubbles guides.

Expand Down
1 change: 0 additions & 1 deletion private-api/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,3 @@ The bundle supports both Intel and Apple Silicon Macs.
{% hint style="warning" %}
Apple Silicon currently requires using beta MacForge, which can be found [here.](https://github.com/MacEnhance/appcast/raw/master/Beta/MacForge/MacForge.1.2.0B1.zip)&#x20;
{% endhint %}

14 changes: 7 additions & 7 deletions private-api/building-and-contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@ You do not need to pay the $100 fee for the Apple Developer account. As soon as
3. Once inside Xcode, make sure you are signed into your Apple Developer account.
4. Open the `BlueBubblesHelper` target window inside Xcode, and navigate to the signing tab. Set the Team dropdown to the result that comes up with your Apple ID.

![](<.gitbook/assets/image (1).png>)
![BlueBubblesHelper](<.gitbook/assets/image (1).png>)

1. Now, you are ready to build. Just hit the play button, and the built bundle file will automatically install in MacForge. The iMessage app will quit and re-open to synchronize the changes.

## Contributing

Hey there, and welcome! We are always eager to have new contributors working on our projects. First and foremost, we recommend joining our [Discord ](https://discord.gg/sccHbCgh)as that is the best place you can get in touch with the main developers to discuss new features, ideas, or changes you're planning to make. Now, on to the guide...
Hey there, and welcome! We are always eager to have new contributors working on our projects. First and foremost, we recommend joining our [Discord](https://discord.gg/sccHbCgh) as that is the best place you can get in touch with the main developers to discuss new features, ideas, or changes you're planning to make. Now, on to the guide...

{% hint style="warning" %}
The Helper Bundle is quite challenging to get a hang of. The reason for this is because none of the internal iMessage Framework methods are commented or documented in any way. The only reasonable method of development is to make educated guesses and brute-force until you find something that works.
Expand All @@ -57,18 +57,18 @@ The Helper Bundle development is filled with some jargon that might appear confu
### Contribution Resources

1. [Tweak Development Wiki](https://iphonedev.wiki/index.php/Main\_Page) - if you are new to reverse engineering, this may be a helpful resource.
2. [w0lfschild macOS Headers ](https://github.com/w0lfschild/macOS\_headers)- pre-dumped headers for macOS Big Sur and up **only**. If you are developing for Catalina and under, you will need to dump headers on your own machine, using the next tool.
3. [Steve Nygard class-dump ](http://stevenygard.com/projects/class-dump/)- macOS 10 only, [freedomtan classdump-dyld ](https://github.com/freedomtan/classdump-dyld/)- macOS 11 only.
2. [w0lfschild macOS Headers](https://github.com/w0lfschild/macOS\_headers) - pre-dumped headers for macOS Big Sur and up **only**. If you are developing for Catalina and under, you will need to dump headers on your own machine, using the next tool.
3. [Steve Nygard class-dump](http://stevenygard.com/projects/class-dump/) - macOS 10 only, [freedomtan classdump-dyld](https://github.com/freedomtan/classdump-dyld/) - macOS 11 only.

Currently there is no classdump tool that we know of which works on macOS Monterey. However, all Big Sur header files should work fine on Monterey machines.
4. [dyld\_shared\_cache\_util](https://lapcatsoftware.com/articles/bigsur.html) - open-source tool from Apple that also dumps headers on macOS 11. This has not been tested by any developers as of yet, but may be a good alternative to freedomtan's classdump-dyld fork.
5. [ZKSwizzle ](https://github.com/alexzielenski/ZKSwizzle)- this tool is already built into the bundle. You can use it to "intercept" Objective-C method calls and see what arguments are passed to them.
5. [ZKSwizzle](https://github.com/alexzielenski/ZKSwizzle) - this tool is already built into the bundle. You can use it to "intercept" Objective-C method calls and see what arguments are passed to them.

### Development Process

The following will attempt to outline how our development process runs from start to finish when adding a new feature to the bundle.

1. Is the feature reasonable to implement and can we get it to work cross-platform with all clients? Will we be able to send the required data to the bundle from the server app?
1. Is the feature reasonable to implement and can we get it to work cross-platform with all clients? Will we be able to send the required data to the bundle from the server app?

This step is important to ask yourself. Ultimately the bundle is meant to be a companion to the server and clients, since it can't be used as a standalone app. We have to make sure the feature is reasonable in scope and can actually be implemented on clients.

Expand All @@ -80,7 +80,7 @@ The following will attempt to outline how our development process runs from star
4. Keep testing until you've got code that works!
3. By this point, you should have working code for your feature. Congrats! The next step is to make sure your code is clean, safe from exceptions, typed properly with correct arguments, and can send correctly-formatted data back to the server, when applicable. We encourage that you comment your code as well.
4. You probably only developed the integration inside the folder for your macOS version, whether that be `10` or `11+`. If the iMessage feature is not version-specific, we also need to add your code to the other folder's `BlueBubblesHelper.m` file. You have 2 options:
1. Make a VM on your macOS device following the guide for the OS you need: [Big Sur ](https://travellingtechguy.blog/macos-big-sur-on-vmware-fusion-12/)or [Catalina](https://travellingtechguy.blog/vmware-dep/). We highly recommend using a burner Apple ID on these VMs just in case Apple has a bad mood when you make the VM.
1. Make a VM on your macOS device following the guide for the OS you need: [Big Sur](https://travellingtechguy.blog/macos-big-sur-on-vmware-fusion-12/) or [Catalina](https://travellingtechguy.blog/vmware-dep/). We highly recommend using a burner Apple ID on these VMs just in case Apple has a bad mood when you make the VM.
2. Reach out to a main developer (Tanay has a Catalina and Monterey VM on his Big Sur Mac), and they can add / test your code on the other macOS folder.
5. Make a PR :)

Expand Down
18 changes: 14 additions & 4 deletions private-api/imcore-documentation.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Chat objects are defined as `IMChat`, and we access these via a lookup by `guid`
To do this, you'll want to add the `IMChatRegistry.h` header into your project.

```objectivec
// Retreive a IMChat instance from a given guid
// Retrieve a IMChat instance from a given guid
//
// Uses the chat registry to get an existing instance of a chat based on the chat guid
+(IMChat *) getChat: (NSString *) guid {
Expand Down Expand Up @@ -264,6 +264,7 @@ This is an asynchronous process in IMCore, so it requires the use of a completio

{% tabs %}
{% tab title="macOS 10 (no replies)" %}

```objectivec
// now we will deserialize the attributedBody if it exists
NSDictionary *attributedDict = data[@"attributedBody"];
Expand Down Expand Up @@ -304,9 +305,11 @@ void (^createMessage)(NSAttributedString*, NSAttributedString*, NSString*, NSStr

createMessage(attributedString, subjectAttributedString, effectId, nil);
```
{% endtab %}
{% tab title="macOS 11+ (replies)" %}
```objectivec
// now we will deserialize the attributedBody if it exists
NSDictionary *attributedDict = data[@"attributedBody"];
Expand Down Expand Up @@ -374,6 +377,7 @@ if (data[@"selectedMessageGuid"] != [NSNull null] && [data[@"selectedMessageGuid
createMessage(attributedString, subjectAttributedString, effectId, nil);
}`
```

{% endtab %}
{% endtabs %}

Expand Down Expand Up @@ -445,6 +449,7 @@ This function simply converts text based reaction types to their integer counter

{% tabs %}
{% tab title="macOS 10" %}

```objectivec
//Map the reaction type
long long reactionLong = [BlueBubblesHelper parseReactionType:(data[@"reactionType"])];
Expand Down Expand Up @@ -476,6 +481,7 @@ long long reactionLong = [BlueBubblesHelper parseReactionType:(data[@"reactionTy
}
}];
```
{% endtab %}
{% tab title="macOS 11+" %}
Expand Down Expand Up @@ -567,6 +573,7 @@ long long reactionLong = [BlueBubblesHelper parseReactionType:(data[@"reactionTy
### Editing a Message
{% code lineNumbers="true" %}
```objectivec
// get the chat
IMChat *chat = [BlueBubblesHelper getChat: data[@"chatGuid"] :transaction];
Expand All @@ -577,9 +584,10 @@ IMChat *chat = [BlueBubblesHelper getChat: data[@"chatGuid"] :transaction];
NSMutableAttributedString *bcString = [[NSMutableAttributedString alloc] initWithString: data[@"backwardsCompatibilityMessage"]];
NSInteger index = data["@partIndex"];
// send the edit
[chat editMessage:(message) atPartIndex:(index) withNewPartText:(editedString) backwardCompatabilityText:(bcString)];
[chat editMessage:(message) atPartIndex:(index) withNewPartText:(editedString) backwardCompatibilityText:(bcString)];
}];
```

{% endcode %}

This one is fairly easy. The only tricky part is the part index, which corresponds to which part of a message is being edited. Sometimes, a message can be stacked as so:
Expand All @@ -595,12 +603,13 @@ The part index tells IMCore which part of the message is actually being edited,
### Unsending a Message

{% code lineNumbers="true" %}

```objectivec
// get the chat
IMChat *chat = [BlueBubblesHelper getChat: data[@"chatGuid"] :transaction];
// get the message
[BlueBubblesHelper getMessageItem:(chat) :(data[@"messageGuid"]) completionBlock:^(IMMessage *message) {
// find the message item corresponsing to the part index
// find the message item corresponding to the part index
IMMessageItem *messageItem = (IMMessageItem *)message._imMessageItem;
NSObject *items = messageItem._newChatItems;
IMMessagePartChatItem *item;
Expand All @@ -619,11 +628,12 @@ IMChat *chat = [BlueBubblesHelper getChat: data[@"chatGuid"] :transaction];
[chat retractMessagePart:(item)];
}];
```
{% endcode %}
As with editing a message, the part index is crucial to know which part has been unsent and then use the `IMMessagePartChatItem` in the method correctly.
## Currently Known Issues
1. Sometimes, the `IMMessagePartChatItem` will not exist. This is almost always for messages that are old. If this happens, tapbacks won't work, and replies will have a weird bug where they attach to an "empty" message. See this [ticket](https://github.com/BlueBubblesApp/bluebubbles-helper/issues/11) for more details.
2. The reaction function currently doesn't support reacting to a message with multiple parts, for example a message with multiple attachments. This is likely also to do with `IMMessagePartChatItem` but we haven't figured it out quite yet. See this [ticket ](https://github.com/BlueBubblesApp/bluebubbles-helper/issues/8)for more details.
2. The reaction function currently doesn't support reacting to a message with multiple parts, for example a message with multiple attachments. This is likely also to do with `IMMessagePartChatItem` but we haven't figured it out quite yet. See this [ticket](https://github.com/BlueBubblesApp/bluebubbles-helper/issues/8) for more details.
Loading

0 comments on commit 61e5366

Please sign in to comment.