1

I am trying to import contacts from micro-SD to (non Android) Nokia phone. So I first exported current contacts on micro-SD card in hope that i will be able to modify the exported file and then import it.

Exported file type is Nokia backup file .NBF. it seem it is actually an ordinary zip file.

I can unzip exported .NBF file and modify it (contacts are stored in .vcf - vcard).

However when I zip it and try to import it the phone says file is corrupted.

 

i checked zip files with zipinfo:

Unmodified file:

$ zipinfo Backup001.NBF
Archive:  Backup001.NBF
Zip file size: 3031 bytes, number of entries: 10
-rw-a--     0.0 fat     1160 b- stor 20-Mar-30 11:31 predefhiddenfolder/predefisasettings/usersettings/user_settings.wbxml
dr-x-hs     0.0 fat        0 b- stor 10-Jan-01 00:00 predefhiddenfolder/predefisasettings/usersettings
dr-xahs     0.0 fat        0 b- stor 07-Jan-01 00:00 predefhiddenfolder/predefisasettings
dr-xahs     0.0 fat        0 b- stor 07-Jan-01 00:00 predefhiddenfolder
-rw-a--     0.0 fat      214 b- defN 20-Mar-30 11:31 predefhiddenfolder/backup/WIP/F01
drwxa--     0.0 fat        0 b- defN 20-Mar-30 11:31 predefhiddenfolder/backup/WIP
drwxa--     0.0 fat        0 b- defN 10-Jan-01 00:00 predefhiddenfolder/backup
-rw-a--     0.0 fat      256 b- defN 20-Mar-30 11:31 predefhiddenfolder/backup/WIP/32/contacts/1.vcf
drwxa--     0.0 fat        0 b- defN 20-Mar-30 11:31 predefhiddenfolder/backup/WIP/32/contacts
drwxa--     0.0 fat        0 b- defN 20-Mar-30 11:31 predefhiddenfolder/backup/WIP/32
10 files, 1630 bytes uncompressed, 1409 bytes compressed:  13.6%

then i modify 1.vcf and update Backup001.NBF with:

zip Backup001.NBF -f -r predefhiddenfolder/backup/WIP/32/contacts/1.vcf

Modified:

$ zipinfo Backup001.NBF
Archive:  Backup001.NBF
Zip file size: 2958 bytes, number of entries: 10
-rw-a--     0.0 fat     1160 b- stor 20-Mar-30 11:31 predefhiddenfolder/predefisasettings/usersettings/user_settings.wbxml
dr-x-hs     0.0 fat        0 b- stor 10-Jan-01 00:00 predefhiddenfolder/predefisasettings/usersettings
dr-xahs     0.0 fat        0 b- stor 07-Jan-01 00:00 predefhiddenfolder/predefisasettings
dr-xahs     0.0 fat        0 b- stor 07-Jan-01 00:00 predefhiddenfolder
-rw-a--     0.0 fat      214 b- defN 20-Mar-30 11:31 predefhiddenfolder/backup/WIP/F01
drwxa--     0.0 fat        0 b- defN 20-Mar-30 11:31 predefhiddenfolder/backup/WIP
drwxa--     0.0 fat        0 b- defN 10-Jan-01 00:00 predefhiddenfolder/backup
-rw-r--r--  3.0 unx      208 tx defN 20-Apr-03 01:04 predefhiddenfolder/backup/WIP/32/contacts/1.vcf
drwxa--     0.0 fat        0 b- defN 20-Mar-30 11:31 predefhiddenfolder/backup/WIP/32/contacts
drwxa--     0.0 fat        0 b- defN 20-Mar-30 11:31 predefhiddenfolder/backup/WIP/32
10 files, 1582 bytes uncompressed, 1366 bytes compressed:  13.7%

in this line: -rw-r--r-- 3.0 unx 208 tx defN 20-Apr-03 01:04 predefhiddenfolder/backup/WIP/32/contacts/1.vcf it says that format is 3.0 unx.

is there any way to zip it so format will be 0.0 fat?

 

Edit: added some clarification

Edit: I tried using -k flag as sugessted by @FennecTECH

it looks better but still doesn't work.

$ zipinfo Backup000.NBF
Archive:  Backup000.NBF
Zip file size: 2501 bytes, number of entries: 10
drwx---     2.0 fat        0 bx stor 20-Apr-03 00:37 PREDEFHI/
drwx---     2.0 fat        0 bx stor 20-Apr-03 00:36 PREDEFHI/PREDEFIS/
drwx---     2.0 fat        0 bx stor 20-Apr-03 00:36 PREDEFHI/PREDEFIS/USERSETT/
-rw----     2.0 fat     1160 bx defN 20-Mar-30 11:31 PREDEFHI/PREDEFIS/USERSETT/USER_SET.WBX
drwx---     2.0 fat        0 bx stor 20-Apr-03 00:37 PREDEFHI/BACKUP/
drwx---     2.0 fat        0 bx stor 20-Apr-03 00:37 PREDEFHI/BACKUP/WIP/
drwx---     2.0 fat        0 bx stor 20-Apr-03 00:37 PREDEFHI/BACKUP/WIP/32/
drwx---     2.0 fat        0 bx stor 20-Apr-03 01:04 PREDEFHI/BACKUP/WIP/32/CONTACTS/
-rw----     2.0 fat      208 tx defN 20-Apr-03 01:04 PREDEFHI/BACKUP/WIP/32/CONTACTS/1.VCF
-rw----     2.0 fat      214 bx defN 20-Mar-30 11:31 PREDEFHI/BACKUP/WIP/F01

similar question that didn't solve the problem: https://stackoverflow.com/questions/15033646/compression-method-for-xlsx-with-7z

2
  • Hi. I'm not sure this question is about Linux. Nokia phones are not Linux systems, as far as I am aware. Perhaps try on Superuser Stack Exchange?
    – Time4Tea
    Apr 3, 2020 at 1:55
  • But the zip tool the OP uses is a Unix tool. It is a question about zip usage, AFAIU Apr 5, 2020 at 15:08

4 Answers 4

1

You can do this with Go:

package main
import (
   "archive/zip"
   "io"
   "os"
)
const creatorFAT = 0
func main() {
   // in
   file, _ := os.Open("in.txt")
   info, _ := file.Stat()
   head, _ := zip.FileInfoHeader(info)
   // default is Unix
   head.CreatorVersion = creatorFAT
   // out
   zipfile, _ := os.Create("out.zip")
   archive := zip.NewWriter(zipfile)
   // write
   writer, _ := archive.CreateHeader(head)
   io.Copy(writer, file)
   archive.Close()
}

Result:

$ zipinfo out.zip
Archive:  out.zip
Zip file size: 151 bytes, number of entries: 1
-rw-rw-rw-  2.0 fat        7 bX stor 20-Apr-02 19:54 in.txt
1 file, 7 bytes uncompressed, 7 bytes compressed:  0.0%
0

You’ll need to unzip the folder. Then re zip it with the -k option This will get you 2.0 fat. I don't know if this will work but its worth a try. You will need to do it with the command line.

0

I think the problem is with the user_settings.wbxml file Certain things are supposed to be updated there, probably according to the size of the file or the number of contacts

0

Let me present my powerful tool that does this automagically https://github.com/pas-calc/nokia-contacts

You might adjust this script to your needs. For python related, you shall stick to from zipfile import ZipFile.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .