webOS Nation Forums >  Stuff for your webOS Device >  webOS Apps & Games > Saving NDrive?
Saving NDrive?
  Reply
Like Tree5Likes
  • 3 Post By TheOneill
  • 1 Post By TheOneill
  • 1 Post By Proximity

 
Thread Tools Display Modes
Old 09/09/2012, 07:57 PM   #1 (permalink)
Member
 
PreJim's Avatar
 
Posts: 348
Is there any way I can save the maps and all if I ever want to change Veers?

Thanks
__________________
WebOS the best kept secret out there!

Using the Veer on AT&T and loving it.
PreJim is offline   Reply With Quote
Old 09/20/2012, 04:43 AM   #2 (permalink)
Member
 
Posts: 67
Hi,

To backup the app :

Everything is in the cryptofs dir, even the big map files and the licence file which is used at each start of the app to xcheck with your device ID.

You can backup simply using WOSQI to access the shell onthe device, and enter this to copy everything on the USB partition : cp -r /media/cryptofs/apps/usr/palm/applications/com.ndrive.palmbeta012/ /media/internal

Then, open the usb partition (using your device as USB drive) and copy paste the com.ndrive.palmbeta012 dir to your desktop. There are several things in that dir, NDrive binaries and dependencies, maps, licence, and a bunch of SQLite DB used to store your parameters and nav history. The most important things are the maps (in maps subdir) and licence file (in data subdir) called ndri4.ndr.

A safe backup contains :
- The BETA 6 ipkg
- the maps subdir with all your maps in it
- ndri4.ndr

As an option you can keep all the other files contained in the com.ndrive.palmbeta012 dir to keep your history.

Do not forget to store your device id (nduid), in case your device fails, it will be useful to switch device and keep on using the maps.

- To transfer from one device to another one :


I had a to switch from one Veer to another one as the first one has its magnetic connector fully dead and was very disappointed of my dialog with HP and NDrive though I didn't expect a lot they were not even able to do that : I just wanted them to transfer my licence from one device to another one, the only thing they propose, is to offer an android licence (wow).

Therefore I had to investigate to try and activate the map on another devide. Everything was done using NDrive BETA 6 (the one still avail in Palm BETA catalog). It turns out that the licence manager does not identify using HP Catalog account as I had expected, not your IMEI, but just the nduid (device unique ID) which is a bright idea. HP clearly encourages dev to use it this way :

Your application should not use the device ID to uniquely identify a given user. Because devices may be bought, sold, exchanged, or even serviced in a way that results in a user's device ID changing or being transferred to another user, user data and preferences should never be saved and restored on the basis of the device ID; you should implement your own account management system for this purpose.

Impostah allows to override it using a patch, unfortunately, the override is bypass by PDK apps because they rely directly on PDL_GetUniqueID function of the PDL library which gets the nduid at very low level referring to /proc/nduid. The idea is to fake the nduid at low level so that the key NDrive uses to identify the device is modified. To do that, you have to patch libpdl.so directy which is a binary file in which /proc/nduid appears in clear. You can therefore change it to another path (provided is is exactly 11 char long) containing the patched nduid. Then it becomes a bit tricky because you have to create the file containing the patched nduid and transfer et to NDrive jail.

Here is what I have done :

1 - patching usr/lib/libpdl.so to replace /proc/nduid by /etc/nduid2 (for instance using WOSQI to get the file, then np++ to patch in hex mode then WOSQI again to put it back on the device) don't forget to keep a bakcup of the file.
2 - on a device shell, I created the new nduid with echo 'yournduidhere' > /etc/nduid2
3 - still on the shell, copy it to the Jail : cp /etc/nduid2 /var/palm/jail/com.ndrive.palmbeta012/etc/nduid2

For step 3 just above, note that NDrive must have been launched at least once so that the jail exists.

Then launch NDrive and check in the about section : the nduid (what you see in red) should be patched.

Of course, as other app may refer to libpdl, the big drawback of this method is that all the other apps are affected. It was not a problem for me but depending on the apps you use it maybe.

[11/24/2012 UPDATE for 2.2.4]

In WebOS 2.2.4, it seems that the jail is erased and recreated at each WebOS restart so we have to find a way to patch /etc/nduid2 in the Jail at each WebOS startup. I propose the following method : Create the following script and put it in /etc/event.d/ dir :

