Skip to content

Instantly share code, notes, and snippets.

@dnicolson
Last active September 20, 2023 17:35
Show Gist options
  • Save dnicolson/73c9f7359db9f61b3621a1e4918aa136 to your computer and use it in GitHub Desktop.
Save dnicolson/73c9f7359db9f61b3621a1e4918aa136 to your computer and use it in GitHub Desktop.

Signing in to Feedly with Reeder 4 on iOS

Reeder 4 works with Feedly but only if the account is already authenticated, it seems unlikely Reeder 4 will see an update to fix this. It is possible to copy the authentication from another session and add it manually to the Keychain. There are options with and without a jailbreak.

Get Feedly Authentication

The authentication can be obtained from the macOS Keychain or an iOS backup.

Option 1: macOS Keychain

  1. Download Reeder 5 for macOS

  2. Sign in to Feedly

  3. Dump Keychain:

    security dump-keychain -d login.keychain

    It should include something like this:

    keychain: "/Users/dave/Library/Keychains/login.keychain-db"
    version: 512
    class: "genp"
    attributes:
        0x00000007 <blob>="com.reederapp.Feedly"
        0x00000008 <blob>=<NULL>
        "acct"<blob>="<account>"
        "cdat"<timedate>=0x32303231313033303135323432315A00  "20211030152421Z\000"
        "crtr"<uint32>=<NULL>
        "cusi"<sint32>=<NULL>
        "desc"<blob>=<NULL>
        "gena"<blob>=<NULL>
        "icmt"<blob>=<NULL>
        "invi"<sint32>=<NULL>
        "mdat"<timedate>=0x32303231313033303135323432315A00  "20211030152421Z\000"
        "nega"<sint32>=<NULL>
        "prot"<blob>=<NULL>
        "scrp"<sint32>=<NULL>
        "svce"<blob>="com.reederapp.Feedly"
        "type"<uint32>=<NULL>
    data:
    "{"consumerSecret":"","oauthTokenExpiresAt":657905061.65287197,"oauthRefreshToken":"<oauthRefreshToken>:reeder4","oauthToken":"<oauthToken>:reeder4","version":2,"consumerKey":"","oauthTokenSecret":"","oauthVerifier":""}"
    

Option 2: iOS Backup

  1. Backup iOS device

  2. Install a fork of iOS Backup Extraction:

    go install github.com/dnicolson/ios/cmd/irestore@master

  3. Run irestore <device> dumpkeys out.json

  4. The object with com.reederapp.Feedly as the value for svce will contain the base 64 encoded data for the v_Data key

Add Feedly Account

With an Unencrypted Backup

  1. Backup iOS device

  2. Open Manifest.db in the backup which can be found in ~/Library/Application Support/MobileSync/Backup and run the following query:

    SELECT fileID FROM "Files" where relativePath = 'Documents/users.json'

  3. The fileID represents the users.json file in the backup, add the following to the JSON array:

    {
        "username": "<email>",
        "id": "Feedly\/<account>",
        "serviceId": "Feedly",
        "extId": "<account>",
        "title": "Feedly",
        "sharingOnly": false
    }
    
  4. Restore iOS device with modified backup

With an Encrypted Backup

  1. Backup iOS device

  2. In iMazing copy the document from this path to the Finder: Apps > Reeder > Documents > users.json

  3. Edit users.json by adding the following to the JSON array:

    {
        "username": "<email>",
        "id": "Feedly\/<account>",
        "serviceId": "Feedly",
        "extId": "<account>",
        "title": "Feedly",
        "sharingOnly": false
    }
    
  4. Copy users.json back into iMazing replacing the original file

  5. Restore iOS device with modified backup

Add Keychain Item

Option 1: Modifying a Backup

  1. Add a new account to Reeder on an iOS device (in this case Pocket)

  2. Use iMazing to create a backup

  3. Copy the backup from ~/Library/Application Support/iMazing/Backups to ~/Library/Application Support/MobileSync/Backup/

  4. Run irestore <device> dumpkeys keys.json

  5. Edit keys.json replacing the svce and v_Data keys with Feedly Pocket equivalents

  6. Run irestore <device> encryptkeys keys.json keys.plist

  7. In iMazing copy the document from this path to the Finder: File System > KeychainDomain > keychain-backup.plist

  8. Copy the v_Data block from keys.plist to keychain-backup.plist where the v_PersistentRef value matches the _ref value in the original com.reederapp.Pocket object

  9. Copy keychain-backup.plist back into iMazing replacing the original file

  10. Sync backup

Option 2: Theos

  1. Jailbreak iOS 12.5.5 device with Checkra1n

  2. Install Theos https://github.com/theos/theos/wiki/Installation-macOS

  3. Create new Theos instance:

    $THEOS/bin/nic.pl

    Choose iphone/tool_swift

    Enter KeychainAdd as the project name

    cd keychainadd

  4. Add the following to the entitlements.plist file:

    <key>keychain-access-groups</key>
    <array>
        <string>66JC38RDUD.com.reederapp</string>
    </array>
  5. Add the following to the main.swift file:

    import Foundation
    
    let auth = "{\"consumerSecret\":\"\",\"oauthTokenExpiresAt\":657905061.65287197,\"oauthRefreshToken\":\"<oauthRefreshToken>:reeder4\",\"oauthToken\":\"oauthToken:reeder4\",\"version\":2,\"consumerKey\":\"\",\"oauthTokenSecret\":\"\",\"oauthVerifier\":\"\"}".data(using: .utf8)!
    
    let attributes: [String: Any] = [
        kSecClass as String: kSecClassGenericPassword,
        kSecAttrAccessGroup as String: "66JC38RDUD.com.reederapp",
        kSecAttrAccount as String: "<account>",
        kSecAttrService as String: "com.reederapp.Feedly",
        kSecAttrAccessible as String: kSecAttrAccessibleAfterFirstUnlock,
        kSecValueData as String: auth
    ]
    
    var result: CFTypeRef?
    let status = SecItemAdd(attributes as CFDictionary, &result)
    if status == errSecSuccess {
        print("Feedly authentication added to Keychain.")
    } else {
        print("Error:", status)
    }
  6. Run make

  7. Copy binary to device:

    scp .theos/obj/debug/KeychainAdd root@<ip>:/KeychainAdd

  8. Run /KeychainAdd on the device

  9. Optionally remove the binary with rm /KeychainAdd

Option 3: keychaineditor (iOS 13.5+)

  1. Jailbreak iOS 13.5 device with Unc0ver or Checkra1n

  2. Add https://miro92.com/repo/ to Cydia sources

  3. Install Keychain Editor (arm64) 2.5.1

  4. Add 66JC38RDUD.com.reederapp entitlement:

    scp root@<ip>:/usr/local/bin/keychaineditor keychaineditor
    ldid -e keychaineditor > ent.xml
    plutil -insert keychain-access-groups.0 -string 66JC38RDUD.com.reederapp ent.xml
    ldid -Sent.xml keychaineditor
    scp keychaineditor root@<ip>:/usr/local/bin/keychaineditor
    
  5. Add Keychain item on the device:

    keychaineditor -a --account <account> --service com.reederapp.Feedly --agroup 66JC38RDUD.com.reederapp --data <base64 encoded data>
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment