Resource package name is not necessarily the same as app package name - Xposed General

I'd like to report a possible bug. I searched the forums and it doesn't seem like anyone else has reported this yet but I apologize in advance if this is a repost.
When the handleInitPackageResources(InitPackageResourcesParam) method is called, I assume that resparam.res.getPackageName() should return the package name of the resources being loaded. However, this does not seem to work as expected. Let's take for example the Googe Hangouts app.
The Hangouts app has the application package name "com.google.android.talk". However, the package name of the resources is "com.google.android.apps.babel" and not "com.google.android.talk". This can be verified by doing the following:
Code:
aapt dump badging [path_to_hangouts_apk]
At the head of the output, you should notice package: name='com.google.android.talk' . This is the application package name. Now try:
Code:
aapt dump resources [path_to_hangouts_apk]
Now, at the head of the output, you should notice Package 0 id=127 name=com.google.android.apps.babel. This is the package name of the resources. It would be great if resparam.res.getPackageName() returns "com.google.android.apps.babel" instead of "com.google.android.talk".
If I try to access resource IDs of Google Hangouts using the resparam.res.getIdentifier method, and by passing "com.google.android.talk" as the argument to defPackage, I do not get any valid IDs. However, If I pass "com.google.android.apps.babel" as the argument, I get the resource IDs correctly.
Let me know if I can provide more information to help fix this bug. Thanks!

Could this be related to the issue I am facing here: http://forum.xda-developers.com/xposed/replacing-png-resources-t2760606

Related

How do I change the package name in a template?

Hi All,
I'm a super noob in app development and am not a programmer. I want to make my own soundboard and share it on the market so my friends with android phones can dl it. I'm using the steps in http://www.myandroidsoundboard.com/
and everything works great and I have been able to make my own fully working .apk's (woohoo) but when I upload it to the market, it gives me this error:
The package name of your apk (com.soundboard) is the same as the package name of another developer's application. Choose a new package name.
so how do i change the package name? I searched and most results come up for people starting from scratch but not for people using templates already written.
any help would be greatly appreciated.
thanks
1) find the package "com.soundboard" in the 'package explorer' pane.
2) right click on the package name, choose refactor->rename
3) type in a new package name, ex: com.agentkalaw, make sure the checkbox 'update references' is checked.
4) press ok, let eclipse make the change for you.
If there are any references to the old package name in \AndroidManifest.xml you will have to change those manually.
wow! thanks a lot britoso.
any tips on how i can change references in \androidmanifest.xml ?
i only get one error now (so close!) but i can't figure it out. I get
"class com.soundboard.soundboard does not exist" this is in the android:label="@string/app_name">
thanks again!
agentkalaw said:
wow! thanks a lot britoso.
any tips on how i can change references in \androidmanifest.xml ?
i only get one error now (so close!) but i can't figure it out. I get
"class com.soundboard.soundboard does not exist" this is in the android:label="@string/app_name">
thanks again!
Click to expand...
Click to collapse
THe xml will have to be edited manually, simply replace com.soundboard by com.agentkalaw

[HOWTO] Emulate a Chromecast update check

