[Fun Tweak] Password protect Terminal Emulator! - Nexus 4 General

I though, since I'm bored, why don't I create a little script that will password protect terminal from the noobs? Its nothing special, just a cool little tweak I made .
Basically if the password is correct you get a root shell #, if it is wrong the android task manager will kill it. Simple.
To set up :
Put file somewhere on phone, you can remove extensions (maybe hide it in the root file system or something)
In terminal go to Menu > Preferences > initial command.
Change it to: sh /path/to/file .in my case it is: sh /system/etc/termpass
Close terminal.
Now when it opens it will ask for a password. Default is 1234.
To change it, edit file with any text editor and replace with what you want.
Have fun

Related

Theming Android 2.1

Okay I'm sure some ppl still run Android 2.1 so I hope this isn't a complete waste of time. I did post this on VR ages ago before their site went tits up and lost everything.
"How to perform "simple" theme changes in 2.1 based roms (tested on VR12).
Firstly, if I can do this, you can.
The only tool (apart from winrar and some photo editing software) you'll really need is AndroidSDK because you need to push/pull things using ADB (android debugging bridge) ->
http://developer.android.com/sdk/index.html
Download and follow setting up instructions.
So now we have to "pull" the files from the phone we want to change.
1) Load command prompt and change the directory to "androidsdk\tools" eg:
C:\Documents and Settings\user>
C:\Documents and Settings\user>cd c:\androidsdk\tools <hit enter>
C:\AndroidSDK\tools>
(If you cannot find command prompt, type into search "cmd" and it should come up.)
2) Ensure your phone is connected via usb and select "charge only".
You can type "adb devices" into the command prompt to check that your phone is connected tho this isn't necessary...useful to check if you're having issues tho.
3) Now to pull the files we want. In this example we are only going to look at pulling "framework-res.apk" as this is the file that contains the images for the status bar, it's icons and the background of the status bar...amongst other things.
Type the following into ADB: adb pull <location of file you want to pull (+ file name)> <location you want the file to be pulled to (+ file name)>
So in the case of pulling framework-res.apk we type:
adb pull /system/framework/framework-res.apk c:\androidapps\framework-res.apk
"/system/framework/framework-res.apk" is the location of the file on the phone and "c:\androidapps\framework-res.apk" is the location the file will be placed on your computer. c:\androidapps is the folder on my c drive where I pull .apk's to (you'll need to make your own folder like this).
4) Locate the file framework-res.apk on your computer (in c:\androidapps if you're using the same folder name as myself) and open it with winrar. Do not extract anything we just want to have a look for some .png's. (.png is a type of image compression that preserves transparency)
Now that you've opened framework-res.apk open the folder named "res" then open the folder named "drawable-mdpi". In here you can find all the .png images I've previously mentioned. Do not close winrar as you will need it.
The .png for the status bar is named "statusbar_background.png" you can drag and drop this to you computer and open it with some image editing software.
I personally recommend GIMP as it is free and very good (http://www.gimp.org/). If you are not confident with image editors you can use http://fotoflexer.com/ for basic editing (clicking on the layers tab on fotoflexer allows you to edit the transparency of the image...remember to save images as .png)
5) Now that you have edited your .png you can drag and drop it back to the res\drawable-mdpi folder hopefully still open in winrar. Close winrar now...it's time to push the edited framework-res.apk back to your phone!
6) Go back to command prompt, if you have removed the usb from your phone at any time, plug it back in and type "adb remount" into command prompt. This remounts the phone for editing.
Now type the following into ADB: adb push <location of file on computer> <location of file on phone>
In this case:
adb push c:\androidapps\framework-res.apk /system/framework/framework-res.apk
and hit enter! This is how it should appear in command promt:
C:\AndroidSDK\tools>adb push c:\androidapps\framework-res.apk /system/framework/framework-res.apk
You phone should restart sense but if it freezes/gets a bit schizy type "adb reboot" into the command prompt to manually reboot the phone.
And it's as simple as that.
You can look through the .png's in res\drawable-mdpi to find more images you might want to edit. The background of the status bar drop down is called "status_bar_background.png" and actual drag down bar is named "status_bar_close_on.9.png".
I think I'll save the explaination of how to edit the bar at the bottom of the screen with the app drawer, phone and + for another time as it requires the knowledge of how to sign .apk's which tho isn't hard is probably quite time consuming for me to explain (due to my very limited knowledge)."
Hope this attempt at 'giving something back' helps someone.
Mark
thanks alot .. Really like it

how to edit hosts file

I've been trying to work on this and still can't figure out how to do this can somebody give me a step by step
So far I've tried to inStall an ash server to go in and edit it but I cannot get it to work somebody to help
maxgohan said:
I've been trying to work on this and still can't figure out how to do this can somebody give me a step by step
So far I've tried to inStall an ash server to go in and edit it but I cannot get it to work somebody to help
Click to expand...
Click to collapse
two ways to change your hostname
1. open edit /system/etc/dhcpcd/dhcpcd.conf with your favorite text editor. under "interface eth0", type: hostname yourdesiredhostname
2. open your favorit terminal emulator, type: vi /system/etc/dhcpcd/dhcpcd.conf
make above mentioned changes.
-> reboot and it should be working. try to ping your device from another piece of hardware in your home network
if you want to change your hosts file - do the same with /etc/hosts ^^
I keep getting this line...
mv: can't remove '/etc/hosts': Read-only file system
is your device rooted? if yes, you have either so mount your root file system as writeable in your file explorer (if it supports root access, like ES File Explorer), or you have to type "su root" at the beginning of your terminal emulator operations.
same problem with a rooted and unlocked device
two_handed said:
is your device rooted? if yes, you have either so mount your root file system as writeable in your file explorer (if it supports root access, like ES File Explorer), or you have to type "su root" at the beginning of your terminal emulator operations.
Click to expand...
Click to collapse
my device is rooted with kingroot I have installed root explorer and ES file explorer too with giving them root permission as well , but when ever I tried to delete or edit hosts file nothing gets change (with root explorer) and with ES file explorer it says " read only file " I tried to change the permission in properties but failed to save the check boxes result. oh man I forget to mention my problem here my cell is infected by a "freedom" app when finally I found it useless I changed the freedom app setting to "freecore" my device got reboot after that I uninstalled the app , now I am unable to connect with google servers , can't use play store , I also tried hosts file Editor but got no result I know my problem is to delete the hosts file , but something is not letting me to take control over hosts file , my android is 5.1 and model is huawei honor 4c ?

[Q] How to run a script when booting is done?

What should I do to run a script when bootings done?
for example I want to run
echo 902400>sys/devices/system/cpu/cpu0/cpufreq/scaled_max_freq
everytime phone boots automatically(its just an example)
please explain simple .Im not professional
thanks
Add this at the start - #!/system/bin/sh
Then look in system/etc/init.d and look at the numbers in the file name.
Name your file a number between 01-99 that hasn't been used already. (01 been the first to run and 99 been the last to run) eg, 97maxfreq
then move it to system/etc/init.d and reboot

How to replace Siri with Google Assistant! [GUIDE]

