.pak files and STAMP tool

763 views
Skip to first unread message

Davis Ford

unread,
Aug 9, 2013, 2:34:40 PM8/9/13
to chromi...@chromium.org
Hi, I just had two quick questions on the Chromium build environment (may be specific to Android build):

Where can I find out more information about a .pak file (are there tools to extract the contents)?

I see part of the build process running a STAMP tool -- but I'm also having trouble finding additional information about this tool.  Can someone point me to a reference on what it is / does, etc?

Robert Flack

unread,
Aug 9, 2013, 2:40:59 PM8/9/13
to davi...@gmail.com, chromi...@chromium.org
Hi Davis,

Extracting pak files has come up a few times. See this discussion here https://groups.google.com/a/chromium.org/forum/#!searchin/chromium-dev/pak/chromium-dev/YzWbU5fwNgI/Xr3YyGywBfEJ where I posted code references for the format and a rudimentary tool which can extract resources.

The resources in the pak file only have id's though, you'd be better off getting them from the src tree as Nico suggests.

Cheers,
Rob
--
--
Chromium Developers mailing list: chromi...@chromium.org
View archives, change email options, or unsubscribe:
http://groups.google.com/a/chromium.org/group/chromium-dev
 
 

Tony Chang

unread,
Aug 9, 2013, 2:48:52 PM8/9/13
to davi...@gmail.com, Chromium-dev
Are you using make or ninja to build?  There's no stamp tool, stamp files are used by make or ninja to know when certain build actions are complete and up to date.  These are added to the build files at gyp times.


Davis Ford

unread,
Aug 9, 2013, 3:03:19 PM8/9/13
to chromi...@chromium.org
Thanks Rob, 

That's very helpful.  One follow-up question re: pak files.  I understand they are packed resources used by Chromium.  I'm hacking around with ContentShell right now, and I'm wondering if I can put that shared object in a central location that could be loaded by multiple .apk applications.  It seems that this is not a problem in Android itself, but I'm wondering how Chromium would resolve the needed .pak files or if that would be a problem.

To summarize, I'm wondering if I could have something like the following structure:

/data/foobar/libcontent_shell_view.so
/data/foobar/content_shell.pak

And have two separate .apk apps that each load libcontent_shell_view.so -- so they can each use the content_shell_view without having to package it inside the .apk itself...same with the .pak file.  How does Chromium resolve the .pak file(s) it needs, exactly -- in Android, is it always expected to be in the local .apk's assets/ folder?

Thanks!

Davis Ford

unread,
Aug 9, 2013, 3:04:41 PM8/9/13
to Chromium-dev
Thanks Tony,

I am using ninja.  I understand now they are used to timestamp build actions.  Didn't see any reference to this in the ninja docs, so I was wondering what it was doing.

Newton Allen

unread,
Aug 9, 2013, 4:54:06 PM8/9/13
to davi...@gmail.com, chromi...@chromium.org
On Fri, Aug 9, 2013 at 12:03 PM, Davis Ford <davi...@gmail.com> wrote:
Thanks Rob, 

That's very helpful.  One follow-up question re: pak files.  I understand they are packed resources used by Chromium.  I'm hacking around with ContentShell right now, and I'm wondering if I can put that shared object in a central location that could be loaded by multiple .apk applications.  It seems that this is not a problem in Android itself, but I'm wondering how Chromium would resolve the needed .pak files or if that would be a problem.

To summarize, I'm wondering if I could have something like the following structure:

/data/foobar/libcontent_shell_view.so
/data/foobar/content_shell.pak

And have two separate .apk apps that each load libcontent_shell_view.so -- so they can each use the content_shell_view without having to package it inside the .apk itself...same with the .pak file.  How does Chromium resolve the .pak file(s) it needs, exactly -- in Android, is it always expected to be in the local .apk's assets/ folder?

It seems perfectly possible to share the same pak file between multiple apks. Here are some places to look at to get started:

ResourceExtractor.java extracts the pak files from the APK, resource_bundle_android.cc shows an example of loading the pak files at runtime, and look for "repack_content_shell_pack" in content_shell.gypi to see how paks are copied into the asset folder at build time for bundling up with the APK.
Reply all
Reply to author
Forward
0 new messages