For those of you who have a need for the URLs of new Chromecast updates without actually updating your device, you can manually perform a checkin by POSTing the following XML to https://tools.google.com/service/update2 (make sure to set Content-Type to text/xml):
Code:
<?xml version="1.0" encoding="UTF-8"?>
<o:gupdate xmlns:o="http://www.google.com/update2/request" version="GoogleTvEureka-0.1.0.0" updaterversion="GoogleTvEureka-0.1.0.0" protocol="2.0" ismachine="1">
<o:os version="3.0.8" platform="Linux" sp=""></o:os>
<o:app appid="{45ab3f62-be86-44be-9799-faa6a1229396}" version="12940" lang="en-US" track="stable-channel" board="eureka-b3"
hardware_class="">
<o:updatecheck targetversionprefix=""></o:updatecheck>
</o:app>
</o:gupdate>
The fields are pretty self-explanatory. If you use Linux, you can save the XML to a file called update2.req and make the request using the command
Code:
curl -s https://tools.google.com/service/update2 -d [PLAIN]@update2.req[/PLAIN] -H 'Content-Type: text/xml'
Note: build 13300 is rolling out slowly, so don't complain if you don't get the URL right away. It's entirely up to Google who gets it and who doesn't.
anyone gotten this yet and unpacked it to see what files have changes made to them?
Thank you! I wish I would have seen this sooner.
Now, with a little bit of python, I can automate the making of my rooted images
Ashcunak said:
anyone gotten this yet and unpacked it to see what files have changes made to them?
Click to expand...
Click to collapse
Here's the update if anyone wants it...
http://wreckage.johndenverschooloff....1f63ef63d1f43c6222116806e5bea38a47e9f124.zip
dev-channel ota?
Any idea how to get the dev-channel update zip?
I tried changing to track="beta-channel" in the xml, but that doesnt help.
It seems like there should be atleast one zip file for the below channels
stable-channel
beta-channel
canary-channel
dev-channel
developer-channel
dogfood-channel
Also found this interesting link in the updater binary.
http://omaha.sandbox.google.com/service/update2
morchu said:
Any idea how to get the dev-channel update zip?
I tried changing to track="beta-channel" in the xml, but that doesnt help.
It seems like there should be atleast one zip file for the below channels
stable-channel
beta-channel
canary-channel
dev-channel
developer-channel
dogfood-channel
Also found this interesting link in the updater binary.
http://omaha.sandbox.google.com/service/update2
Click to expand...
Click to collapse
As far as I can tell, none of those channels (except for beta which seems to just be an alias for stable) are active for a stock device. I'm guessing that to receive updates from those channels, your device has to be configured to send its serial number, which also has to be whitelisted on Google's servers. If you want to send a request with a serial number, just add a line like
Code:
serial_num="XXXXXXXXXXXX"
after line 4 (<o:app ...) in the XML. Unless you have access to a development unit's serial number, I doubt it will do much good though.
I had requeseted for whitelisting my device some time back. But never got a response from google.
Can anybody who already had their device whitelisted try the download using your device serial number, and let me know if it works?
I dont think there is anything device specific in the dev-channel system image. So I wonder why that system image is not shared already?
tchebb said:
As far as I can tell, none of those channels (except for beta which seems to just be an alias for stable) are active for a stock device. I'm guessing that to receive updates from those channels, your device has to be configured to send its serial number, which also has to be whitelisted on Google's servers. If you want to send a request with a serial number, just add a line like
Code:
serial_num="XXXXXXXXXXXX"
after line 4 (<o:app ...) in the XML. Unless you have access to a development unit's serial number, I doubt it will do much good though.
Click to expand...
Click to collapse
Just to conclude, it seems like there is no more separate dev-channel firmware download. Emulated my whitelisted devices update request, and received the regular stable-channel update.
morchu said:
I had requeseted for whitelisting my device some time back. But never got a response from google.
Can anybody who already had their device whitelisted try the download using your device serial number, and let me know if it works?
I dont think there is anything device specific in the dev-channel system image. So I wonder why that system image is not shared already?
Click to expand...
Click to collapse
If you are on Windows, then use same XML update2.req file, as @tchebb on 1st post and download cURL for Windows here.
Then use following command, since Linux one is not working in Windows (just place update2.req file in same directory as curl.exe):
Code:
curl -k https://tools.google.com/service/update2 -d @update2.req -H "Content-Type: text/xml"

[Emulator][Unnoficial] Leapcast the Chromecast Emulator All-In-One File

After several hours of tinkering and editing, I think I've finally managed to make an easy way to emulate a Chromecast on your PC. Iv'e only worked on x64 based systems so far, but I'll do x32 if anyone needs it. All you have to do is download the file, place it on your desktop (or it won't work), extract the .tar (don't make a new folder) and follow the directions in INSTALL.txt. It shouldn't require any extra files except Google Chrome, but if it does or you have any other errors or advice, feedback is very appreciated.​
I take no responsibility for any damages done by this. USE AT YOUR OWN RISK. Leapcast is the property of dz0ny at GitHub, not me. All I did was make an all-in-one install script.​
I already have Python installed....Can I just run the Bat file?
Error running LeapCast.bat
I completed the installation but when I run LeapCast.bat got this error (see the image)
Edit: I found the problem, I need to Edit "PATH" environment variable to include this "C:\Python27" and this "C:\Python27\Scripts".
Good job!!!!
Only youtube detected the leapcast, I check Plex, Avia, Crackle and Allcast and they don't.
lordkain2 said:
I completed the installation but when I run LeapCast.bat got this error (see the image)
Edit: I found the problem, I need to Edit "PATH" environment variable to include this "C:\Python27" and this "C:\Python27\Scripts".
Good job!!!!
Only youtube detected the leapcast, I check Plex, Avia, Crackle and Allcast and they don't.
Click to expand...
Click to collapse
It's probably an error in my install script. It should have edited your PATH automatically, so I'll look into it. The compatibility problem is probably just an issue with the emulator itself. I'll keep an eye on the github page and update this as soon as its available. Thanks for the feedback!
Did you use the Chromecast app on your phone/tablet to detect it before you tried the other apps?
Asphyx said:
I already have Python installed....Can I just run the Bat file?
Click to expand...
Click to collapse
That's part of what the script does. If you want, you can ignore the basic Python install if you specifically have Python 2.7.5 installed, but you definitely need to let setuptools and pip install. Won't work without them I'm afraid. Thanks for the feedback!
thatscottguy93 said:
That's part of what the script does. If you want, you can ignore the basic Python install if you specifically have Python 2.7.5 installed, but you definitely need to let setuptools and pip install. Won't work without them I'm afraid. Thanks for the feedback!
Click to expand...
Click to collapse
Thanks Kind of what I expected....Will try this later tonite
Thanks for the effort!
Unfortunately, this doesn't seem to work. The .bat file it leaves on the desktop has a strange trailing ascii-character, but it still doesn't run correctly even after you remove it. I don't know why you would run it from desktop anyway rather than c:\python27\scripts anyway... It should run from anywhere if the PATH is set correctly, but this script didn't seem to do that. Finally, it would be smarter to use the .vbs provided by the leapcast dev instead of your errant .bat on the desktop. Again though, thanks for the attempt.
It would be great if someone could put together a full install using install-shield and all, or at least a working batch script that has been tested on a fresh install of WinXP/Win7/Win8.1 Maybe I will try to.
NOTE: If this works for others, please let us know, but I am fairly certain it has at least a few minor errors preventing it from working by following the instructions alone.
thatscottguy93 said:
It's probably an error in my install script. It should have edited your PATH automatically, so I'll look into it. The compatibility problem is probably just an issue with the emulator itself. I'll keep an eye on the github page and update this as soon as its available. Thanks for the feedback!
Did you use the Chromecast app on your phone/tablet to detect it before you tried the other apps?
Click to expand...
Click to collapse
i have tried editing my system variables, but after running Leapcast.bat it say:
'leapcast' is not recognized as an internal or external command,operable program or batch file.
Please guide me through. AND github is down in my country right now
---------- Post added at 01:17 PM ---------- Previous post was at 12:49 PM ----------
Okay I got this post on google+
https://plus.google.com/+NicandrosNicolaou/posts/8RjWfMXxje8
it help me do a complete install of LEAPCAST...
-------------------------------------------------------------------
I just wanted to ask if there will be any update for V2 chromecast ? @thatscottguy93
link is not working
can you post a mirror link please?
thatscottguy93 said:
After several hours of tinkering and editing, I think I've finally managed to make an easy way to emulate a Chromecast on your PC. Iv'e only worked on x64 based systems so far, but I'll do x32 if anyone needs it. All you have to do is download the file, place it on your desktop (or it won't work), extract the .tar (don't make a new folder) and follow the directions in INSTALL.txt. It shouldn't require any extra files except Google Chrome, but if it does or you have any other errors or advice, feedback is very appreciated.​
I take no responsibility for any damages done by this. USE AT YOUR OWN RISK. Leapcast is the property of dz0ny at GitHub, not me. All I did was make an all-in-one install script.​
Click to expand...
Click to collapse
punkmexic said:
can you post a mirror link please?
Click to expand...
Click to collapse
Just tried, and works for me....
punkmexic said:
can you post a mirror link please?
Click to expand...
Click to collapse
Its attached to the first post... no need for a mirror...
Installation files for 32 bit system
can you make a setup for 32 bit computer?
Can i run xbmc/kodi on my windows pc and use leapcast to send the video feed to my android phone - this way I can use the laptop as a remote and the phone as existing hardware - lowering my android tv experience to a cost of zero - or should I stick with remote desktop... lag could be an issue as leapcast is light weight via python - minus the $5 mhl
Nope
mikeymackinon said:
Can i run xbmc/kodi on my windows pc and use leapcast to send the video feed to my android phone - this way I can use the laptop as a remote and the phone as existing hardware - lowering my android tv experience to a cost of zero - or should I stick with remote desktop... lag could be an issue as leapcast is light weight via python - minus the $5 mhl
Click to expand...
Click to collapse
Leapcast does not work that way, its mainly for youtube etc... web based viewings. Why not run the laptop/ desktop to the TV set and remote in from the Android phone/ tablet via a remote control app or team view etc... You would defiantly have lagging issues if reversed. Plus you do not have the buy the micro usb to hdmi adapter? Kewl story bro!
Seriously smart, as you will not have to get up to change from one episode to the next and at no cost.
thatscottguy93 said:
After several hours of tinkering and editing, I think I've finally managed to make an easy way to emulate a Chromecast on your PC. Iv'e only worked on x64 based systems so far, but I'll do x32 if anyone needs it. All you have to do is download the file, place it on your desktop (or it won't work), extract the .tar (don't make a new folder) and follow the directions in INSTALL.txt. It shouldn't require any extra files except Google Chrome, but if it does or you have any other errors or advice, feedback is very appreciated.​
I take no responsibility for any damages done by this. USE AT YOUR OWN RISK. Leapcast is the property of dz0ny at GitHub, not me. All I did was make an all-in-one install script.​
Click to expand...
Click to collapse
Thank you very much!!! Nice Work! I love you <3 #nohomo
Hi,
i wanted to try this but iam stucking at this error
C:\Users\Administrator\Desktop\LeapcastForWindows\leapcast>leapcast --name Leapcast --chrome "C:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe" --fullscreen
Traceback (most recent call last):
File "C:\Python27\scripts\leapcast-script.py", line 9, in <module>
load_entry_point('Leapcast==0.1.3', 'console_scripts', 'leapcast')()
File "C:\Python27\lib\site-packages\pkg_resources.py", line 356, in load_entry_point
return get_distribution(dist).load_entry_point(group, name)
File "C:\Python27\lib\site-packages\pkg_resources.py", line 2431, in load_entry_point
return ep.load()
File "C:\Python27\lib\site-packages\pkg_resources.py", line 2147, in load
['__name__'])
ImportError: No module named leapcast.__main__
Anyone know how to fix this?
Managed to got it almost working IT's an old thread but I will give it a go.
Had to update Python to 2.7.9 for the SSL thing.
This is my issue :
Code:
C:\Users\d3x\Desktop\LeapcastForWindows\leapcast>leapcast --name Leapcast --chrome "C:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe" --fullscreen
INFO:root:Starting SSDP server
INFO:root:Starting LEAP server
INFO:root:Loading Config-JSON from Google-Server
Traceback (most recent call last):
File "C:\Python27\Scripts\leapcast-script.py", line 9, in <module>
load_entry_point('Leapcast==0.1.3', 'console_scripts', 'leapcast')()
File "c:\leapcast\leapcast\__main__.py", line 38, in main
leap_server.start()
File "c:\leapcast\leapcast\services\leap.py", line 35, in start
resp = requests.get(url=app_dict_url)
File "C:\Python27\lib\site-packages\requests-2.18.4-py2.7.egg\requests\api.py", line 72, in get
return request('get', url, params=params, **kwargs)
File "C:\Python27\lib\site-packages\requests-2.18.4-py2.7.egg\requests\api.py", line 58, in request
return session.request(method=method, url=url, **kwargs)
File "C:\Python27\lib\site-packages\requests-2.18.4-py2.7.egg\requests\sessions.py", line 508, in request
resp = self.send(prep, **send_kwargs)
File "C:\Python27\lib\site-packages\requests-2.18.4-py2.7.egg\requests\sessions.py", line 618, in send
r = adapter.send(request, **kwargs)
File "C:\Python27\lib\site-packages\requests-2.18.4-py2.7.egg\requests\adapters.py", line 506, in send
raise SSLError(e, request=request)
requests.exceptions.SSLError: HTTPSConnectionPool(host='clients3.google.com', port=443): Max retries exceeded with url: /cast/chromecast/device/config (Caused by SSLError(SSLError(1, u'[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:581)'),))
Would that mean that google changed something and this no longer works?
-chrizz- said:
Hi,
i wanted to try this but iam stucking at this error
C:\Users\Administrator\Desktop\LeapcastForWindows\leapcast>leapcast --name Leapcast --chrome "C:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe" --fullscreen
Traceback (most recent call last):
File "C:\Python27\scripts\leapcast-script.py", line 9, in <module>
load_entry_point('Leapcast==0.1.3', 'console_scripts', 'leapcast')()
File "C:\Python27\lib\site-packages\pkg_resources.py", line 356, in load_entry_point
return get_distribution(dist).load_entry_point(group, name)
File "C:\Python27\lib\site-packages\pkg_resources.py", line 2431, in load_entry_point
return ep.load()
File "C:\Python27\lib\site-packages\pkg_resources.py", line 2147, in load
['__name__'])
ImportError: No module named leapcast.__main__
Anyone know how to fix this?
Click to expand...
Click to collapse
Did u solved this?? same problem here.. let me know if u solved this
Don't know about your specific error, but Google definitely changed something. Leapcast doesn't work anymore. According to dz0ny on github:
This project no longer works because Google locked down entire API. There are alternatives like cloning device, casting apk from nexus player etc. Thanks for all contibutors and I hope we all learned something from this project. Meanwhile I'am keeping https://github.com/dz0ny/leapcast/issues/130 open if anyone wants to discuss something related to lepacast or 2nd screen paradigm.
I would love to re-implement this as an open source alternative to chromecast someday, but I won't make any promises.
Does anyone know a proper way to uninstall this?

Starting a service with same permissions as hooked package

Simple question. I want to start my own service from my package with the same permissions as the package i am hooking. Does anybody know how i could do this? I know if i use android:sharedUserId="android.uid.systemui" in the manifest, but it prevents it based off of signature mismatch. Could i use xposed to grant my app the sharedUserId?
Simple question. I want to start my own service from my package with the same permissions as the package i am hooking.
Click to expand...
Click to collapse
I don't think that is possible. I haven't worked with services yet, but as far as I understood, you have to declare them in your manifest (in contrast to BroadcastReceivers, which can also be registered at runtime). Theoretically again, you could try to modify the manifest parsing and try to inject additional entries there.
elesbb said:
Could i use xposed to grant my app the sharedUserId?
Click to expand...
Click to collapse
Theoretically, I think yes, you could hook the package manager to ignore the signature mismatch etc. But I think it will be quite fragile.
What do you want to achieve with this?
rovo89 said:
I don't think that is possible. I haven't worked with services yet, but as far as I understood, you have to declare them in your manifest (in contrast to BroadcastReceivers, which can also be registered at runtime). Theoretically again, you could try to modify the manifest parsing and try to inject additional entries there.
Theoretically, I think yes, you could hook the package manager to ignore the signature mismatch etc. But I think it will be quite fragile.
What do you want to achieve with this?
Click to expand...
Click to collapse
I hate how Samsung removed widgets from the lockscreen. So i figured i'll create my own lockscreen and have it loaded by the system. I might just skip the whole service thing (which would make my lockscreen easier to write by having classes that extend things like FrameLayout as the stock lockscreen does) but i found where the lockscreen is actually shown. i may just inflate my own xml of the lockscreen using xposed resources and then adding it with windowmanager. Then the inflated view will follow the same permissions as the stock lockscreen and allow me to handle key presses and still preserve the security behind it.
Thanks rovo for the reply!
@rovo89
If i am inflating my own view inside a hooked method, how can i get the ids of my layout? I tried XModuleResources myRes; myRes.getIdentifier() but it returned null.
Be careful, Resources.getIdentifier() expects the arguments in a different order than Xposed, like getIdentifier("mystring", "string", "my.package.name").
Apart from that, simply use R.layout.my_layout.

[Q] Modifying XposedBridge.jar

Hi,
I have written a module which records the occurrence of specific system APIs in the log file, using "XposedHelpers.findAndHookMethod". My hooked methods simply prints the name of API into the log file. My module works perfectly fine, unless I try to run an app which is instrumented by Emma, in order to measure the code coverage. The problem is that I get "Instrumentation detected, disabling framework for app" error message in the log file.
I decided to change the XposedBridge.java and replace the new XposedBridge.jar with the old one. However, it breaks the Xposed framework and my virtual machine never starts after reboot.
How can I resolve this issue?
Is there any way safe to change XposedBridge.java and replace the XposedBridge.jar?
Thanks.

Categories

Resources