DBDigital / nookapps

Automatically exported from code.google.com/p/nookapps Please note I am not a developer. I only created this to prevent the code from being lost with the shutdown of GoogleCode. If you wish to work on this, contact me and I will add you. :)
0 stars 0 forks source link

Problem updating applications from the Nookdevs feed in Trook #27

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
I previously used Trook to download and install an updated version of 
nookLibrary (0.0.5).  Today, I used Trook (build 53) to download and 
install nookLibrary 0.0.6.  The install completed successfully.  However, 
when I ran nookLibrary afterwards, it was still at 0.0.5.  I tried again 
with the same results.  Looking at the "my packages\Unknown" folder, there 
were multiple nookLibrary .apk files as well as .apk files for other apps 
I have updated in the past.  I deleted the "Unknown" folder along with all 
of its .apk files, tried updating to 0.0.6 again with Trook, and it 
worked.  I am thinking that my previous attempts had, for some reason, 
resulted in Trook using an old 0.0.5 .apk file in the "my packages" folder 
instead of the 0.0.6 one it had just downloaded.

Original issue reported on code.google.com by jmc...@gmail.com on 13 Mar 2010 at 10:22

GoogleCodeExporter commented 8 years ago
This happened again when I tried to update to nookLibrary 0.0.7.  Looking at 
the "my 
packages\Unknown" folder (which I had deleted to upgrade to 0.0.6), 
the "nookLibrary.apk" is 0.0.6.  The 0.0.7 version I downloaded was saved 
as "1_nookLibrary.apk."  It appears that Trook tries to install using the 
original 
filename ("nookLibrary.apk"), which results in the cached version of 0.0.6 
getting 
installed instead of 0.0.7.  The workaround is to install using the new .apk 
using 
the filemanager app.

Original comment by jmc...@gmail.com on 15 Mar 2010 at 11:58

GoogleCodeExporter commented 8 years ago
The problem lies with this code in DowloadService.java:
         // Finally, if we have something that can view our 
         // content -- launch it! 

         Log.d(TAG, "Finished downloading"); 

         File targetfile = makeFileFromTarget(target); 

         Intent msg = new Intent(Intent.ACTION_VIEW); 
         msg.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); 
         msg.setDataAndType(Uri.fromFile(targetfile), mime); 

The target filename is not necessarily the filename that is ultimately used due 
to 
the fact that the "prepareTarget" function prepends a "#_" to the target 
filename if 
the target already exists.  Seems to me that, rather than opening a new file 
handle 
to launch a just-downloaded file, this part of the code could just use the 
existing 
out file handle that was created immediately after the download.

Also, I would like for Trook to prompt the user to choose whether to 
overwrite/rename/cancel the download when the filename already exists--similar 
to 
how Windows does it.

Original comment by jmc...@gmail.com on 7 Apr 2010 at 12:00

GoogleCodeExporter commented 8 years ago
kbsriram, good to see a new build after a well-deserved break!  Have you looked 
into 
this one yet?

Original comment by jmc...@gmail.com on 3 May 2010 at 4:10

GoogleCodeExporter commented 8 years ago
Ah, this is goofy :-) thanks for the heads-up. I'll add it to the bug-fix list.

Original comment by kbsriram on 3 May 2010 at 10:52