mvdan / fdroidcl

F-Droid desktop client
BSD 3-Clause "New" or "Revised" License
269 stars 22 forks source link

App is reported to be up to date while an update is available #2

Closed relan closed 8 years ago

relan commented 8 years ago

I have a local repository with the following configuration:

    {
        "id":      "binary",
        "url":     "http://localhost/fdroid/repo",
        "enabled": true
    }

I generate index using this command (fdroidserver from today's master, c2270f8):

fdroid update --create-metadata

The repo contains official build of GNU IceCat 38.6.0, while on my device (Nexus 4, Android 5.1.1) there is 38.5.2. Both APKs are signed with the same key.

What happens:

$ fdroidcl update
Downloading https://f-droid.org/repo/index.jar... not modified
Downloading https://f-droid.org/archive/index.jar... not modified
Downloading http://localhost/fdroid/repo/index.jar... done
$ fdroidcl upgrade org.gnu.icecat
2016/02/13 09:59:22 org.gnu.icecat is up to date

What was expected: fdroidcl should upgrade org.gnu.icecat.

Android F-Droid client 0.98 correctly detects availability of an update.

Excerpt from index.xml in ~/.config/fdroidcl/binary.jar:

<application id="org.gnu.icecat">
  <id>org.gnu.icecat</id>
  <added>2016-02-13</added>
  <lastupdated>2016-02-13</lastupdated>
  <name>IceCatMobile</name>
  <summary>IceCatMobile</summary>
  <icon>org.gnu.icecat.2016020332.png</icon>
  <desc>
    <p>IceCatMobile</p>
  </desc>
  <license>Unknown</license>
  <categories>None</categories>
  <category>None</category>
  <web/>
  <source/>
  <tracker/>
  <marketversion/>
  <marketvercode>0</marketvercode>
  <package>
    <version>38.6.0</version>
    <versioncode>2016020332</versioncode>
    <apkname>icecatmobile-38.6.0.en-US.android-arm.apk</apkname>
    <hash type="sha256">e18ef4192c88245235784a4c17971c7aeab3c3f6e157a50ed8f75433e0b1634d</hash>
    <sig>bccec4a591f0b61ed5cb283a4553e654</sig>
    <size>37245301</size>
    <sdkver>11</sdkver>
    <added>2016-02-13</added>
    <permissions>WRITE_SETTINGS,ACCESS_NETWORK_STATE,com.android.launcher.permission.UNINSTALL_SHORTCUT,READ_EXTERNAL_STORAGE,USE_CREDENTIALS,VIBRATE,READ_SYNC_SETTINGS,RECORD_AUDIO,CHANGE_WIFI_STATE,com.android.launcher.permission.INSTALL_SHORTCUT,org.gnu.icecat_fxaccount.permission.PER_ACCOUNT_TYPE,org.gnu.icecat_sync.permission.PER_ACCOUNT_TYPE,CAMERA,RECEIVE_BOOT_COMPLETED,com.android.browser.permission.READ_HISTORY_BOOKMARKS,org.gnu.icecat.permissions.BROWSER_PROVIDER,MANAGE_ACCOUNTS,org.gnu.icecat.permissions.PASSWORD_PROVIDER,NFC,WRITE_SYNC_SETTINGS,WAKE_LOCK,READ_SYNC_STATS,GET_ACCOUNTS,INTERNET,DOWNLOAD_WITHOUT_NOTIFICATION,AUTHENTICATE_ACCOUNTS,WRITE_EXTERNAL_STORAGE,ACCESS_WIFI_STATE,org.gnu.icecat.permissions.FORMHISTORY_PROVIDER,org.gnu.icecat.permission.PER_ANDROID_PACKAGE,ACCESS_FINE_LOCATION</permissions>
    <nativecode>armeabi-v7a</nativecode>
  </package>
</application>
relan commented 8 years ago

Looks like fdroidcl simply takes marketvercode from the index.xml and compares it to the version code of the installed app. Not sure whether this behavior is right or wrong, but it's obviously different from that of Android F-Droid client. This behavior is inconvenient because it makes me edit Current Version Code in the metadata after every APK update to make fdroidcl recognize the update.

mvdan commented 8 years ago

Well, it definitely isn't wrong. It may be incomplete though. Did you not set your Current Version Code, or did you set it to zero? If you do, the Android client will use the highest version available.

fdroidcl should do that as well. I'll run some tests with this.

mvdan commented 8 years ago

Okay yes, the index snippet you posted there shows exactly that.

relan commented 8 years ago

The metadata was generated by fdroidserver:

Categories:None
License:Unknown
Web Site:
Source Code:
Issue Tracker:

Summary:IceCatMobile
Description:
IceCatMobile
.

Auto Update Mode:None
Update Check Mode:None

After I added

Current Version:38.6.0
Current Version Code:2016020332

the update was found and installed.

relan commented 8 years ago

I can confirm that now it works just as I want. Thanks!