-
Notifications
You must be signed in to change notification settings - Fork 37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixed loading of native functions if pfp is contained in ZIP file #19
base: master
Are you sure you want to change the base?
Conversation
Hrmm, perhaps this would work? https://docs.python.org/2/library/zipimport.html I haven't used this myself, but from the docs it seems that if you add a |
Loading PFP as a whole from a ZIP works fine however iterating a folder inside the ZIP with methods working on directories doesn't work. It's only about loading the native functions. |
Sigh, I don't know why this never got merged. Are you still working on Synalysis @synalysis ? |
Yes, every pfp improvement is appreciated! |
This is quite an old PR, which is totally my fault. @synalysis here are my thoughts:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Address the few comments, then if the tests pass, you're good!
@@ -0,0 +1,876 @@ | |||
|
|||
###### AndroidManifestTemplate.bt ###### |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's make a new issue to follow up on these older known issues. I'd still like to document them and make sure we eventually clear them out. I.e. remove the known_issues.md and make a github issue with its contents.
pythonfiles = [] | ||
|
||
mydir = os.path.dirname(__file__) | ||
if '.zip' in mydir: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't this be if mydir.endswith('.zip')
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's different than .endswith() because the zip file can be one among many directories in the path and is not necessarily the last one.
@@ -1212,6 +1229,22 @@ def _handle_metadata(self, node, scope, ctxt, stream): | |||
#char blah[60] <packer=Zip, packtype=DataType>; | |||
#int checksum <watch=field1,field2,field3, update=Crc32>; | |||
|
|||
def _handle_format_metadata(self, node, scope, ctxt, stream): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good!
After trying to distribute PFP in a ZIP file I noticed that the native functions (BigEndian...) don't work anymore.
This pull request enables loading of the native files within a ZIP file.