Code:
# the following line allows to start only when WebOS boot is over
start on stopped finish

script
    mkdir -p /var/palm/jail/com.ndrive.palmbeta012/etc/
    echo 'yournduidhere' > /var/palm/jail/com.ndrive.palmbeta012/etc/nduid2
end script
There is another advantage of using this method, it allows to set the patched nduid specifically for ndrive : you can keep the original nduid for all other stuff on your phone. You can even set a specific nduid for any other app running on the phone using the same trick.

Good luck !

Lionel

Last edited by TheOneill; 11/24/2012 at 03:55 PM. Reason: missing one step
TheOneill is offline   Reply With Quote
Liked by sshaka, Proximity and jonathandiazs like this.
Old 11/27/2012, 10:28 PM   #3 (permalink)
Member
 
Posts: 1
Quote:
Originally Posted by TheOneill View Post
Hi,

To backup the app :

Everything is in the cryptofs dir, even the big map files and the licence file which is used at each start of the app to xcheck with your device ID.

You can backup simply using WOSQI to access the shell onthe device, and enter this to copy everything on the USB partition : cp -r /media/cryptofs/apps/usr/palm/applications/com.ndrive.palmbeta012/ /media/internal

Then, open the usb partition (using your device as USB drive) and copy paste the com.ndrive.palmbeta012 dir to your desktop. There are several things in that dir, NDrive binaries and dependencies, maps, licence, and a bunch of SQLite DB used to store your parameters and nav history. The most important things are the maps (in maps subdir) and licence file (in data subdir) called ndri4.ndr.

A safe backup contains :
- The BETA 6 ipkg
- the maps subdir with all your maps in it
- ndri4.ndr

As an option you can keep all the other files contained in the com.ndrive.palmbeta012 dir to keep your history.

Do not forget to store your device id (nduid), in case your device fails, it will be useful to switch device and keep on using the maps.

- To transfer from one device to another one :


I had a to switch from one Veer to another one as the first one has its magnetic connector fully dead and was very disappointed of my dialog with HP and NDrive though I didn't expect a lot they were not even able to do that : I just wanted them to transfer my licence from one device to another one, the only thing they propose, is to offer an android licence (wow).

Therefore I had to investigate to try and activate the map on another devide. Everything was done using NDrive BETA 6 (the one still avail in Palm BETA catalog). It turns out that the licence manager does not identify using HP Catalog account as I had expected, not your IMEI, but just the nduid (device unique ID) which is a bright idea. HP clearly encourages dev to use it this way :

Your application should not use the device ID to uniquely identify a given user. Because devices may be bought, sold, exchanged, or even serviced in a way that results in a user's device ID changing or being transferred to another user, user data and preferences should never be saved and restored on the basis of the device ID; you should implement your own account management system for this purpose.

Impostah allows to override it using a patch, unfortunately, the override is bypass by PDK apps because they rely directly on PDL_GetUniqueID function of the PDL library which gets the nduid at very low level referring to /proc/nduid. The idea is to fake the nduid at low level so that the key NDrive uses to identify the device is modified. To do that, you have to patch libpdl.so directy which is a binary file in which /proc/nduid appears in clear. You can therefore change it to another path (provided is is exactly 11 char long) containing the patched nduid. Then it becomes a bit tricky because you have to create the file containing the patched nduid and transfer et to NDrive jail.

Here is what I have done :

1 - patching usr/lib/libpdl.so to replace /proc/nduid by /etc/nduid2 (for instance using WOSQI to get the file, then np++ to patch in hex mode then WOSQI again to put it back on the device) don't forget to keep a bakcup of the file.
2 - on a device shell, I created the new nduid with echo 'yournduidhere' > /etc/nduid2
3 - still on the shell, copy it to the Jail : cp /etc/nduid2 /var/palm/jail/com.ndrive.palmbeta012/etc/nduid2

For step 3 just above, note that NDrive must have been launched at least once so that the jail exists.

Then launch NDrive and check in the about section : the nduid (what you see in red) should be patched.

Of course, as other app may refer to libpdl, the big drawback of this method is that all the other apps are affected. It was not a problem for me but depending on the apps you use it maybe.

