Anyone knows if it's possible to get any context directly in handleInitPackageResources or handleLoadPackage but not inside hooked methods?
I'm trying to switch my modules to use RemotePreferences (com.crossbowffs.remotepreferences) instead of XSharedPreference which requires a valid context.
Related
Hello everyone. I'm not very experienced with Linux but have done some. I want to connect to my Tomato router using GScript and RSA keys. I generated keys with ConnectBot and I can connect to it from there fine, however when I try to connect from GScript using ssh -p port [email protected] 'command', I get an error about the host not being in the trusted hosts file. Is this because the RSA keys are not system-wide and GScript is not using what was created by ConnectBot, or is this a different unrelated problem? Any help would be great, thanks!
I really don't know where to start with this. I seriously recommend you read Wikipedia and experiment more with virtualized Linux computers (VMware Player or Oracle VirtualBox are good starts, running CentOS and Ubuntu).
RSA keys, as you're talking about at first, is the public key encryption scheme used to authenticate you to connect to your router, in this case. BUT. The keys you talk about in the second part? Those aren't keys. Your "trusted hosts file" is a list of unique fingerprints that an SSH server creates when it's first initialized, and are used to "sign" that it's the server you're connecting to.
For example, if every day you connect to the same server, and then suddenly one day, you get told that the fingerprints don't match, and you know that nothing has changed on the server end, it's a good chance that something got messed up, or that someone is attempting to perform some kind of a man-in-the-middle attack.
To get back to your question though, no, the Trusted Hosts file is not shared between ConnectBot and GScript. Odds are, ConnectBot isn't even sharing your SSH key (the RSA key) with GScript, and you haven't even gotten to that error yet. The SSH key can be system wide though (PROTIP: Just put it on the root of your SD card and load it into ConnectBot/GScript by manually adding the key file).
Thanks for your help. So basically I just want these two programs to share trusted hosts files and RSA keys. How does GScript initially come to trust a host, and how come ConnectBot didn't have this issue? I guess I could try to find the trusted hosts file ConnectBot is using, and can I move its key file to the root and then share it with GScript? Or do I need to make a new one (possibly in Cygwin on the desktop) and copy it over to the SD card.
I do plan to read more about this stuff, but that will happen in time. Right now I feel very close to accomplishing what I want (as you can probably tell by me posting this at 4:45 AM ).
Thanks again.
For the trusted hosts issue, you can't really share them, as there's no standardized format to the file (it's like trying to swap an MP3 and an AAC file; they both may be music, and they both may be of the same song, but they're quite different). There should be an option on the GScript error message to just add the host to the trusted list. If not, try running the same command from a terminal (ADB shell, or open ConnectBot and connect to local).
In regards to the key file, you'll just have to hunt down wherever ConnectBot placed it, and move it to the root of the SD card, then re-add it in ConnectBot (Press Menu and then Manage SSH keys to get to the key list. Menu again to select add/import).
Thanks. I'm having no luck finding ConnectBot's key file, so I just made a new one in Cygwin and will put it in my SD card. However I'm still not sure how to add/import that into GScript, or how to get GScript to trust that host (I don't see an option for it with the error message). These are questions I need to direct towards the GScript crowd, unfortunately its thread hasn't received much activity in awhile. Is there any other way you would go about saving a script to run from your home screen?
So, I have had an HTC Vision running CM7 and have been using it as JUST a wifi access point (no routing or DHCP provided by the Vision itself, just the WAP). I could tell you a very long and boring story about why I need it this way but here's the bottom line -- I'd like to know the actual command line (either through adb shell or terminal directly on the device) to configure and enable just the master mode access point functionality with encryption.
I found a starting point on Antoine Amarilli's blog - Android from the Command Line -- not allowed to post links yet or I would -- but two things:
1) it doesn't appear to cover encryption.
2) It requires getting and using an add'l binary (ultra_bcm_config) which is simple enough but slightly puzzling since obviously the phone can do all of this already with just what's in the CM7 ROM.
So I'd just like a little more understanding, control, and insight to be able to script the WAP setup myself instead of being beholden to the built-in tether toggle -- which occasionally fails to work though it's easily fixed with a reboot of the phone.
Guidance? Thanks!
Dropped my S3 today, and now the screen doesn't respond to touch. The display also only works partially. This is the excuse I needed to get an S5, but I'd like to pull data off this S3 for the transition. Honestly I'm not even sure there's anything important on there that isn't already backed to the cloud one way or another. But I'd like to poke around to be sure, use Titanium backup for at least a few apps in particular.
So I found this nice utility: http://forum.xda-developers.com/showthread.php?t=2786395 to allow me to control the device and see the screen via adb. Problem is that while USB debugging is enabled, I have to confirm the RSA fingerprint of my PC on the device itself... which I can't do because the digitizer on the phone is broken. Some searching suggests using a USB OTG to connect a mouse to blindly try to hit the RSA confirmation button. Either it doesn't work, or the cable I hacked together didn't cut it. I couldn't get off of the keyguard screen. Ordered a premade OTG adapter, but if that still fails I may have to find another way in.
From what I've read, I can disable the RSA check by setting ro.adb.secure=0 in default.prop, but that file would need to be replaced on the boot ramdisk. Making a custom boot image isn't something I've done. I found this article about it, "HOWTO: Unpack, Edit, and Re-Pack Boot Images". Following that article, should my boot.img come from extracting the L710VPUDNJ2_L710SPRDNJ2_L710VPUDNJ2_HOME.tar.md5 file? And then once I've recompiled boot.img with the modified default.prop, what is the proper method for flashing that boot.img? Do I need to use odin?
The device has stock NJ2+root and Philz Touch recovery. The display and hardware keys work well enough that I can navigate recovery and initiate anything in there, and I can get to an adb shell while the device is booted in recovery.
So two questions...
1) am I on the right track to make and flash a custom boot.img?
2) is this all pointless? would I be better served to simply use recovery to copy down a backup image and extract anything I may need from that? That main data I'm concerned about is keys/etc for 2-factor apps like google authenticator and battle.net.
EDIT: As far as getting in, I couldn't figure out how to make that app work properly for controlling the phone. It could show me the screen, but apparently not send touch input.
BUT, the solution to bypassing secure adb was easy. Since I had a custom recovery and could get adb shell while booted in recovery, I could shell in, mount data, and push my local adbkey.pub to /data/misc/adb/adb_keys. VMLite VNC Server was the easiest way I found to access the system remotely, since I could push the app install from the play store on the web and then use the companion desktop app to launch the server on my phone via adb.
As soon as I was able to get powershell moved over and tested, my first thought was to see if WinRM (Windows Remote Management or PSSessions) was functional. I was greeted with the cryptic message that "WinRM command line is not available on this system". rpcss and http are required services for WinRM startup, so I have created startup entries for both. Sadly rpcss wants lanmanserver and lanmanworkstation started, and I am unable to start either due to permissions, but these services appear to have startup entries already. Anyone else working on this and interested in swapping notes?
There is a special secret dial code for invoking an extended Engineering Mode on the Oneplus 3:
*#36446337#
This opens up the menue of this extended EM.
It worked. But I screwed it up, so I cannot invoke it any more
I know, shame on me and all that stuff, this was totally my fault, as I played around with the apk, copied (not moved) it to the Download folder and tried to install it like a normal app.
Did not work.
But now also invoking the original extended EM no longer works ([email protected]).
I'd like to kindly ask the real experts among you:
1. What is it I screwed up with my stupid attempts to install this apk?
2. Is there any way to restore the information the dialer needs for parsing this secret code - other than performing a factory reset?
Or which is the information that got lost or overwritten?
3. All files in
/system/app/EngineeringMode
/system/app/EngSpecialTest
appear to have been unaffected.
(But could anyone please share the proper contents of these two folders, in case the extended EM works properly for him?)
4. Is there any way of invoking the extended EM directly working around doing it with the secret dialer code given above? e.g. by modifying the apk - admittedly in a more sophisticated way I attempted ?
I hope my question comes in the proper forum, don't want to cross-post it.
Thanks in advance!
Please Post Files as attachment or Link...
Would you be kind enough to post these files or a link to them? Unsure, but suspect a permissions issue or incorrect location of said files. I think you can connect to computer (with debugging enabled, & allowing access & allowing the rsa prompt also). You will need a command line/terminal depending on your desktop /laptop os. . I would say that you can use adb devices, then adb shell and finally am then the package name. Not sure how to format the activity manager command. Mayb am start - n xxx or am start xxx. Perhaps forum or Google can help. I kno that typing just am from the adb shell will list all possible options.