Skip to content

Instantly share code, notes, and snippets.

@alphacat2018
alphacat2018 / cloudSettings
Last active Jun 9, 2020
This batch is used to push a file or a folder into App.There are two parameters in the batch:keyword of package name and full name of the file without dir path, which means the content for copy should in the same folder with this batch file.Take care there should not be two files with the same name in your app package.
View cloudSettings
{"lastUpload":"2020-06-09T15:18:20.257Z","extensionVersion":"v3.4.3"}
@alphacat2018
alphacat2018 / pullFiles.bat
Last active Dec 12, 2016
Pull files and/or folders from an unrooted android device.There are two parameters when executing this batch:keyword of App's package name and keyword of filename for searching.
View pullFiles.bat
@echo off
adb shell "package=$(pm list package %1);packageName=${package#*package:};echo packageName: $packageName;filePath=$(run-as $packageName find /data/data/$packageName -name *%2*);echo filePath: $filePath;mkdir /sdcard/myPull;run-as $packageName cp -r $filePath /sdcard/myPull/;cd /sdcard/myPull;ls;"
adb pull /sdcard/myPull
adb shell "rm -r /sdcard/myPull"
pause
rem this line is an commented example: pullFiles MyApp .db.By this you can pull all db files.
@alphacat2018
alphacat2018 / push db
Created Dec 2, 2016
Push database file into an unrooted android device
View push db
/*assume you have created a database file outside*/
adb push /sdcard/database.db newDatabase.db
adb shell
adb run-as my.package
adb cp /sdcard/database.db /data/data/my.package/databases/database.db
Until now,you should have replaced the original database.db successfully.