Lost my project file but it still works, where is the code?

656 views
Skip to first unread message

Chris Sefton

unread,
Mar 7, 2021, 7:44:52 AM3/7/21
to DroidScript
Hi, 

I created a small project and have been using it on my phone as a DroidScript desktop shortcut.

Droidscript did an update and I lost my project from the list when you open up droid script. I only have Hello World there. My project is completely gone.
However, the shortcut is still on my phones desktop and is still working. I have searched my phone inside and out and am unable to find any file that relates to my original code. Where could it be or is it gone for good? How is it still working if it is no longer anywhere to be found?

It does not exist in the DroidScript folder. 
Is an app created (and used as a desktop shortcut in droidscript) still accessible so I can get my code back?

Please help!

Chris

Dave

unread,
Mar 8, 2021, 6:21:23 AM3/8/21
to DroidScript
This is probably due to the new 'Scoped Storage' rules in Android 10/11.  If you uninstalled DS at any point then it will be subject to 'Scoped Storage' rules.


Here is a statement that I previously made about it:-

 Due to Android 10/11s 'scoped storage' we now write your DS project files to the Android app data folders if we can't get access to the general Internal storage. Any paths that start with /sdcard/ will 
 also be mapped.  You usually find these files under the Android/Data/com.smartphoneremote.androidscriptfree/files  folder on android file browsers.  

You can simply copy your apps from the /sdcard/DroidScript folder to the Android/Data/com.smartphoneremote.androidscriptfree/files folder and continue working as normal.  Just be a aware that your users will probably have scoped storage too, so don't rely on writing to the /sdcard/ folder anymore.  You can check for scoped storage by using the new app.IsScoped() method.






Alan Hendry

unread,
Mar 8, 2021, 11:30:28 AM3/8/21
to DroidScript
Chris,
The APKBuilder takes your source code and builds an APK, 
if you install it then it is added into the Android system 
(the shortcut runs your app from inside the Android system)
so your shortcut still works even if your source code is gone.
As Dave said your source code would normally be in Internal > Droidscript > your-project-name.
If it's not there then if you didn't specify obfuscate at build time it is *possible* to extract it from your APK.
Your APK should be in Internal >  DroidScript > APKs.
Bit late for you now, but I would recommend everyone backing up their source code on a regular basis
(on the DS Home Page, long-touch on your project icon, touch Share SPK, touch Gmail, it will be attached to a draft email).
Regards, ah

Chris Sefton

unread,
Mar 10, 2021, 5:13:59 AM3/10/21
to DroidScript
Thanks Dave. All files were in the folder you had mentioned.
/storage/emulated/0/Android/data/com.smartphoneremote.androidscriptfree

I have moved them /storage/DroidScript
and they now show up and work as they did.

Thanks for the file location, you've saved me from having to re-write everything.

Cheers!
Reply all
Reply to author
Forward
0 new messages