The Hack (Totally Illegal...ish)
‘हो, निश्चय नै हाम्रा संसदहरुले अन्य विषयमा संसद नै अवरुद्ध गरे तर एनसेलको लाभकर प्रकरणमा त्यस्तो देखिएन, राज्यलक्ष्मी प्रकरणहरु पनि सतहमै देखिए,’ डा. पौडेलको स्वीकारोक्ति छ ।
Yes, technically, it uses ADB (Android Debug Bridge) over Wi-Fi, which is a developer tool and not meant for bedtime parenting. But that’s the beauty of it.
‘अन्य ग्रहमा गएर बस्न संभव छैन, सुन्दर पृथ्वीलाई कसरी बचाउने भनेर सोचौं’विभागले यात्रु बोक्ने तथा कार्गाे समान बोक्ने रेल वे लाइन निर्माणको सम्भाव्यता अध्ययन अघि बढाउन लागेको बताएको छ ।
-
Download and Extract Platform Tools:
-
Go to the official Android Developers website:
- Navigate to Android SDK Platform-Tools.
-
Download the SDK Platform Tools:
- Download the latest version for your operating system (Windows, macOS, or Linux).
- Extract the ZIP file: Extract the downloaded ZIP file to a location of your choice (e.g., C:\adb on Windows).
C:\adb
-
-
Add Platform Tools to your System's PATH:
-
Windows:
- Open the "Environment Variables" settings (search for "Environment Variables" in the Start menu).
- Click "Edit the system environment variables".
- Click "Environment Variables".
- In the "System variables" section, find the "Path" variable, select it, and click "Edit".
- Click "New" and add the path to the platform-tools directory (e.g., C:\adb).
-
macOS/Linux:
-
Open your terminal.
-
Add the path to the platform-tools directory to your shell's configuration file (e.g., ~/.bashrc, ~/.zshrc).
For example: export PATH=$PATH:/path/to/platform-tools.
export PATH=$PATH:/usr/local/bin/adb echo $PATH | tr ":" "\n"
In my case, it’ll be something like this:
-
Restart your terminal or source the configuration file (e.g., source ~/.bashrc).
From now on, we will work only in the command line. In my case, it will be the terminal.
-
-
-
Verify ADB Installation:
-
Open a command line interface (CLI):
- Using the Windows Search Bar (Windows OS):
- Click the Start button or the magnifying glass icon in the taskbar.
- Type "cmd" (without quotes) in the search bar.
- Click on the "Command Prompt" result.
- To run as administrator, right-click on "Command Prompt" in the search results and select "Run as administrator".
- Using Spotlight Search (macOS):
- Click the magnifying glass icon in the menu bar (or press Cmd+Space).
- Type "Terminal" and double-click it to open.
- Using the Windows Search Bar (Windows OS):
-
Type adb and press Enter.
adb
-
If adb is installed correctly, you should see the ADB help message.
-
-
Enable USB Debugging on your Android Device:
- Go to "Settings" on your Android device.
- Scroll down and select "About Phone".
- Find "Build Number" and tap it 7 or more times to unlock Developer Options.
- Go back to the main "Settings" page, and now you'll see "Developer Options".
- Select "Developer Options".
- Scroll down to "USB Debugging" and toggle it on.
- वायर कनेक्शन;
- वायरलेस कनेक्शन।
वायर कनेक्शन:
त्यसैले ‘डेटा डिटेक्टिभ’ का लागि छनोट भएका व्यक्तिले ‘जहाँ डेटा छ, त्यही पुग्ने’ हैसियत राख्नेछन् ।
adb devices
adb tcpip 5555
adb -d shell "ip route | awk '/wlan0/ {print \$9}'"
वायरलेस कनेक्शन:
‘आवश्यकता अनुसार खर्च गर्न पाउने तर जति मान्छे आयो त्यति नै खर्च भयो भनेर बिल पेस नगर्नु भनेर निर्देशन दिनुभएको छ,’ प्रवक्ता डंगोलले बताए ।
adb connect <DEVICE_IP>:5555
adb connect 10.0.0.108:5555
प्रचण्डको उद्घोष–‘२ वर्ष पछि १ नम्बर पार्टी’‘ठीकै छ, लिलिबिली नभए अर्को कुनै नेपाली चलचित्रमा प्रयास गरौंला’ भनेर फोन राख्नै लागेकी थिएँ, उहाँले ‘सुन न, एउटा ब्यान्ड न्यूज छ, तिमी लिलिबिलीको पत्रकार सम्मेलनमा सहभागी हुन काठमाडौं जानुपर्ने भयो’ भन्नुभयो ।
अनुकूलको दृष्टिकोण
नेपाली बहुवैकल्पिक शब्द हो जसको विवरण निम्न रहेको छ:
import subprocess
import time
import re
def get_stream_volume():
cmd = "adb shell dumpsys audio | awk '/- STREAM_MUSIC:/{flag=1; count=0} flag && count<=5 {print; count++} /^$/{flag=0}'"
result = subprocess.run(cmd, shell=True, capture_output=True, text=True)
match = re.search(r'streamVolume:(\d+)', result.stdout)
return int(match.group(1)) if match else None
def set_volume(level):
cmd = f"adb shell cmd media_session volume --stream 3 --set {level}"
subprocess.run(cmd, shell=True)
print(f"Volume set to {level}")
def monitor_volume():
while True:
volume = get_stream_volume()
if volume is None:
print("Failed to get volume level. Retrying...")
time.sleep(5)
continue
print(f"Current volume: {volume}")
if volume == 15:
for vol in range(14, 4, -1):
set_volume(vol)
time.sleep(30)
while get_stream_volume() == 5:
print("Volume is at 5, monitoring every 60 seconds...")
time.sleep(60)
if __name__ == "__main__":
monitor_volume()
os.system("adb shell dumpsys audio | grep -i 'streamVolume'")
import subprocess
import time
import re
import logging
from datetime import datetime
logging.basicConfig(
filename='volume_control.log',
level=logging.INFO,
format='[%(asctime)s] %(message)s',
datefmt='%Y-%m-%d %H:%M:%S'
)
ADB_DEVICE = "10.0.0.108:5555"
def log(message):
timestamp = get_timestamp()
print(f'[{timestamp}] {message}')
logging.info(message)
def get_timestamp():
return datetime.now().strftime('%Y-%m-%d %H:%M:%S')
def connect_adb():
subprocess.run(f"adb connect {ADB_DEVICE}", shell=True)
log(f"Reconnected to ADB at {ADB_DEVICE}")
def get_stream_volume():
cmd = "adb shell dumpsys audio | awk '/- STREAM_MUSIC:/{flag=1; count=0} flag && count<=5 {print; count++} /^$/{flag=0}'"
result = subprocess.run(cmd, shell=True, capture_output=True, text=True)
match = re.search(r'streamVolume:(\d+)', result.stdout)
return int(match.group(1)) if match else None
def safe_get_stream_volume(retries=3, delay=5):
for attempt in range(retries):
volume = get_stream_volume()
if volume is not None:
return volume
log(f"Attempt {attempt + 1}: Failed to get volume. Retrying after reconnect...")
connect_adb()
time.sleep(delay)
log("All attempts failed. Giving up temporarily.")
return None
def set_volume(level):
cmd = f"adb shell cmd media_session volume --stream 3 --set {level}"
subprocess.run(cmd, shell=True)
log(f"Volume set to {level}, waiting 30 seconds...")
def monitor_volume():
while True:
volume = safe_get_stream_volume()
if volume is None:
log("Initial volume read failed. Retrying in 30 seconds...")
time.sleep(30)
continue
log(f"Current volume: {volume}")
while volume > 5:
set_volume(volume - 1)
time.sleep(30)
volume = safe_get_stream_volume()
if volume is None:
log("Failed to read volume during decreasing.")
break
while True:
volume = safe_get_stream_volume()
if volume is None:
log("Failed to read volume during monitoring.")
time.sleep(30)
break
if volume > 5:
log(f"Volume increased to {volume}, restarting decreasing")
break
log(f"Volume is at {volume}, monitoring every 60 seconds...")
time.sleep(60)
if __name__ == "__main__":
try:
monitor_volume()
except KeyboardInterrupt:
log("Script stopped by user (Ctrl+C)")
except Exception as e:
log(f"Unexpected error: {e}")
finally:
log("Script exited.")
- Python को लागि सीधे
python3 reduce_volume.py
- उत्पादित गर्न सक्नुहुन्छ
-
Connect the mobile device with a wire to your personal computer.
-
Run the command
adb tcpip 5555
adb tcpip 5555
-
And run
adb connect <DEVICE_IP>:5555
आपको स्क्रिप्ट को एक standalone .app
for macOS वा .exe
for Windows गर्न सक्छन्, PyInstaller:
pyinstaller --onefile reduce_volume.py
पोकमोन सन् ९० को दशकमा चर्चामा रहेको यही भिडियो गेमको नयाँ संस्करण हो।
adb connect 10.0.0.108:5555
४. निष्काम्य कर्म (बिना कुनै स्वार्थ गरिने कार्य)अन्य विचारहरू
फूटबललाई उनी महिला सशक्तिकरणको बलियो माध्यम मान्छिन्- आत्मविश्वास त बढ्छ नै साथै अनुशासनमा रहन सिकाउँछ यो खेलको नियमहरुले।