[11/24/2012 UPDATE for 2.2.4]

In WebOS 2.2.4, it seems that the jail is erased and recreated at each WebOS restart so we have to find a way to patch /etc/nduid2 in the Jail at each WebOS startup. I propose the following method : Create the following script and put it in /etc/event.d/ dir :

Code:
# the following line allows to start only when WebOS boot is over
start on stopped finish

script
    mkdir -p /var/palm/jail/com.ndrive.palmbeta012/etc/
    echo 'yournduidhere' > /var/palm/jail/com.ndrive.palmbeta012/etc/nduid2
end script
There is another advantage of using this method, it allows to set the patched nduid specifically for ndrive : you can keep the original nduid for all other stuff on your phone. You can even set a specific nduid for any other app running on the phone using the same trick.

Good luck !

Lionel
Thanks for the tutorial, I transferred all the files from my Veer and it works perfectly for my Pre plus but I have not been able to make work on my Pre 2. Yeah I love WebOs but hate the idea of buying the same app on 3 devices.

Can you explain how to create the script for WebOS 2.2.4
jonathandiazs is offline   Reply With Quote
Old 11/28/2012, 01:56 AM   #4 (permalink)
Member
 
Posts: 67
Have you got the "invalid id" dialog at ndrive startup ? If it is the case, there is something wrong with the script.

Try this :
- get notepad++ (or any text editor with linux/unix CR)
- create a new file, select "edit" / "convert carriage return" (i translate it from french, it may not be exactly that!) / "Convert to UNIX format (LF)".
- Copy/paste the little script I gave above (dashed lines are not necessary, just comments)
- set your ID as required
- save the file on your computer
- plug your Pre2 via USB, open webosquickinstall (I used 4.4.0)
- select "tools" / "send a file"
- drag and drop your scirpt on the window (or navigate for the file manually)
- in the destination field, write : "/etc/event.d/"

Being copied here, your script will be run at each system startup and will allow to force your phone ID (specifically for NDrive).

Concerning libpdl.so library patching, note that the file is different from one WebOS version to the other, you have to patch it specifically for your Pre 2. Having patched it, you will have to complement the script we created just above for any other app requiring nduid access through libpdl library (it only concerns PDK app).

Regards,

Lionel
TheOneill is offline   Reply With Quote
Liked by sshaka likes this.
Thanked By: sshaka
Old 05/13/2013, 04:29 PM   #5 (permalink)
Member
 
Posts: 88
Just a quick thank you for the instructions. I moved from a Veer to Pre3 and ndrive is now working for me.

A bit of learning was required using np++ in hex mode etc, but well worth it.

To clarify for anyone reading this thread, the script TheOneill added in his update replaces steps 2 and 3 in the 3 step process.

As was said, the most important thing is to have the files backed up from the old phone.

thanks again
ben
benh is offline   Reply With Quote
Thanked By: sshaka
Old 08/02/2013, 03:30 PM   #6 (permalink)
Member
 
sshaka's Avatar
 
Posts: 172
TheOneill: Where do I get the nduid of 11 characters for my NDrive app???
__________________
El Sendero del Samurai: Lealtad, Paz Interna, Paciencia y Meditar a los pies de Buda

Samsung Galaxy S4 + Jailbreak / HP TouchPad 4G + CM10 / iPod Touch 5 + Jailbreak 6.1.3
sshaka is offline   Reply With Quote
Old 08/03/2013, 10:59 AM   #7 (permalink)
Member
 
Proximity's Avatar
 
Posts: 40
sshaka open the nDrive app and tap on "MENU" > "My NDrive" > "Info" > "Version". Below the versionnumber is a alpha-numeric code (in red), thats the nduid and it differs between the devices. It is longer than 11 characters.

When patching the libpdl.so file, you need to replace the path to the nduid file (/proc/nduid <- 11 characters) with a path, where you can write a new nduid file containing the alpha-numeric code to.

-----------------------------------------------------
/proc/nduid <- you can't write in this file, but you can write a new file to:
/etc/nduid2 (<- 11 characters; the nduid2 file has the long alpha-numeric code in it without spaces)
Proximity is offline   Reply With Quote
Liked by sshaka likes this.
Thanked By: sshaka
Old 08/07/2013, 01:44 AM   #8 (permalink)
Member
 