So as you may know, Google released their Assistant SDK a couple days back. Naturally, my first instinct was to replace Siri with Google Assistant on my MacBook Pro.
Here we go...
NOTICE: I am not responsible for any loss of data or damage to your computer. I strongly recommend backing up your device before following this tutorial. Proceed at your own risk.
You are installing the Google Assistant SDK on to your device, and there are limitations and differences between it and Google Home.
This is not elegant by any means and doesn't have a fancy GUI like Siri, so be warned. It's a bodge. But hey, it works
1. Firstly, download and extract the zip file attached to the bottom of this post. I chose to do this in the Downloads folder. If you haven't already installed Python 3, go ahead and install it (the pkg file is located in the '1. Python' folder).
2. Go to the Project Page (console.cloud.google.com/project) of Google's Cloud Platform Console, and click 'Create Project'. Name your project "My Google Assistant". After your project has been created, close the page.
3. Enable the Google Assistant API by following this link (console.developers.google.com/apis/api/embeddedassistant.googleapis.com/overview) and clicking 'Enable'. Make sure your project is selected (the project title is displayed at the top of the page). Click "Create Credentials", and select "Other UI (e.g. Windows, CLI tool)" and "User Data" in the following dropdown boxes. Give your OAuth 2.0 Client ID a name, and hit 'Create Client ID'. Call your Product "My Google Assistant". When you are prompted to download credentials, click 'I'll do this later'. You will be brought to a page with a list of OAuth 2.0 Client IDs, and you should see the one you just made. Click the download button to the side, and download it to a folder called "googleassistant" in your Home Directory.
4. Ensure that "Web & App Activity", "Location History", "Device Information" and "Voice & Audio Activity" are all enabled in your Activity Control page (myaccount.google.com/activitycontrols) so that Assistant can be personalised to you.
5. Open a Terminal window (Applications > Utilities > Terminal.app), and install pip if you haven't already installed it, by entering the command:
Code:
sudo easy_install pip
6. Navigate to your googleassistant directory:
Code:
cd ~/googleassistant
7. Install these dependencies:
Code:
python -m pip install google-assistant-sdk[samples]
8. Enter the following command, changing XX to the name of the json file you downloaded earlier:
Code:
python -m googlesamples.assistant.auth_helpers --client-secrets XX.json
9. You will be given a URL. Enter it into your browser and login to your Google Account to authorise the application. You will be given a code. Copy it, and enter it back into the Terminal window - this may take a few minutes.
10. Test that your Google Assistant works with your Mic by entering the following command; it will record 5 seconds of audio and play it back to you.
Code:
python -m googlesamples.assistant.audio_helpers
11. If you can hear yourself, entering the following command to start talking to your new Google Assistant! It can take a couple of minutes to load when you first enter the command, and can take a minute to realise you've finished speaking, so be patient! It does become a lot more responsive after you've ran it for the first time. When you enter the command, wait for it to prompt the command "press Enter to send a new request", and ignore any warnings.
Code:
python -m googlesamples.assistant
Congrats, you just got Google Assistant working on your Mac!
12. Now to replace Siri with Google Assistant, go to the '2. Assistant App' folder from the archive you downloaded and extracted from this post earlier. Copy it, and place it in the ~/googleassistant directory you created earlier.
All this app does is run the Terminal command from step 11 when pressed (if you're worried, all of these apps can be opened in Automator so you can see there's no funny business here).
13. Next, go to System Preferences > Users & Groups > Login Items, and add the Assistant app as a login item, and click the checkbox to Hide the app so it runs in the background.
14. Go to the directory '/System/Library/CoreServices/SystemAppearance.bundle/Contents', and press Cmd-I to bring up the Get Info dialog box. Give yourself Read & Write access by clicking the padlock at the bottom of the window, clicking the '+' Icon, your username, and setting your Privilege to 'Read & Write'.
Next, enter into the 'Resources' folder and do exactly the same thing to the file 'Assets.car', giving yourself Read & Write access.
15. Repeat step 14 at the directory '/System/Library/CoreServices/Siri.bundle/Contents', again with the 'Resources' folder and 'Assets.car' file.
16. IF YOU DO NOT HAVE A TOUCH BAR, SKIP THIS STEP!
Open the '3. Icons' folder from the archive you extracted earlier, and open ThemeEngine.app. Click 'Open Document', go the directory '/System/Library/CoreServices/SystemAppearance.bundle/Contents/Resources',
and click on 'Assets.car'. Go to the "TouchBarControlStripSiriContent" element, and backup the original image by dragging the 'normal' image to your Desktop or location of your choice.
Next, go into the Images > TouchBar folder and drag the 'sharedArt...' image into the 'normal' box to replace it. Click File > Save and exit.
17. If you do not have ThemeEngine open from the last step, open the '3. Icons' folder from the archive you extracted earlier, and open ThemeEngine.app.
Click 'Open Document', but this time go the directory '/System/Library/CoreServices/Siri.bundle/Contents/Resources', and click on 'Assets.car'.
Go through each element, and backup the original images by dragging both of the images in 'StatusMenuDark', 'StatusMenuLight', and the two images in 'ZZZZPackedAsset-1.0' and 'ZZZZPackedAsset-2.0' to your Desktop or another safe location.
Next, go into the Images > StatusMenuDark in the archive you extracted earlier, and ensure the 'StatusMenuDark' element is selected in ThemeEngine. In the folder, there will be two images - one that begins with 'siri-menu-icon-darkmode_', and one that begins with '[email protected]_'.
Look at the image that is selected in Theme Engine, and drag the image with the same name into its place.
Repeat this with the 'StatusMenuLight', 'ZZZZPackedAsset-1.0' and 'ZZZZPackedAsset-2.0' elements + folders in the archive (sidenote: the PackedAsset elements only have one image inside each, unlike the StatusMenu elements). After this, click File > Save and exit.
18. At this point, you have replaced the Siri Icons with Google Assistant Icons, and have Google Assistant set to open in the Terminal when you login. But all those Siri apps still just open Siri! Lets fix that.
It turns out that when you click the Siri Icon on your Touch Bar, in your Status bar, or open Siri in the Applications folder, they're actually all just shortcuts for opening Siri.app in the CoreServices folder.
In System Preferences, click on Siri and make sure it is DISABLED - do not close this window!
Next, open Activity Monitor (Applications > Utilities > Activity Monitor.app) and search for Siri. Kill Siri and its related service if running.
Open a new Finder Window, and navigate to '/System/Library/CoreServices'. Copy Siri.app and back it up somewhere safe. Go the archive, open the folder '4. Siri Shortcut', and copy Siri.app into the CoreServices folder, replacing the Siri app that's already there. Go back to your System Preferences window, and enable Siri. Close out of your windows, restart your mac, and hey presto - Siri has been fully replaced by Google Assistant! You're welcome.
That Siri.app is again an AppleScript made in Automator, and it essentially just enters 'Return' into the Terminal window when pressed. In other words, it's the equivalent of clicking 'return' in that Terminal window when you were talking to Google Assistant earlier. As I said, it's a bodge, but it works!
When the Terminal window launches, don't exit it! Instead, press Cmd-H to hide the window.
If you want to go back to Siri just follow this tutorial again (in the correct order), but replace the Assistant files with the Siri files that you backed up.
I hope you found this useful!
If you did, please follow me on twitter (@_lucasys) and help share this guide around
ZIP FILE: drive.google.com/file/d/0B9n0ZPG3Fgh3emJaanRHT2ZMSWc/view?usp=sharing
Screenshots: imgur.com/s88t7hC, imgur.com/qIi5t9W
Thanks to Alexander S. Zielenski and Mishaal Rahman
Reserved
Reserved Post
Wow keep it up man!
Any tweaks like this for jailbroken iPhones?
Python
Valiante said:
Any tweaks like this for jailbroken iPhones?
Click to expand...
Click to collapse
I don't know if iPhone have the required version of python if yes then there is a way.
hi, nice hack! one of the best!
does this support local commands for the mac?
Would this work with an M1 Macbook Air and that thise post is like 6 years old?

