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

How to find achievements.bin and profile.bin files back #308

Closed
Irving87 opened this issue Feb 3, 2024 · 10 comments
Closed

How to find achievements.bin and profile.bin files back #308

Irving87 opened this issue Feb 3, 2024 · 10 comments

Comments

@Irving87
Copy link

Irving87 commented Feb 3, 2024

Hello, I have been riding with zwift-offline for more than two months, I'm doing the 50,000 climb challenge and have completed over 30,000 climbs. Today I accidentally clicked "Download profile" and "Download achievements" button on the page of "Settings-Zwift credentials", and the achievements.bin& profile.bin file in the /storage/1 changed, And my zwift level became very low, and the climbing challenge progress was gone. So i want to ask how to find achievements.bin and profile.bin files back, or how to manually modify these two files
Thanks!

@fatsbrown
Copy link
Contributor

Hello. Unfortunately, if you don't have a backup, I don't think you can restore those files.

profile.bin can be easily modified with a script like this (run from zoffline repo folder)

import protobuf.profile_pb2
profile = protobuf.profile_pb2.PlayerProfile()
profile_file = 'storage/1/profile.bin'
with open(profile_file, 'rb') as f:
    profile.ParseFromString(f.read())
profile.total_xp = 500000
profile.total_distance_in_meters = 50000000
profile.elevation_gain_in_meters = 500000
profile.total_gold_drops = 50000000
with open(profile_file, 'wb') as f:
    f.write(profile.SerializeToString())

Make sure you select the Everest challenge before editing the profile, otherwise the added elevation_gain_in_meters will not count for the challenge.

achievements.bin is a bit more tricky because you need to know the IDs

achievements = protobuf.profile_pb2.Achievements()
achievements.achievements.add().id = 75
achievements.achievements.add().id = 78
achievements.achievements.add().id = 147
with open('storage/1/achievements.bin', 'wb') as f:
    f.write(achievements.SerializeToString())

You can find the IDs in https://cdn.zwift.com/gameassets/GameDictionary.xml

@Irving87
Copy link
Author

Irving87 commented Feb 3, 2024

t

Wow, this is really detailed, thank you very much. There are a few more questions I would like to ask:

  1. Are the levels and challenges in zwiftoffline unable to be synchronized to zwift online? Because I observed that the level in Companion app is not the same as the level in zwiftoffline;
  2. Is there no left and right balance data of the power meter in the fit file recorded by zwiftoffline? My riding platform has a left and right balance function, but today I synced it to Garmin and I didn’t see the left and right balance data;
  3. How to synchronize the screenshots in zwift to strava after each ride?

@fatsbrown
Copy link
Contributor

  1. No, offline profile is not synced to online server. It's doable (proof of concept in https://github.com/ursoft/zwift-offline/blob/master/storage/profile_sync.py) but it's not implemented in zoffline.
  2. zoffline just uploads the FIT data generated by ZwiftApp, so if it's not on Garmin, most likely it's not in the FIT.
  3. It's not possible due to Strava restriction (details in Support Zwift screenshots #28).

@Irving87
Copy link
Author

Irving87 commented Feb 3, 2024

  1. No, offline profile is not synced to online server. It's doable (proof of concept in https://github.com/ursoft/zwift-offline/blob/master/storage/profile_sync.py) but it's not implemented in zoffline.
  2. zoffline just uploads the FIT data generated by ZwiftApp, so if it's not on Garmin, most likely it's not in the FIT.
  3. It's not possible due to Strava restriction (details in Support Zwift screenshots #28).

“It's doable (proof of concept in https://github.com/ursoft/zwift-offline/blob/master/storage/profile_sync.py) but it's not implemented in zoffline.” ---So, if I run this "profile_sync.py" script, offline profile will sync to online server?

@fatsbrown
Copy link
Contributor

I have not tried it myself, but it's supposed to do it.

@Irving87
Copy link
Author

Irving87 commented Feb 4, 2024

, if I run this "profile_sync.py" script, offline profile will sync

Thanks, This is the best open source repositories I've ever seen

@Irving87 Irving87 closed this as completed Feb 4, 2024
@oldnapalm oldnapalm mentioned this issue Mar 31, 2024
@jricoclq
Copy link

jricoclq commented Apr 5, 2024

Hello. Unfortunately, if you don't have a backup, I don't think you can restore those files.

profile.bin can be easily modified with a script like this (run from zoffline repo folder)

import protobuf.profile_pb2
profile = protobuf.profile_pb2.PlayerProfile()
profile_file = 'storage/1/profile.bin'
with open(profile_file, 'rb') as f:
    profile.ParseFromString(f.read())
profile.total_xp = 500000
profile.total_distance_in_meters = 50000000
profile.elevation_gain_in_meters = 500000
profile.total_gold_drops = 50000000
with open(profile_file, 'wb') as f:
    f.write(profile.SerializeToString())

Make sure you select the Everest challenge before editing the profile, otherwise the added elevation_gain_in_meters will not count for the challenge.

achievements.bin is a bit more tricky because you need to know the IDs

achievements = protobuf.profile_pb2.Achievements()
achievements.achievements.add().id = 75
achievements.achievements.add().id = 78
achievements.achievements.add().id = 147
with open('storage/1/achievements.bin', 'wb') as f:
    f.write(achievements.SerializeToString())

You can find the IDs in https://cdn.zwift.com/gameassets/GameDictionary.xml

May I ask if I have changed my experience as instructed (to level 100, 591000XP), but the score in this area is still the same as the previous level. After cycling for a period of time, the level returns to its original level. How can I modify this area or make it so that it does not revert back to its original level? TKS
b4c07927a134c5893b7b8952726fa90

@fatsbrown
Copy link
Contributor

Check the file economy_config.txt in the storage/1 directory, it's customized for the active profile when it was created. You can delete it so that it will be re-created, customized for the current profile, or copy the file from the data directory if you want to use the default scheme regardless of the current profile XP and level.

@jricoclq
Copy link

jricoclq commented Apr 5, 2024

Check the file economy_config.txt in the storage/1 directory, it's customized for the active profile when it was created. You can delete it so that it will be re-created, customized for the current profile, or copy the file from the data directory if you want to use the default scheme regardless of the current profile XP and level.

I tried, but the score displayed above is still the value of the downloaded profile.bin . After riding a course, increasing the level will return to the original level. I found that the score section remains unchanged.Or how to update this score?

@fatsbrown
Copy link
Contributor

What do you mean with "score"?

There's "level" and "XP". You can't set only the level, you need to set also the matching XP.

For example, if you want to set level 70 using the default economy config (level 100 at 591000 XP)

profile.achievement_level = 7000
profile.total_xp = 296000

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants