Real Software Forums

The forum for Real Studio and other Real Software products.
[ REAL Software Website | Board Index ]
It is currently Tue Oct 23, 2018 12:50 pm
xojo

All times are UTC - 5 hours




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: APK Manager, Project Source and questions.
PostPosted: Mon Apr 23, 2012 10:07 am 
Offline

Joined: Sun Jul 31, 2011 11:30 pm
Posts: 31
Location: Iran
Hi,

I was trying for a long time to find a software to manage my .apk (Android Package) files, find duplicates and etc.
However i was not so lucky, so i thought why not to make it myself ? that shouldn't be so hard !

In very first step i failed, apk is simply a zip file, which App info are stored in AndroidManifest.xml, but its encrypted somehow.

so i used "aapt", a console app to get apk information.

So, i started to make this software, and it works actually.

Since I'm new to Real Studio and i want to learn more, I'm posting my project here.

so if someone looked into it and had comments on "How to do things right, and better" i would appreciate it :)
also, if someone found it useful (although it does not do something special !), and wanted to make it better, feel free to use it ;)

i have some questions also:

- Its a bit slow, i think its because it uses WinCMD through Shell object, but maybe i did something wrong and that's because its slow !

- I need to use a TreeView or Hierarchical ListBox to Show apps (Apps that have more than 1 version present on list, Sub-items are app version, so each App Label appears once in the list), and with checkbox, so user can select some apps (e.g. duplicate ones) and delete then for example, but i dont know how to make it work, because when a node is collapsed in ListBox, the checkboxes state will change to un-checked.

- its strange but when an app has non-english label (e.g. Persian or Chinese), the aapt tool will return strange characters, i also tried "chcp 1256" to change code-page, but no luck !

Thank you all,

If you have any Advices to be a Better programmer, I would appreciate it :)

Download Link: http://dl.majidonline.com/files/get/MGm ... anager.zip


Top
 Profile  
Reply with quote  
 Post subject: Re: APK Manager, Project Source and questions.
PostPosted: Mon Apr 23, 2012 3:17 pm 
Offline
User avatar

Joined: Sun Aug 12, 2007 10:10 am
Posts: 1086
Location: Boiling Springs, SC
How bout something like this? :-)

Source:
http://www.realstudiodevspot.com/demos/apkfinder.zip


I modified your code with a faster search method (Scans through 1000's of files every few seconds)...the only limiting factor is the aapt...so I modified the search to rapidly scan and only use aapt when it finds a valid apk file. See what you can do with the code :-)

_________________
Matthew A. Combatti
Real Studio 2012 r1.2

Visit Xojo Developer's Spot!
Systems I Use:
Windows XP/Windows Vista/Windows Server 2008 r2/Windows 7/Windows 8
Mac OSX 10.5/Mac OSX 10.6/Mac OSX Server/Ubuntu/Debian/Suse/Red Hat/
Windows Server 2011/CentOS 5.4 /ReactOS/SimOS

~All Xojo Compatible~


Top
 Profile  
Reply with quote  
 Post subject: Re: APK Manager, Project Source and questions.
PostPosted: Mon Apr 23, 2012 9:33 pm 
Offline

Joined: Sun Jul 31, 2011 11:30 pm
Posts: 31
Location: Iran
Thanks, I really appreciate it :)

What has changed to speed up the search proccess ?

because that class that i used (it was from RB Curriculum) checked all files in all directories, and if the extension is "apk" it will be added to an array.
in your search method i see the same concept, but meybe there is a trick to remove the unnecessary parts ?

and for checking extension, i prefer to use "NthField", because actually a file extension can be more than 3 letters (not necessarily last 3 letters)

in project that i posted, i first list all the apk files in an array
the the GetPackageInfo Method receives that array and processes all the apk files (Array Contains just the apk files)
and returns an array containing Application name, version and path.
I used the array so that i can filter apps with same name (Same version or not)

Actually my goal is to list all different Application in the listbox
then if an application has multiple versions, lower versions display as its sub-item In listBox or TreeView)

i learned better when i checked your file, it was first time i saw "Goto" in Real Studio :D

What does FastLoadFile and InStrRev Methods do ?

Thanks


Top
 Profile  
Reply with quote  
 Post subject: Re: APK Manager, Project Source and questions.
PostPosted: Mon Apr 23, 2012 10:32 pm 
Offline
User avatar

Joined: Sun Aug 12, 2007 10:10 am
Posts: 1086
Location: Boiling Springs, SC
Nevercom wrote:
Thanks, I really appreciate it :)

What has changed to speed up the search proccess ?

because that class that i used (it was from RB Curriculum) checked all files in all directories, and if the extension is "apk" it will be added to an array.
in your search method i see the same concept, but meybe there is a trick to remove the unnecessary parts ?

and for checking extension, i prefer to use "NthField", because actually a file extension can be more than 3 letters (not necessarily last 3 letters)

in project that i posted, i first list all the apk files in an array
the the GetPackageInfo Method receives that array and processes all the apk files (Array Contains just the apk files)
and returns an array containing Application name, version and path.
I used the array so that i can filter apps with same name (Same version or not)

Actually my goal is to list all different Application in the listbox
then if an application has multiple versions, lower versions display as its sub-item In listBox or TreeView)

i learned better when i checked your file, it was first time i saw "Goto" in Real Studio :D

What does FastLoadFile and InStrRev Methods do ?

Thanks


This was actually a stripped down version of an antivirus I wrote using RS... Fastloadfile was used in crc32 check sum to load the file as binary in chunks to check against heuristic definitions and instrrev is the same as instr but instead of starting from left to right, it goes from right to left. I left a few unnecessay parts of the av and removed their methods from the "scanning" code :-) this method of scanning skips the enumeration of files before scanning and enumerates as it scans :-) you can also use an extender for folderitems called extensiondt which only returns the extension (search forums for extensiondt).

_________________
Matthew A. Combatti
Real Studio 2012 r1.2

Visit Xojo Developer's Spot!
Systems I Use:
Windows XP/Windows Vista/Windows Server 2008 r2/Windows 7/Windows 8
Mac OSX 10.5/Mac OSX 10.6/Mac OSX Server/Ubuntu/Debian/Suse/Red Hat/
Windows Server 2011/CentOS 5.4 /ReactOS/SimOS

~All Xojo Compatible~


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC - 5 hours


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group