Introducing XDA:DevCon – A Conference For Developers By Developers
XDA Developers Android and Mobile Development Forum
Forgot your password?
 
Post Reply+
Tip us?
 
Bexton
Old
#21  
Bexton's Avatar
Recognized Contributor - OP
Thanks Meter 901
Posts: 591
Join Date: Sep 2011
Location: 50° 56' 33" 6° 57' 32"
Quote:
Originally Posted by XlAfbk View Post
I tried modding the extension but for some reason it even fails with localhost instead of this thread, just replacing the 1 line containing the url *confused* (not a chrome extension guy so probably missing something there. more of a web dev)
Maybe if you'd explain why that is and why it needs some site in the first place I'd be able to figure it out.
You need to change two files. The "match"-url for the content script in manifest.json, needs to match the url for the chrome.tabs.create call in main.js:

1.) manifest.json
Code:
"content_scripts": [
  {
    "matches": ["http://forum.xda-developers.com/showthread.php?t=1809458&download=apk*"],
    "js": ["download.js"]
  },
2.) main.js
Code:
executeRawHttpsQuery:function(c) {
  chrome.tabs.create({url:"http://forum.xda-developers.com/showthread.php?t=1809458&download=apk#" + c})
}};

Google/HTC Nexus One PVT ENG S-OFF - Android 4.2.2 / JDQ39 - Evervolv Perdo 3.2.0 - 2.6.38.8-evervolv-perdo-jellybean 8x50 - HBOOT-7.35.5117 (BlackRose) - Radio 5.12.00.08
Google/LG Nexus 4 - Android 4.2.2 / JDQ39 - Stock Android - 3.4.0-perf-g7ce11cd - MAKOZ10o - Radio 2.0.1700.48
Samsung Galaxy Tab 2 GT-P5110 - Android 4.1.2 / JZO54K - 3.0.31 - MAKOZ10o - Radio 2.0.1700.48
// My Threads | My GitHub | My Google+
 
XlAfbk
Old
#22  
XlAfbk's Avatar
Senior Member
Thanks Meter 234
Posts: 1,132
Join Date: Aug 2010
doh. I greped *.js only ...
hm, i see, a page needs to be opened because chrome extensions can only inject scripts into existing pages so to be able to call the function it needs a tab. will have to learn about chrome extensions to try to change that i guess.
Galaxy Nexus maguro & Nexus 10 manta, both on CM10.1 nightlies, stock kernel.
 
Bexton
Old
#23  
Bexton's Avatar
Recognized Contributor - OP
Thanks Meter 901
Posts: 591
Join Date: Sep 2011
Location: 50° 56' 33" 6° 57' 32"
Quote:
Originally Posted by XlAfbk View Post
doh. I greped *.js only ...
hm, i see, a page needs to be opened because chrome extensions can only inject scripts into existing pages so to be able to call the function it needs a tab. will have to learn about chrome extensions to try to change that i guess.
more exactly, the page doesn't need to exist. but you need any URL as a "trigger" to call the content script (eg download script). however, I just had an idea. It may be possible to reload the actual play store url and append the hash key to that URL. Let me check on that..

Google/HTC Nexus One PVT ENG S-OFF - Android 4.2.2 / JDQ39 - Evervolv Perdo 3.2.0 - 2.6.38.8-evervolv-perdo-jellybean 8x50 - HBOOT-7.35.5117 (BlackRose) - Radio 5.12.00.08
Google/LG Nexus 4 - Android 4.2.2 / JDQ39 - Stock Android - 3.4.0-perf-g7ce11cd - MAKOZ10o - Radio 2.0.1700.48
Samsung Galaxy Tab 2 GT-P5110 - Android 4.1.2 / JZO54K - 3.0.31 - MAKOZ10o - Radio 2.0.1700.48
// My Threads | My GitHub | My Google+
 
Bexton
Old
#24  
Bexton's Avatar
Recognized Contributor - OP
Thanks Meter 901
Posts: 591
Join Date: Sep 2011
Location: 50° 56' 33" 6° 57' 32"
Okay, it works! I will upload an updated version. Instead of open a new tab with this thread it will just reload the Play Store Url and start the download.

Google/HTC Nexus One PVT ENG S-OFF - Android 4.2.2 / JDQ39 - Evervolv Perdo 3.2.0 - 2.6.38.8-evervolv-perdo-jellybean 8x50 - HBOOT-7.35.5117 (BlackRose) - Radio 5.12.00.08
Google/LG Nexus 4 - Android 4.2.2 / JDQ39 - Stock Android - 3.4.0-perf-g7ce11cd - MAKOZ10o - Radio 2.0.1700.48
Samsung Galaxy Tab 2 GT-P5110 - Android 4.1.2 / JZO54K - 3.0.31 - MAKOZ10o - Radio 2.0.1700.48
// My Threads | My GitHub | My Google+
 
