Every time I drag'n'drop some files to Android device connected using MTP, File Explorer opens these annoying dialogs asking whatever I really want to copy the files and/or convert them.
To get rid of these dialogs, some suggest disable "Portable Devices Menu" extension or unregister "wpdshext.dll" but none of these work on my Windows 8.1.
I realized that instead of modifying Windows internals, it can be worked around using the right auto-clicking using AutoHotkey.
So just save these the files as .ahk and put/link them to shell:startup. If your Windows language is not en-US, edit the files to match yours.
Code:
dlgTitle := "Copy"
dlgBtnUnwantedAction := "No, skip this file"
dlgBtnWantedAction := "Yes"
dlgBtnCancel := "Cancel"
SetTitleMatchMode 3
matchFound := false
Loop
{
WinWait %dlgTitle% ahk_class #32770
matchFound := false
ControlGetText, button1Text, Button1, %dlgTitle% ahk_class #32770
if ( button1Text = dlgBtnUnwantedAction ) {
ControlGetText, button2Text, Button2, %dlgTitle% ahk_class #32770
if ( button2Text = dlgBtnWantedAction ) {
ControlGetText, button3Text, Button3, %dlgTitle% ahk_class #32770
if ( button3Text = dlgBtnCancel ) {
matchFound := true
}
}
}
if ( matchFound ) {
ControlClick, Button2, %dlgTitle% ahk_class #32770
} else {
WinWaitClose %dlgTitle% ahk_class #32770
}
}
and
Code:
dlgTitle := "Convert and Copy"
dlgBtnUnwantedAction := "Yes, convert and copy (recommended)"
dlgBtnWantedAction := "No, just copy"
dlgBtnCancel := "Cancel"
SetTitleMatchMode 3
matchFound := false
Loop
{
WinWait %dlgTitle% ahk_class #32770
matchFound := false
ControlGetText, button1Text, Button1, %dlgTitle% ahk_class #32770
if ( button1Text = dlgBtnUnwantedAction ) {
ControlGetText, button2Text, Button2, %dlgTitle% ahk_class #32770
if ( button2Text = dlgBtnWantedAction ) {
ControlGetText, button3Text, Button3, %dlgTitle% ahk_class #32770
if ( button3Text = dlgBtnCancel ) {
matchFound := true
}
}
}
if ( matchFound ) {
ControlClick, Button2, %dlgTitle% ahk_class #32770
} else {
WinWaitClose %dlgTitle% ahk_class #32770
}
}
thnak you ,i hope it worked didn't check but i trust you
moneytoo said:
Every time I drag'n'drop some files to Android device connected using MTP...
Click to expand...
Click to collapse
thanks for the script.
Is the first one for Windows 7 and the second one for Windows 8 right?
Related
I'm trying to dynamically update the innerHTML of
a span in PIE. However in the page generated by
the below code when I click on the abc link and then
enter some text in the prompt and then click on OK
it crashes PIE. Am I doing something wrong here or is it
beyond the capability of the XDA?
Code:
<html>
<head>
<title>Test</title>
<script language="Javascript">
function Add()
{
var ihtml;
ihtml = "<table border=1>";
ihtml += "<tr><td width=60>";
ihtml += "<span id=a1>";
ihtml += "<a href=javascript:Edit('a1" + "')>abc</a></span></td>";
ihtml += "</tr></table>";
tt.innerHTML = ihtml;
}
function Edit(s)
{
var ihtml;
var p = prompt("Type something in here", "");
ihtml = "<a href=javascript:Edit('" + s + "')>" + p + "</a>";
eval(s + ".innerHTML = ihtml;");
}
</script>
</head>
<body onLoad="Add();">
<form>
<div id="tt"></div>
</form>
</body>
</html>
Thanks for your help
PAD
Have no idea if you guys will know but firstly does the Excalibur support AT commands?
secondly, how would I connect using VC# 2008 Express
code follows
Code:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.IO.Ports;
namespace phoneBackup
{
public partial class Form1 : Form
{
SerialPort sp = new SerialPort();
public Form1()
{
InitializeComponent();
programStatus.Text = "Connecting...";
}
private void Form1_Load(object sender, EventArgs e)
{
sp.Open();
if (sp.IsOpen == true)
{
programStatus.Text = "Connection: " + sp.IsOpen.ToString();
//status
sp.ReadTimeout = 500;
sp.WriteTimeout = 500;
getStatus();
}
else
{
programStatus.Text = "Not connected, relaunch";
}
}
private void button1_Click(object sender, EventArgs e)
{
try
{
textBox1.Text = "";
sp.WriteLine("AT+CGMM");
sp.Write("AT+CGMM");
getStatus();
}
catch (System.Exception ex)
{
textBox1.Text = ex.Message.ToString();
}
}
private void button2_Click(object sender, EventArgs e)
{
try
{
textBox1.Text = "";
textBox1.Text = "Reading..." + Environment.NewLine;
textBox1.Text += "Status: " + Environment.NewLine;
getStatus();
}
catch (Exception ex)
{
textBox1.Text = "error " + ex.Message.ToString();
}
}
private void getStatus()
{
textBox1.Text += "BaseStream: " + sp.BaseStream.ToString() + Environment.NewLine;
textBox1.Text += "BaudRate: " + sp.BaudRate.ToString() + Environment.NewLine;
textBox1.Text += "Bytes to read: " + sp.BytesToRead.ToString() + Environment.NewLine;
textBox1.Text += "Bytes to write: " + sp.BytesToWrite.ToString() + Environment.NewLine;
textBox1.Text += "ReadTimeout: " + sp.ReadTimeout.ToString() + Environment.NewLine;
textBox1.Text += "Port Name: " + sp.PortName.ToString() + Environment.NewLine;
textBox1.Text += "Handshake: " + sp.Handshake.ToString() + Environment.NewLine;
textBox1.Text += "Data bits: " + sp.DataBits.ToString() + Environment.NewLine;
}
private void sp_DataReceived(object sender,
SerialDataReceivedEventArgs e)
{
textBox1.Text += Environment.NewLine + sp.ReadExisting().ToString();
}
private void button3_Click(object sender, EventArgs e)
{
textBox1.Text = "";
getStatus();
}
}
}
Output is
BaseStream: System.IO.Ports.SerialStream
BaudRate: 9600
Bytes to read: 0
Bytes to write: 0
ReadTimeout: 500
Port Name: COM1
Handshake: None
Data bits: 8
no matter which button is pressed
bump
anyone cna help?
I was wondering, how Apps can call/start other Apps...
For instance internal Apps...
Also how we can modify for instance samsungApps.swf
Maybe we could create funny Theme with "App Starter"...
Best Regards
Code:
//Action tag #0
function dTrace(str)
{
++dtraceN;
this.dbg.text = this.dbg.text + ("\n" + dtraceN + " : " + str);
if (this.dbg.maxscroll > 1)
{
this.dbg.text = "";
}
}
function languageChange()
{
AppsClass.startSamsungApps();
}
function fontChange()
{
AppsClass.startSamsungApps();
}
function mouseEvent(type, mX, mY)
{
var __reg3 = undefined;
__reg3 = Gadget.SamsungApps.mouseClick(type, mX, mY);
if (type == "up" && __reg3 != true)
{
_root.dTrace("launch]Widget," + this);
}
}
function hasSound(type, mX, mY)
{
var __reg1 = undefined;
__reg1 = Gadget.SamsungApps.clickSound(type, mX, mY);
return __reg1;
}
function sendEvent(eventName, eventObj)
{
this.ExtendedEvents[eventName].addListener(eventObj);
listenerObj[eventName] = eventObj;
}
function removeEvent()
{
for (var __reg2 in listenerObj)
{
this.ExtendedEvents[__reg2].removeListener(listenerObj[__reg2]);
}
}
var dtraceN = 0;
this.ExtendedEvents = ExtendedEvents;
var AppsClass = Gadget.SamsungApps.getSamsungApps(this);
AppsClass.startSamsungApps();
this.widgetType = "launch";
this.launch = true;
var listenerObj = new Object();
This we can extract with Flash Decompiler...
Best Regards
Always was wondering how to run applications one can select from, hereby NOT using any 3rd party launchers as for example "Autorun CD Menu" and/or "Discstarter", etc.pp you have to pay for, if using Window's AUTORUN feature, which works with CD/DVD/BD/USB (USB only if follows U3-Standard) if not deactivated
[HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Cdrom]
Autorun=dword:1
BTW: To enable AUTORUN on USB you have to change/create in Window's registry
[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer]
NoDriveAutoRun=dword:91 (hex)
May be a similar registry key also exists as
[HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer]
If so, then you also have to change this key's value.
Click to expand...
Click to collapse
So I had the idea to realize such a launcher with wellknown "MortScript", the most fantastic scripting tool, IMHO. This launcher of course is not very visually appealing.
How it works:
The folders/files structure on the storage medium basically looks like
AUTORUN.INF
MORTSCRIPT.EXE
AUTORUNMENU.EXE
AUTORUNMENU.MSCR
PROGRAM FILES
DRIVERS
WINDOWS
Note that folder PROGRAM FILES has the 2 subfolders BASE and CUSTOM. BASE contains portable apps that never should be missing, as for example "Firefox Portable"; CUSTOM contains all the portable apps you intend to be present, too.
FYI: A huge collection of portable apps you find HERE.
Also note that each folder/subfolder has the 2 subfolders x86 and x84 where the appropriate portable app goes to. If only a x86 version is available, then it should be copied to x84, too.
Code:
\PROGRAM FILES
\BASE
\x86
\CommandPrompt
\<exefile>
\RegistryEditor
\<exefile>
\x64
\CommandPrompt
\<exefile>
\RegistryEditor
\<exefile>
\CUSTOM
\x86
\FileManager
\<exefile>
\x64
\FileManager
\<exefile>
Contents of file AUTORUN.INF looks as
[Autorun]
ShellExecute=AUTORUNMENU.EXE
UseAutoplay=1
The launcher script is coded as follows:
Code:
// © 2013 jwoegerbauer
// GPL v2
//
local()
title=systempath("ScriptName")
// determine path
pth=systempath("ScriptPath")
// determine drive
drive=pth
pos=find(drive,":")
if(pos)
drive=substr(drive,1,pos)
else
bigmessage("^NL^Couldn't determine drive letter.^NL^Exiting...","["&title&"] Error")
// quit
exit
endif
is64bit=direxists("C:\Windows\Boot\EFI")
// preset folder paths
pthwindows=pth\"Windows"
pthdrivers=pth\"Drivers"
pthbase=pth\"Program Files\Base"
pthcustom=pth\"Program Files\Custom"
// adjust paths according to Windows's Bit version
if(NOT is64bit)
pthcustom&="\x86"
pthbase&="\x86"
pthdrivers&="\x86"
pthwindows&="\x86"
title&=" (x86)"
else
pthcustom&="\x64"
pthbase&="\x64"
pthdrivers&="\x64"
pthwindows&="\x64"
title&=" (x64)"
endif
if(NOT direxists(pthcustom))
bigmessage("^NL^Folder^NL^"&pthcustom&"^NL^is missing.^NL^Exiting...","["&title&"] Error")
// quit
exit
endif
cntcustom=0
if(direxists(pthcustom))
foreach dir in directories(pthcustom\"*")
if(dir NE "")
cntcustom+=1
endif
endforeach
endif
cntbase=0
if(direxists(pthbase))
foreach dir in directories(pthbase\"*")
if(dir NE "")
cntbase+=1
endif
endforeach
endif
// create and populate array that holds custom applications' path
appscustom=array()
if(cntcustom)
idx=0
foreach dir in directories(pthcustom\"*")
if(dir NE "")
foreach exe in files(dir\"*.exe")
if(exe NE "")
idx+=1
appscustom[idx]=exe
endif
endforeach
endif
sleep(1)
endforeach
endif
// create and populate array that holds base applications' path
appsbase=array()
if(cntbase)
idx=0
foreach dir in directories(pthbase\"*")
if(dir NE "")
foreach exe in files(dir\"*.exe")
if(exe NE "")
idx+=1
appsbase[idx]=exe
endif
endforeach
endif
sleep(1)
endforeach
endif
optscustom=array()
if(elementcount(appscustom))
// populate options menu
idx=0
foreach exe in array(appscustom)
if(fileexists(exe))
idx+=1
optscustom[idx]=toupper(filebase(exe))
endif
sleep(1)
endforeach
endif
optsbase=array()
if(elementcount(appsbase))
// populate options menu
idx=0
foreach exe in array(appsbase)
if(fileexists(exe))
idx+=1
optsbase[idx]=toupper(filebase(exe))
endif
sleep(1)
endforeach
endif
if((NOT elementcount(optscustom))||(NOT elementcount(optsbase)))
bigmessage("^NL^Neither custom nor base apps found.^NL^Exiting...","["&title&"] Error")
// quit
exit
endif
if(elementcount(optscustom)&&elementcount(optsbase))
// display and loop a main menu until cancel button pressed
hint="Please select app's category ...^NL^"
optsmain=array("Custom","Basic")
idx=1
while(idx<>0)
idx=choice(title,hint,0,0,optsmain)
if(idx<>0)
// display and loop category related submenu
if(idx=1)
@appsmenu(appscustom,optscustom,title)
else
@appsmenu(appsbase,optsbase,title)
endif
endif
sleep(1)
endwhile
// done
exit
endif
if(elementcount(optscustom))
@appsMenu(appscustom,optscustom,title)
else
@appmenu(appsbase,optsbase,title)
endif
// done
exit
sub appsmenu(apps,opts,title)
local()
hint="Please select app be run ...^NL^"
idx=1
while(idx<>0)
idx=choice(title,hint,0,0,opts)
if(idx<>0)
// run the app selected
runwait(apps[idx])
endif
sleep(1)
endwhile
endsub
As you might have noticed, all you have to do is to supply the apps to be potentially run on the storage medium. The rest is done by the laucher script.
For your convenience I have packed the files AUTORUN.INF, MORTSCRIPT.EXE, AUTORUNMENU.EXE and AUTORUNMENU.MSCR into a ZIP-file which is attached to this post.
HTH
Hello,
I am trying to port LineageOS to the Samsung Galaxy S8 as my first LineageOS port. I know this is probably one heck of an undertaking for a first port but a rooted snapdragon-based S8 is currently the only device I have access to and I would like to have stock-ish android on this device.
In any case, I am running into errors while trying to build for the platform.
I am using this guide with this guide for reference to try to port.
I have followed the first guide basically to the tee so far.
These are all of the things (of interest) that I have done.
1. I executed these commands to clone the code base:
Code:
repo init -u https://github.com/LineageOS/android.git -b lineage-19.1
repo sync
2. I have created a file called "local_manifests.xml" in the directory ".repo/local_manifests/" that contains the following:
Code:
?xml version="1.0" encoding="UTF-8"?>
<manifest>
<remote name="android_device_samsung_dreamlte" fetch="https://github.com/TeamWin/" revision="android-9.0"/>
<project name="android_device_samsung_dreamlte" path="device/samsung/dreamlte" remote="android_device_samsung_dreamlte"
revision="android-9.0"/>
<remote name="android_kernel_samsung_msm8998" fetch="https://github.com/jesec/" revision="cm-14.1"/>
<project name="android_kernel_samsung_msm8998" path="kernel/samsung/msm8998" remote="android_kernel_samsung_msm8998" revision="cm-
14.1"/>
<remote name="vendor_samsung_dreamlte" fetch="https://github.com/AndroidBlobs/" revision="dreamltexx-user-8.0.0-R16NW-
G950FXXS4CRJD-release-keys"/>
<project name="vendor_samsung_dreamlte" path="vendor/samsung/dreamlte" remote="vendor_samsung_dreamlte" revision="dreamltexx-user-8.
0.0-R16NW-G950FXXS4CRJD-release-keys"/>
</manifest>
3. I have rerun the repo sync command to sync the blobs, kernel and architecture specific information from the local manifests.
4. I have added a file in the "device/samsung/dreamlte" directory called "lineage_dreamlte.mk" this file contains the following information based on the original "lineage.dependencies" file:
Code:
# Inherit from the common Open Source product configuration
$(call inherit-product, $(SRC_TARGET_DIR)/product/aosp_base_telephony.mk)
# Inherit from our custom product configuration
$(call inherit-product, vendor/lineage/config/common.mk)
PRODUCT_DEVICE := dreamlte
PRODUCT_NAME := lineage_dreamlte
PRODUCT_MODEL := Galaxy S8
PRODUCT_BRAND := Samsung
PRODUCT_MANUFACTURER := Samsung
5. I have added a blank file called "lineage.dependencies" in the same directory because the original omni.dependencies was also blank
6. I have modified the file called "BoardConfig.mk" in the same directory to read the following. This file was made based on a combination of the original file (which is for the Exynos-based model of the S8) and the board configuration for the Google Pixel 2 (available here) which has the same SOC as the Snapdragon-based S8.
Code:
Platform
DEVICE_CODENAME := dreamlte
DEVICE_PATH := device/samsung/$(DEVICE_CODENAME)
BOARD_VENDOR := samsung
TARGET_BOARD_PLATFORM := msm8998
TARGET_BOOTLOADER_BOARD_NAME := msm8998
TARGET_NO_BOOTLOADER := true
TARGET_NO_RADIOIMAGE := true
# Architecture
TARGET_ARCH := arm64
TARGET_ARCH_VARIANT := armv8-a
TARGET_CPU_ABI := arm64-v8a
TARGET_CPU_ABI2 :=
TARGET_CPU_VARIANT := cortex-a53
TARGET_CPU_SMP := true
# Secondary Architecture
TARGET_2ND_ARCH := arm
TARGET_2ND_ARCH_VARIANT := armv8-a
TARGET_2ND_CPU_ABI := armeabi-v7a
TARGET_2ND_CPU_ABI2 := armeabi
TARGET_2ND_CPU_VARIANT := cortex-a53
# File systems
BOARD_HAS_LARGE_FILESYSTEM := true
TARGET_USERIMAGES_USE_EXT4 := true
TARGET_USERIMAGES_USE_F2FS := true
BOARD_HAS_NO_REAL_SDCARD := true
# TWRP specific build flags
RECOVERY_VARIANT := twrp
ALLOW_MISSING_DEPENDENCIES=true
TW_THEME := portrait_hdpi
RECOVERY_SDCARD_ON_DATA := true
TARGET_RECOVERY_PIXEL_FORMAT := "ABGR_8888"
TW_BRIGHTNESS_PATH := "/sys/class/backlight/panel/brightness"
TW_MAX_BRIGHTNESS := 36600
TW_DEFAULT_BRIGHTNESS := 15300
TW_NO_REBOOT_BOOTLOADER := true
TW_HAS_DOWNLOAD_MODE := true
TW_INCLUDE_NTFS_3G := true
TW_EXCLUDE_SUPERSU := true
TW_EXTRA_LANGUAGES := true
TW_USE_NEW_MINADBD := true
LZMA_RAMDISK_TARGETS := recovery
# Kernel
BOARD_KERNEL_BASE := 0x10000000
BOARD_KERNEL_PAGESIZE := 2048
TARGET_PREBUILT_KERNEL := $(DEVICE_PATH)/kernel
BOARD_MKBOOTIMG_ARGS := --kernel_offset 0x00008000 --ramdisk_offset 0x01000000 --tags_offset 0x00000100 --dt $(DEVICE_PATH)/dtb
# Include
TARGET_SPECIFIC_HEADER_PATH := $(DEVICE_PATH)/include
7. I run the "source build/envsetup.sh" command
Up to this point there has been no errors.
8. I execute the "brunch lineage_dreamlte-eng" command and get the following
Code:
In file included from build/make/core/config.mk:313:
In file included from build/make/core/envsetup.mk:323:
build/make/core/board_config.mk:246: error: Building a 32-bit-app-only product on a 64-bit device. If this is intentional, set TARGET_SUPPORTS_64_BIT_APPS := false.
21:30:50 dumpvars failed with: exit status 1
Device dreamlte not found. Attempting to retrieve device repository from LineageOS Github (http://github.com/LineageOS).
Repository for dreamlte not found in the LineageOS Github repository list. If this is in error, you may need to manually add it to your local_manifests/roomservice.xml.
In file included from build/make/core/config.mk:313:
In file included from build/make/core/envsetup.mk:323:
build/make/core/board_config.mk:246: error: Building a 32-bit-app-only product on a 64-bit device. If this is intentional, set TARGET_SUPPORTS_64_BIT_APPS := false.
21:30:51 dumpvars failed with: exit status 1
In file included from build/make/core/config.mk:313:
In file included from build/make/core/envsetup.mk:323:
build/make/core/board_config.mk:246: error: Building a 32-bit-app-only product on a 64-bit device. If this is intentional, set TARGET_SUPPORTS_64_BIT_APPS := false.
21:30:51 dumpvars failed with: exit status 1
** Don't have a product spec for: 'lineage_dreamlte'
** Do you have the right repo manifest?
No such item in brunch menu. Try 'breakfast'
I have looked up this error for multiple hours to no avail. I have no idea what could be the issue, it doesn't seem to me like the 32 bit error is fatal. It seems like it cannot find the product spec for some reason and that is the fatal error.
I am almost certain that I have made some sort of simple mistake that is causing the product spec to not show up. I am also almost certain I have made some sort of other error somewhere else in the process especially in step 6 (the one about the board config).
I would greatly appreciate someone looking over this for me and helping me to solve this issue. My apologies of this error can simply be chalked up to my own stupidity or carelessness.
If you want me to send the contents of any other files, results of commands, etc. I will be more than happy to send them.
Thanks,
sckzor
# Quick check to warn about likely cryptic errors later in the build.
ifeq ($(TARGET_IS_64_BIT),true)
ifeq (,$(filter true false,$(TARGET_SUPPORTS_64_BIT_APPS)))
$(error Building a 32-bit-app-only product on a 64-bit device. \
If this is intentional, set TARGET_SUPPORTS_64_BIT_APPS := false)
endif
endif
TARGET_SUPPORTS_64_BIT_APPS := true get you compiling again.