sshaka's Avatar
 
Posts: 172
I got it!!!

Many thanks for your great help!!! Now NDrive in my new TouchPad 4G is running with the license that I've purchased for my Pre3!!!



MANY THANKS TO EVERYONE!!!
__________________
El Sendero del Samurai: Lealtad, Paz Interna, Paciencia y Meditar a los pies de Buda

Samsung Galaxy S4 + Jailbreak / HP TouchPad 4G + CM10 / iPod Touch 5 + Jailbreak 6.1.3
sshaka is offline   Reply With Quote
Old 08/09/2013, 12:31 AM   #9 (permalink)
Member
 
sshaka's Avatar
 
Posts: 172
In brief:

1.- Run the app at least one time

2.- Patch the /usr/lib/libpdl.so file (obtained through WOSQI) with Notepad ++ (I did it with the Windows default app) by substituting /proc/nduid by /etc/nduid2 and send that file through WOSQI to /usr/lib/

3.- Keep a copy of the original libpdl.so file!!!

4.- Make a file with the script that TheOneill wrote a couple of posts above (I attached that file --> nduid2) and send it to /etc/event.d/ via WOSQI. You need to write your NDrive id where 'yournduidhere' is written with the quotes!!! I did it with the Windows Notepad. To obtain the NDrive ID: Open the app and tap on "MENU" > "My NDrive" > "Info" > "Version". The version number is an alpha-numeric code (in red). That's the nduid and it differs between the devices. Its longer is 40 characters.

5.- Restart the device and you get it!!!
Attached Files
File Type: zip nduid2.zip (263 Bytes, 18 views) Email Attachment
__________________
El Sendero del Samurai: Lealtad, Paz Interna, Paciencia y Meditar a los pies de Buda

Samsung Galaxy S4 + Jailbreak / HP TouchPad 4G + CM10 / iPod Touch 5 + Jailbreak 6.1.3
sshaka is offline   Reply With Quote
Old 10/09/2013, 08:32 PM   #10 (permalink)
pivotCE Developer
 
Alan Morford's Avatar
 
Posts: 1,034
Quote:
Originally Posted by sshaka View Post
In brief:

1.- Run the app at least one time

2.- Patch the /usr/lib/libpdl.so file (obtained through WOSQI) with Notepad ++ (I did it with the Windows default app) by substituting /proc/nduid by /etc/nduid2 and send that file through WOSQI to /usr/lib/

3.- Keep a copy of the original libpdl.so file!!!

4.- Make a file with the script that TheOneill wrote a couple of posts above (I attached that file --> nduid2) and send it to /etc/event.d/ via WOSQI. You need to write your NDrive id where 'yournduidhere' is written with the quotes!!! I did it with the Windows Notepad. To obtain the NDrive ID: Open the app and tap on "MENU" > "My NDrive" > "Info" > "Version". The version number is an alpha-numeric code (in red). That's the nduid and it differs between the devices. Its longer is 40 characters.

5.- Restart the device and you get it!!!
I installed ndrive beta 11.3 from the forum using Internalz Pro and ran it once then closed it. I made a backup of libpdl.so and the edited a copy of it by loading it up in np++ in hex mode and searching for the unicode string nduid. I change it to say /etc/nduid2, saved it, and sent it to /usr/lib. I then downloaded your zip file and edited the 'yournduidhere' line to say '1234 1234 1234' (obviously with my nduid and not 1234 but you get the idea) Yes, those are spaces in between each set of 4 numbers (and of course letters). I then saved it and sent it to /etc/event.d/ and rebooted my phone. NDrive would not launch. I uninstalled it and tried to immediately reinstall it but it errored out. I restarted my phone and reinstalled ndrive. This time it reinstalled fine but still won't launch. I restarted my phone again but it won't launch. I might try removing the file from etc and see if that's the problem...dunno what I did. Help??
__________________
Follow me on Twitter
For the latest webOS news check out pivotCE
Alan Morford is offline   Reply With Quote
Old 10/09/2013, 08:46 PM   #11 (permalink)
Member
 
sshaka's Avatar
 
