SimpleMobileTools / Simple-Notes

A simple textfield for adding quick notes without ads.
https://www.simplemobiletools.com
GNU General Public License v3.0
828 stars 273 forks source link

backup file schema #717

Closed andrew-karppinen closed 2 months ago

andrew-karppinen commented 3 months ago

The schema of the backup .json file has apparently changed at some point(?), and the old format is not compatible with the current version. Here is a Python script that can be used to convert the old backup file to the current format

import json

def transform_dict_list(dict_list):
    transformed_list = []

    for original_dict in dict_list:
        new_dict = {
            "path": "",
            "protectionHash": "",
            "protectionType": -1,
            "title": original_dict.get("title", ""),
            "type": 0,
            "value": original_dict.get("value", "")
        }
        transformed_list.append(new_dict)

    return transformed_list

def read_json_file(file_path):
    with open(file_path, 'r', encoding='utf-8') as file:
        data = json.load(file)
    return data

def save_dict_list_to_json(dict_list, file_path):
    with open(file_path, 'w', encoding='utf-8') as file:
        json.dump(dict_list, file, ensure_ascii=False, indent=4)

if __name__ == "__main__":

    file_path = 'old_backup.json' #old backup file path

    data = read_json_file(file_path) #read file to dict

    transformated_data =  transform_dict_list(data) #transformate data to new json schema

    save_dict_list_to_json(transformated_data,"backup.json") #save data to .json file
Maxitendo1 commented 3 months ago

@andrew-karppinen SimpleMobileTools apps were sold to ad and spyware company. Fork is here:

https://github.com/FossifyOrg

nxh12 commented 2 months ago

@andrew-karppinen SimpleMobileTools apps were sold to ad and spyware company. Fork is here:

https://github.com/FossifyOrg

请问这个啥情况啊

Maxitendo1 commented 2 months ago

@andrew-karppinen SimpleMobileTools apps were sold to ad and spyware company. Fork is here:

https://github.com/FossifyOrg

请问这个啥情况啊

@andrew-karppinen @nxh12 是的,你没听错。下面是更多相关信息:

https://github.com/SimpleMobileTools/General-Discussion/issues/241

andrew-karppinen commented 2 months ago

yep this seems better: https://github.com/FossifyOrg

nxh12 commented 2 months ago

yep this seems better: https://github.com/FossifyOrg

Thanks

nxh12 commented 2 months ago

yep this seems better: https://github.com/FossifyOrg

Hello, I really want to make a pure version of social software. It will not be bloated and will only bring convenience to everyone. It will not be as turbid as the existing social dating software on the market. It will be clean and pure, making it easier for people to find friends. People experience the essential happiness of social interaction. However, my abilities are limited, so I would like to ask if everyone has the same idea and work together to create an open source social software. Since this workload is huge and it is open source, can we develop and design a timed self-destruct mode for social posts? I think the essence of social networking on the Internet lies in zero contact and emotional feelings. You can find people who have the same ideas as you, or chat for a few words, which makes you happy, but it does not necessarily mean that you will become friends. Indeed, this approach has never been done before on the market. Of course, this is just one of the features of this software. I'm looking forward to receiving your reply, because I really hope that such a software will be born.