Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sync with Anki iOS app #63

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions AnkiServer/apps/sync_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ def meta(self, cv=None):

# Some insanity added in Anki 2.0.13
if (client == 'ankidroid' and version_int[0] >=2 and version_int[1] >= 3) \
or (client == 'ankimobile') \
or (client == 'ankidesktop' and version_int[0] >= 2 and version_int[1] >= 0 and version_int[2] >= 13):
return {
'scm': self.col.scm,
Expand Down
8 changes: 8 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,14 @@ As of AnkiDroid 2.6 the sync server can be changed in the settings:
At the moment, there isn't any way to get the Anki iOS app to point at
your personal sync server. 😕

But it is possible to sync iOS app with your server by playing a "MITM" attack, don't try to play in this way if you are not an experienced expert:

1. Generate a self-signed CA, import it to your iOS device (warning: this may break the original CA security system, keep your CA key carefuly)
2. Sign a cert with -subj "/CN=sync.ankiweb.net", config your apache/nginx server to proxy anki-sync-server with this cert
3. Change your router's config (hosts), point sync.ankiweb.net to your server
4. Then you should be able to sync with your personal sync server! But it will only be usable under your own wifi, or you can setup a VPN as a workaround
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Editing /etc/hosts on a jailbroken device might work as well, that way it would be per-device, not per-network. Note that I can't test if it actually works, since I don't have an iOS device.

Copy link
Author

@GarrisonBaird GarrisonBaird Mar 5, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Theoretically this will work too, this is the best way to implement on the jailbroken device. I don't have the environment to test it ether :(
But there still are some ways to implement on the non-jailbroken device: with new NetworkExtension in iOS 9.
With some custom VPN apps using NE (like Potatso, those apps are actually developped for Chinese to bypass thier firewall...), it is possible to define DNS server and/or hosts on non-jailbroken devices and keep network traffic go through as is.
I personally play in this way, it's very tricky though...... :)

5. Currently it still has some problems in media sync with iOS app, you can disable media sync in settings, import your decks with media in other ways, then sync with your server

Running with Supervisor
-----------------------

Expand Down