liuguijing 1 year ago
commit 69c9ad7f8a

@ -5,7 +5,7 @@ plugins {
// 10,00,000 major-minor-build
def AppMajorVersion = 1
def AppMinorVersion = 0
def AppBuildNumber = 132
def AppBuildNumber = 133
def AppVersionName = AppMajorVersion + "." + AppMinorVersion + "." + AppBuildNumber
def AppVersionCode = AppMajorVersion * 100000 + AppMinorVersion * 1000 + AppBuildNumber
@ -13,7 +13,7 @@ def AppVersionCode = AppMajorVersion * 100000 + AppMinorVersion * 1000 + AppBuil
android {
signingConfigs {
debug {
storeFile file('D:\\Workspace\\Github\\xymp\\TermApp\\sign.jks')
storeFile file('../sign.jks')
storePassword 'XyMpApp'
keyAlias 'xymp'
keyPassword 'XyMpApp'

@ -212,6 +212,11 @@ CPhoneDevice::CPhoneDevice(JavaVM* vm, jobject service, const std::string& appPa
m_timerUidFeed = time(NULL) * 1000;
m_wakelockIdFeed = (unsigned long)m_timerUidFeed;
#ifdef USING_NRSEC
TurnOnCameraPower(env);
GpioControl::setSpiPower(true);
#endif
}
CPhoneDevice::~CPhoneDevice()
@ -932,6 +937,16 @@ bool CPhoneDevice::TakePhoto(const IDevice::PHOTO_INFO& photoInfo, const vector<
params.zoom = mPhotoInfo.zoom;
params.zoomRatio = mPhotoInfo.zoomRatio;
if (photoInfo.channel == 2 || photoInfo.channel == 3)
{
if (GpioControl::getLightAdc() > 1400)
{
params.autoExposure = 0;
params.exposureTime = 1200;
params.sensibility = 1200;
}
}
// GpioControl::EnableGpio(CMD_SET_CAM_3V3_EN_STATE, true);
bool res = false;
@ -1206,8 +1221,7 @@ bool CPhoneDevice::OnImageReady(cv::Mat& mat)
it->label, item.name.c_str(), it->x, it->y, it->w, it->h, pt.x, pt.y, textSize.width, textSize.height);
ALOGI(buf);
#endif
ft2->putText(mat, item.name, pt, fontSize, textColor, thickness, cv::LINE_AA, false, true);
ft2->putText(mat, item.name + std::to_string((int)(it->prob * 100.0)), pt, fontSize, textColor, thickness, cv::LINE_AA, false, true);
}
++it;
}

@ -10,10 +10,13 @@ import java.util.zip.ZipEntry;
import java.util.zip.ZipOutputStream;
public class ZipUtils {
public static void ZipFolder(File srcFile, File zipFile) {
public static interface Filter {
boolean match(String file);
}
public static void ZipFolder(File srcFile, File zipFile, Filter filter) {
try {
ZipOutputStream outZip = new ZipOutputStream(new FileOutputStream(zipFile));
ZipFiles(srcFile.getParent() + File.separator, srcFile.getName(), outZip);
ZipFiles(srcFile.getParent() + File.separator, srcFile.getName(), outZip, filter);
outZip.finish();
outZip.close();
} catch (FileNotFoundException e) {
@ -25,7 +28,7 @@ public class ZipUtils {
}
}
private static void ZipFiles(String srcFileParentName, String srcFileName, ZipOutputStream zipOutputSteam) throws Exception {
private static void ZipFiles(String srcFileParentName, String srcFileName, ZipOutputStream zipOutputSteam, Filter filter) throws Exception {
if (zipOutputSteam == null)
return;
File file = new File(srcFileParentName + srcFileName);
@ -51,10 +54,10 @@ public class ZipUtils {
}
//
for (int i = 0; i < fileList.length; i++) {
if (fileList[i].startsWith("specdata") || fileList[i].endsWith(".lck")) {
if (filter != null && !filter.match(fileList[i])) {
continue;
}
ZipFiles(srcFileParentName + srcFileName + "/", fileList[i], zipOutputSteam);
ZipFiles(srcFileParentName + srcFileName + "/", fileList[i], zipOutputSteam, filter);
}
}
}

@ -8,6 +8,7 @@ import android.net.NetworkInfo;
import android.os.Environment;
import android.os.PowerManager;
import android.os.SystemClock;
import android.telephony.TelephonyManager;
import android.text.TextUtils;
import android.util.Log;
import android.util.Pair;
@ -111,6 +112,10 @@ public class AppMaster {
return (System.currentTimeMillis() - SystemClock.elapsedRealtimeNanos() / 1000000) / 1000;
}
private void selectSimCard(int number) {
TelephonyManager telephonyManager = (TelephonyManager)mService.getSystemService(Context.TELEPHONY_SERVICE);
}
public void start() {
new Thread(new Runnable() {
@ -420,7 +425,8 @@ public class AppMaster {
SysApi.reboot(mService.getApplicationContext());
} else if (TextUtils.equals(cmd, CMD_UPLOAD_LOGS)) {
String url = jsonObject.optString("url", null);
uploadLogs(url);
int noSpecData = jsonObject.optInt("noSpecData", 0);
uploadLogs(url, noSpecData == 0);
uploadMasterLogs(url);
} else if (TextUtils.equals(cmd, CMD_SET_CMA)) {
String ip = jsonObject.optString("value_str", null);
@ -725,7 +731,7 @@ public class AppMaster {
}
}
private void uploadLogs(String url) {
private void uploadLogs(String url, final boolean includingSpecData) {
String appDir = mService.buildAppDir();
try {
@ -746,7 +752,19 @@ public class AppMaster {
return;
}
ZipUtils.ZipFolder(logDir, file);
ZipUtils.Filter filter = new ZipUtils.Filter() {
@Override
public boolean match(String fileName) {
if (!fileName.endsWith(".txt")) {
return false;
}
if (!includingSpecData && fileName.startsWith("specdata")) {
return false;
}
return true;
}
};
ZipUtils.ZipFolder(logDir, file, filter);
if (!file.exists()) {
return;
@ -785,7 +803,13 @@ public class AppMaster {
return;
}
ZipUtils.ZipFolder(logDir, file);
ZipUtils.Filter filter = new ZipUtils.Filter() {
@Override
public boolean match(String fileName) {
return fileName.endsWith(".txt");
}
};
ZipUtils.ZipFolder(logDir, file, filter);
if (!file.exists()) {
return;
@ -817,7 +841,7 @@ public class AppMaster {
return;
}
ZipUtils.ZipFolder(pathFile, file);
ZipUtils.ZipFolder(pathFile, file, null);
if (!file.exists()) {
return;

@ -90,6 +90,13 @@ public class MainActivity extends AppCompatActivity {
}
});
findViewById(R.id.nrsec).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
SysApi.setSpiPowerOn(true);
}
});
findViewById(R.id.btnTurnAppOn).setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {

@ -101,4 +101,13 @@
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/btnTurn485On" />
<Button
android:id="@+id/nrsec"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="12dp"
android:text="NRSEC"
app:layout_constraintStart_toEndOf="@+id/sendsms"
app:layout_constraintTop_toTopOf="@+id/sendsms" />
</androidx.constraintlayout.widget.ConstraintLayout>
Loading…
Cancel
Save