Bexton
Old
#25  
Bexton's Avatar
Recognized Contributor - OP
Thanks Meter 901
Posts: 591
Join Date: Sep 2011
Location: 50° 56' 33" 6° 57' 32"
APK Downloader 1.3.2

Changelog
This version will no longer open a new tab.
Instead, it will reload the Play Store Url within the same tab in which you clicked on the extension icon and start the download.
Attached Files
File Type: zip apkdownloader-bexmod-1.3.2.zip - [Click for QR Code] (42.7 KB, 828 views)

Google/HTC Nexus One PVT ENG S-OFF - Android 4.2.2 / JDQ39 - Evervolv Perdo 3.2.0 - 2.6.38.8-evervolv-perdo-jellybean 8x50 - HBOOT-7.35.5117 (BlackRose) - Radio 5.12.00.08
Google/LG Nexus 4 - Android 4.2.2 / JDQ39 - Stock Android - 3.4.0-perf-g7ce11cd - MAKOZ10o - Radio 2.0.1700.48
Samsung Galaxy Tab 2 GT-P5110 - Android 4.1.2 / JZO54K - 3.0.31 - MAKOZ10o - Radio 2.0.1700.48
// My Threads | My GitHub | My Google+
 
Felimenta97
Old
#26  
Felimenta97's Avatar
Senior Member
Thanks Meter 1452
Posts: 6,259
Join Date: Aug 2011
Location: Ribeirão Preto
Well, it doesn't work at all here. It quickly gives a sign the page is reloading but nothing changes, and there is only a small white box below the APK downloader icon...

 
Bexton
Old
#27  
Bexton's Avatar
Recognized Contributor - OP
Thanks Meter 901
Posts: 591
Join Date: Sep 2011
Location: 50° 56' 33" 6° 57' 32"
Quote:
Originally Posted by Felimenta97 View Post
Well, it doesn't work at all here. It quickly gives a sign the page is reloading but nothing changes, and there is only a small white box below the APK downloader icon...
Okay, sorry for the mess. But that's when you working with somebody else's code. I re-wrote the extension a clean way and reduced the number of files from 16 to 12. Everything should work now as expected with the 1.3.2 release.

Means: By clicking on the page action icon (the market case), the current page in your browser will reload the same URL (+ &download=apk#SOMEHASHKEY) and start the download.

I've tested it with about 20 apks and it worked out without any issues. But please leave some feedback to ensure it is working for "all" chrome versions.

Google/HTC Nexus One PVT ENG S-OFF - Android 4.2.2 / JDQ39 - Evervolv Perdo 3.2.0 - 2.6.38.8-evervolv-perdo-jellybean 8x50 - HBOOT-7.35.5117 (BlackRose) - Radio 5.12.00.08
Google/LG Nexus 4 - Android 4.2.2 / JDQ39 - Stock Android - 3.4.0-perf-g7ce11cd - MAKOZ10o - Radio 2.0.1700.48
Samsung Galaxy Tab 2 GT-P5110 - Android 4.1.2 / JZO54K - 3.0.31 - MAKOZ10o - Radio 2.0.1700.48
// My Threads | My GitHub | My Google+
 
Bexton
Old
#28  
Bexton's Avatar
Recognized Contributor - OP
Thanks Meter 901
Posts: 591
Join Date: Sep 2011
Location: 50° 56' 33" 6° 57' 32"
APK Downloader 1.3.3

Changelog
* Fixed redirect bug (introduced in 1.3.2)
* Major code clean up
Attached Files
File Type: zip apkdownloader-bexmod-1.3.3.zip - [Click for QR Code] (43.1 KB, 832 views)

Google/HTC Nexus One PVT ENG S-OFF - Android 4.2.2 / JDQ39 - Evervolv Perdo 3.2.0 - 2.6.38.8-evervolv-perdo-jellybean 8x50 - HBOOT-7.35.5117 (BlackRose) - Radio 5.12.00.08
Google/LG Nexus 4 - Android 4.2.2 / JDQ39 - Stock Android - 3.4.0-perf-g7ce11cd - MAKOZ10o - Radio 2.0.1700.48
Samsung Galaxy Tab 2 GT-P5110 - Android 4.1.2 / JZO54K - 3.0.31 - MAKOZ10o - Radio 2.0.1700.48
// My Threads | My GitHub | My Google+
 
Felimenta97
Old
#29  
Felimenta97's Avatar
Senior Member
Thanks Meter 1452
Posts: 6,259
Join Date: Aug 2011
Location: Ribeirão Preto
I will try tomorrow night (it's night now, so a little less than 24 hours from now)

Sent from my LT26i with Tapatalk 2

 
ytain
Old
#30  
Junior Member
Thanks Meter 5
Posts: 25
Join Date: Feb 2011
Still doesn't work for me, it doesn't download anything even for those I can get via market in Android on my tablet.

 
Post Reply+
Tags
apk downloader
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Go to top of page...