Posts: 172
Quote:
Originally Posted by Alan Morford View Post
I installed ndrive beta 11.3 from the forum using Internalz Pro and ran it once then closed it. I made a backup of libpdl.so and the edited a copy of it by loading it up in np++ in hex mode and searching for the unicode string nduid. I change it to say /etc/nduid2, saved it, and sent it to /usr/lib. I then downloaded your zip file and edited the 'yournduidhere' line to say '1234 1234 1234' (obviously with my nduid and not 1234 but you get the idea) Yes, those are spaces in between each set of 4 numbers (and of course letters). I then saved it and sent it to /etc/event.d/ and rebooted my phone. NDrive would not launch. I uninstalled it and tried to immediately reinstall it but it errored out. I restarted my phone and reinstalled ndrive. This time it reinstalled fine but still won't launch. I restarted my phone again but it won't launch. I might try removing the file from etc and see if that's the problem...dunno what I did. Help??
First: Are you sure that did you change the 11 letters "/proc/nduid" for the 11 letters "/etc/nduid2"???

Second: The serial number is conformed of 40 letters...did you already verified it?

I hope your answer!!!
__________________
El Sendero del Samurai: Lealtad, Paz Interna, Paciencia y Meditar a los pies de Buda

Samsung Galaxy S4 + Jailbreak / HP TouchPad 4G + CM10 / iPod Touch 5 + Jailbreak 6.1.3
sshaka is offline   Reply With Quote
Old 10/10/2013, 01:58 PM   #12 (permalink)
pivotCE Developer
 
Alan Morford's Avatar
 
Posts: 1,034
I checked my nduid and I missed a section. Then I forgot to delete the spaces. I deleted the spaces in between the 4 number sets and restarted but nDrive won't open. See the attachment of my libpdl.so in Notepad where I changed the line. Should I start over? I assume I would remove Ndrive, delete the nduid2 file, and delete the .so file from usr/lib and reinstall the original libpdl.so.
Attached Images
File Type: png libpdl.so screenshot.png (4.4 KB, 9 views) Email Attachment
__________________
Follow me on Twitter
For the latest webOS news check out pivotCE
Alan Morford is offline   Reply With Quote
Old 10/10/2013, 07:34 PM   #13 (permalink)
pivotCE Developer
 
Alan Morford's Avatar
 
Posts: 1,034
Well I replaced my original libpdl.so file and deleted the nduid2 file and uninstalled ndrive and restarted my phone. I then reinstalled ndrive beta 11.3 and ran it once. I closed it. I took the original libpdl.so file and opened it in windows stock notepad and searched for /proc. I found the line that says /proc/nduid and I renamed those characters to /etc/nduid2. I then transfered that filed to /usr/lib/ on my phone. I then took your zip file you have available and edited it for my nduid. The format for 'yournduidhere' I used '123412341234' with the 40 characters of my nduid. I then sent that nduid2 file to /etc/event.d/ on my phone and then restarted my phone. NDrive will not load. Help?
__________________
Follow me on Twitter
For the latest webOS news check out pivotCE
Alan Morford is offline   Reply With Quote
Old 10/10/2013, 08:13 PM   #14 (permalink)
Member
 
Proximity's Avatar
 
Posts: 40
The Problem lies within the stock notepad in windows. It doesn't write with linux line endings and converts the binary data to text, with informations getting lost.

Use Notepad++ or a HEX-Editor to edit the original (not already opened with the stock notepad!) libpdl.so file.

Have faith and good luck ;-)

-- Sent from my TouchPad using Communities
Proximity is offline   Reply With Quote
Old 10/10/2013, 08:43 PM   #15 (permalink)
pivotCE Developer
 
Alan Morford's Avatar
 
Posts: 1,034
I took the original file and opened it with n++, set eol to Unix, and edited the line. Copied it over to /usr/lib/ and rebooted. Ndrive won't open. Banging my head over here.

UPDATE: Got it working. I used Hex Editor Neo Free and changed the line with that. It's a lot easier than using n++ and getting the hex plugin (which I tried but it bombed...apparently). Thanks for all of the help!
__________________
Follow me on Twitter
For the latest webOS news check out pivotCE

Last edited by Alan Morford; 10/10/2013 at 08:56 PM. Reason: update
Alan Morford is offline   Reply With Quote
Reply

 

Thread Tools
Display Modes



 


Content Relevant URLs by vBSEO 3.6.0