How to keep third party apps from disappearing from Android Auto

So this is for any phone that is rooted. I kind of stumbled on it by just modifying/deleting entries inside of com.google.android.projection.gearhead. I use mixplorer cause its the easiest most user friendly.
1. Open mixplorer and navigate to /data/data/com.google.android.projection.gearhead/files/phenotype/shared/
2. Open gh.phenotype.pb as text with the in app code editor
3. Search for
AppValidation__blocked_packages_by_installer
4. Delete the line of the app your trying to use and save the file.
5. Press and hold on the file and select I on the top.
6. Change owner to root 0 and set permission to rw 600 if it's different.
That's it. My file hasn't updated since February 21 and I continually update Android auto and won't lose any app like obd2aa or fermata and the like. Hopefully it'll work for you too.
Hello, I have looked in the folder /data/data/com.google.android.projection.gearhead/files/phenotype/shared/, but I don't have the gh.phenotype.pb file as you can see in the screenshot. Can it be in another folder? Thank you
Nick_Gl said:
So this is for any phone that is rooted. I kind of stumbled on it by just modifying/deleting entries inside of com.google.android.projection.gearhead. I use mixplorer cause its the easiest most user friendly.
1. Open mixplorer and navigate to /data/data/com.google.android.projection.gearhead/files/phenotype/shared/
2. Open gh.phenotype.pb as text with the in app code editor
3. Search for
AppValidation__blocked_packages_by_installer
4. Delete the line of the app your trying to use and save the file.
5. Press and hold on the file and select I on the top.
6. Change owner to root 0 and set permission to rw 600 if it's different.
That's it. My file hasn't updated since February 21 and I continually update Android auto and won't lose any app like obd2aa or fermata and the like. Hopefully it'll work for you too.
Click to expand...
Click to collapse
Hello, I have looked in the folder /data/data/com.google.android.projection.gearhead/files/phenotype/shared/, but I don't have the gh.phenotype.pb file as you can see in the screenshot. Can it be in another folder? Thank you
Buy Xiaomi
Check out these:
- King Installer - Install packages "as Google Play" to work around restrictions (Root optional)
- Android Auto - Xposed Unlocked - Bypass even more restrictions (Root required)

Categories

Resources