左晓为主开发手持机充值管理机
充值记录分页加载
补卡用户列表分页加载
通信模块添加日志方便分析长时间链接后不能通讯问题
20个文件已修改
3个文件已添加
1249 ■■■■ 已修改文件
app/build.gradle 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/java/com/dayu/recharge/activity/MyActivity.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/java/com/dayu/recharge/activity/NewCardListActivity.java 24 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/java/com/dayu/recharge/activity/RechargeListActivity.java 98 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/java/com/dayu/recharge/activity/ReplacementActivity.java 103 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/java/com/dayu/recharge/adapter/RechargeAdapter.java 99 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/java/com/dayu/recharge/adapter/ReplacementAdapter.java 97 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/java/com/dayu/recharge/dao/RechargeDao.java 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/java/com/dayu/recharge/net/SocketNet.java 19 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/java/com/dayu/recharge/utils/ExcelUtil.java 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/res/layout/activity_newcard_list.xml 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/res/layout/activity_recharge_list.xml 24 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/res/layout/activity_replacement.xml 21 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/res/layout/item_new_card.xml 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/res/layout/item_recharge.xml 87 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/src/main/res/layout/item_replacement.xml 76 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
easysocket/src/main/java/com/easysocket/connection/connect/SuperConnection.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
easysocket/src/main/java/com/easysocket/connection/iowork/EasyReader.java 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
easysocket/src/main/java/com/easysocket/connection/iowork/EasyWriter.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
easysocket/src/main/java/com/easysocket/utils/HexUtil.java 275 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
gradlew 275 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
gradlew.bat 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
local.properties 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
app/build.gradle
@@ -3,7 +3,7 @@
android {
    signingConfigs {
        debug {
            storeFile file('dycz.jks')
            storeFile file('D:\\androidProject\\charge\\app\\dycz.jks')
            storePassword 'dycz@2023'
            keyAlias 'dayu'
            keyPassword 'dycz@2023'
app/src/main/java/com/dayu/recharge/activity/MyActivity.java
@@ -162,7 +162,7 @@
                            if (isRechargeList) {
                                listData = asynchBaseDao.rechargeDao().ansyFindByTime(beginTime, endTime);
                            } else {
                                listData = baseDao.userCardDao().findByTime(beginTime, endTime);
                                listData = asynchBaseDao.userCardDao().findByTime(beginTime, endTime);
                            }
                            if (listData == null || listData.size() == 0) {
                                handler.sendEmptyMessage(2);
@@ -178,7 +178,7 @@
                            return;
                        }
                        if (isRechargeList) {
                            title = new String[]{"设备序列号", "用户名", "身份证号", "充值日期", "充值金额(元)", "剩余金额(元)"};
                            title = new String[]{"设备序列号", "用户名", "订单号", "充值日期", "充值金额(元)", "剩余金额(元)"};
                            fileName = file.toString() + "/" + ExcelUtil.outRechargePathName;
                        } else {
                            title = new String[]{"设备序列号", "用户名", "身份证号", "注册日期", "电话"};
app/src/main/java/com/dayu/recharge/activity/NewCardListActivity.java
@@ -54,7 +54,6 @@
    //每页数据条数
    int limit = 30;
    RefreshLayout myRefreshLayout;
    Handler handler;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
@@ -83,7 +82,7 @@
        newcardListBinding.recyclerView.setLayoutManager(layoutManager);
        newcardListBinding.recyclerView.setAdapter(adapter);
        int totale = baseDao.userCardDao().getUserTotale();
        newcardListBinding.userTotal.setText(totale + "");
        newcardListBinding.userTotal.setText("开户数:" + totale + "");
    }
@@ -161,15 +160,18 @@
                if ((endTime < beginTime) && endTime != beginTime) {
                    TipUtil.show(NewCardListActivity.this, "结束时间不能晚于开始时间");
                } else {
                    try {
                        endTime = endTime + (1000 * 60 * 60 * 24) - 1;
                        List<UserCardBean> userList = baseDao.userCardDao().findByTime(beginTime, endTime);
                        userCardBeanList.clear();
                        userCardBeanList.addAll(userList);
                        adapter.notifyDataSetChanged();
                    } catch (Exception e) {
                        e.printStackTrace();
                    }
//                    try {
//                        endTime = endTime + (1000 * 60 * 60 * 24) - 1;
//                        List<UserCardBean> userList = baseDao.userCardDao().findByTime(beginTime, endTime);
//                        userCardBeanList.clear();
//                        userCardBeanList.addAll(userList);
//                        adapter.notifyDataSetChanged();
//                    } catch (Exception e) {
//                        e.printStackTrace();
//                    }
                    endTime = endTime + (1000 * 60 * 60 * 24) - 1;
                    userCardBeanList.clear();
                    getList();
                }
            }
        }, beginTimestamp, endTimestamp);
app/src/main/java/com/dayu/recharge/activity/RechargeListActivity.java
@@ -6,17 +6,28 @@
import android.view.LayoutInflater;
import android.view.View;
import androidx.recyclerview.widget.LinearLayoutManager;
import com.dayu.recharge.adapter.NewCardAdapter;
import com.dayu.recharge.adapter.RechargeAdapter;
import com.dayu.recharge.databinding.ActivityRechargeListBinding;
import com.dayu.recharge.dbBean.RechargeBean;
import com.dayu.recharge.dbBean.UserCardBean;
import com.dayu.recharge.model.RechargeListModel;
import com.dayu.recharge.utils.ArithUtil;
import com.dayu.recharge.utils.TipUtil;
import com.dayu.recharge.view.datepicker.CustomDatePicker;
import com.dayu.recharge.view.datepicker.DateFormatUtils;
import com.scwang.smart.refresh.footer.ClassicsFooter;
import com.scwang.smart.refresh.layout.api.RefreshLayout;
import com.scwang.smart.refresh.layout.listener.OnLoadMoreListener;
import java.util.ArrayList;
import java.util.List;
import io.reactivex.rxjava3.android.schedulers.AndroidSchedulers;
import io.reactivex.rxjava3.core.Observable;
import io.reactivex.rxjava3.schedulers.Schedulers;
/**
 * Copyright (C), 2023,
@@ -35,7 +46,11 @@
    long beginTime;
    long endTime;
    RechargeListModel rechargeListModel;
    int page = 0;
    //每页数据条数
    int limit = 30;
    RefreshLayout myRefreshLayout;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
@@ -43,22 +58,26 @@
        rechargeListBinding = ActivityRechargeListBinding.inflate(LayoutInflater.from(this));
        setContentView(rechargeListBinding.getRoot());
        setRightButton();
        setData();
        initDatePicker();
        getTotal();
        initList();
        getList();
    }
    private void setData() {
        rechargeListModel = new RechargeListModel(this);
        rechargeListModel.getAllRechargeList().observe(this, myList -> {
            rechargeList.clear();
            rechargeList.addAll(myList);
            adapter.notifyDataSetChanged();
            getTotal();
    private void initList() {
        myRefreshLayout = (RefreshLayout) rechargeListBinding.refreshLayout;
        myRefreshLayout.setEnableRefresh(false);
        myRefreshLayout.setRefreshFooter(new ClassicsFooter(this));
        myRefreshLayout.setOnLoadMoreListener(new OnLoadMoreListener() {
            @Override
            public void onLoadMore(RefreshLayout refreshlayout) {
                page = page + 1;
                getList();
            }
        });
        adapter = new RechargeAdapter(this, rechargeList);
        rechargeListBinding.rechargeList.setAdapter(adapter);
        LinearLayoutManager layoutManager = new LinearLayoutManager(this);
        rechargeListBinding.recyclerView.setLayoutManager(layoutManager);
        rechargeListBinding.recyclerView.setAdapter(adapter);
    }
    private void getTotal() {
@@ -68,9 +87,46 @@
                double b = Double.parseDouble(rechargeList.get(i).getMorny());
                total = ArithUtil.add(total, b);
            }
            rechargeListBinding.rechargeTotal.setText("累计充值:" + String.valueOf(total) + "元");
            rechargeListBinding.rechargeTotal.setText("已加载数据累计充值:" + String.valueOf(total) + "元");
        }
    }
    private void getList() {
        // 创建一个 Observable
        Observable<List<RechargeBean>> observable = Observable.create(emitter -> {
            // 在这里执行异步操作
            List<RechargeBean> beanList;
            if (beginTime == 0 && endTime == 0) {
                beanList = asynchBaseDao.rechargeDao().findAll(page * limit, limit);
            } else {
                beanList = asynchBaseDao.rechargeDao().ansyFindByTime(beginTime, endTime);
            }
            // 将结果发送给观察者
            emitter.onNext(beanList);
            emitter.onComplete();
        });
        // 订阅观察者
        observable.subscribeOn(Schedulers.io()) // 指定在 IO 线程执行
                .observeOn(AndroidSchedulers.mainThread()) // 指定在单一线程观察结果
                .subscribe(
                        result -> {
                            // 在这里处理结果,这里是在主线程中
//                            System.out.println("Result: " + result);
                            if (result.size() < limit) {
                                myRefreshLayout.finishLoadMoreWithNoMoreData();
                            }
                            if (result != null && result.size() > 0) {
                                rechargeList.addAll(result);
                            }
                            adapter.notifyDataSetChanged();
                            getTotal();
                        },
                        error -> {
                            // 处理错误
                            System.err.println("Error: " + error.getMessage());
                        }
                );
    }
@@ -112,20 +168,8 @@
                    TipUtil.show(RechargeListActivity.this, "结束时间不能晚于开始时间");
                } else {
                    endTime = endTime + (1000 * 60 * 60 * 24) - 1;
                    rechargeListModel.getRechargeList(beginTime, endTime).observe(RechargeListActivity.this, list -> {
                        if (rechargeList != null) {
                            rechargeList.clear();
                            rechargeList.addAll(list);
                            adapter.notifyDataSetChanged();
                            getTotal();
                        } else {
                            TipUtil.show(RechargeListActivity.this, "未查询到数据!");
                        }
                    });
                    rechargeList.clear();
                    getList();
                }
            }
        }, beginTimestamp, endTimestamp);
app/src/main/java/com/dayu/recharge/activity/ReplacementActivity.java
@@ -8,13 +8,24 @@
import android.view.View;
import android.widget.AdapterView;
import androidx.recyclerview.widget.LinearLayoutManager;
import com.dayu.recharge.adapter.NewCardAdapter;
import com.dayu.recharge.adapter.ReplacementAdapter;
import com.dayu.recharge.databinding.ActivityReplacementBinding;
import com.dayu.recharge.dbBean.UserCardBean;
import com.dayu.recharge.utils.TipUtil;
import com.dayu.recharge.view.EdtDialog;
import com.scwang.smart.refresh.footer.ClassicsFooter;
import com.scwang.smart.refresh.layout.api.RefreshLayout;
import com.scwang.smart.refresh.layout.listener.OnLoadMoreListener;
import java.util.ArrayList;
import java.util.List;
import io.reactivex.rxjava3.android.schedulers.AndroidSchedulers;
import io.reactivex.rxjava3.core.Observable;
import io.reactivex.rxjava3.schedulers.Schedulers;
/**
 * Created by Android Studio.
@@ -24,42 +35,90 @@
 * 备注: 补卡界面
 */
public class ReplacementActivity extends BaseActivity {
    ActivityReplacementBinding binding;
    List<UserCardBean> userCardBeanList;
    NewCardAdapter adapter;
    ActivityReplacementBinding newcardListBinding;
    List<UserCardBean> userCardBeanList = new ArrayList<>();
    ReplacementAdapter adapter;
    long beginTime;
    long endTime;
    int page = 0;
    //每页数据条数
    int limit = 30;
    RefreshLayout myRefreshLayout;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        binding = ActivityReplacementBinding.inflate(LayoutInflater.from(this));
        setContentView(binding.getRoot());
        newcardListBinding = ActivityReplacementBinding.inflate(LayoutInflater.from(this));
        setContentView(newcardListBinding.getRoot());
        setRightButton();
        setData();
        initView();
        initList();
        getList();
    }
    private void initView() {
        binding.newCardListView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
    public void itemClick(View view) {
        UserCardBean userCardBean = userCardBeanList.get((int) view.getTag());
        Intent intent = new Intent(ReplacementActivity.this, NFCWreatActivity.class);
        intent.putExtra("dbUserCard", userCardBean);
        startActivity(intent);
    }
    private void initList() {
        myRefreshLayout = (RefreshLayout) newcardListBinding.refreshLayout;
        myRefreshLayout.setEnableRefresh(false);
        myRefreshLayout.setRefreshFooter(new ClassicsFooter(this));
        myRefreshLayout.setOnLoadMoreListener(new OnLoadMoreListener() {
            @Override
            public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
                UserCardBean userCardBean = userCardBeanList.get(position);
                Intent intent = new Intent(ReplacementActivity.this, NFCWreatActivity.class);
                intent.putExtra("dbUserCard", userCardBean);
                startActivity(intent);
            public void onLoadMore(RefreshLayout refreshlayout) {
                page = page + 1;
                getList();
            }
        });
        adapter = new ReplacementAdapter(this, userCardBeanList);
        LinearLayoutManager layoutManager = new LinearLayoutManager(this);
        newcardListBinding.recyclerView.setLayoutManager(layoutManager);
        newcardListBinding.recyclerView.setAdapter(adapter);
    }
    private void setData() {
        try {
            userCardBeanList = baseDao.userCardDao().findAll();
        } catch (Exception e) {
            e.printStackTrace();
        }
        adapter = new NewCardAdapter(this, userCardBeanList);
//        binding.newCardListView.setAdapter(adapter);
    private void getList() {
        // 创建一个 Observable
        Observable<List<UserCardBean>> observable = Observable.create(emitter -> {
            // 在这里执行异步操作
            List<UserCardBean> beanList;
            if (beginTime == 0 && endTime == 0) {
                beanList = asynchBaseDao.userCardDao().findAll(page * limit, limit);
            } else {
                beanList = asynchBaseDao.userCardDao().findByTime(beginTime, endTime);
            }
            // 将结果发送给观察者
            emitter.onNext(beanList);
            emitter.onComplete();
        });
        // 订阅观察者
        observable.subscribeOn(Schedulers.io()) // 指定在 IO 线程执行
                .observeOn(AndroidSchedulers.mainThread()) // 指定在单一线程观察结果
                .subscribe(
                        result -> {
                            // 在这里处理结果,这里是在主线程中
//                            System.out.println("Result: " + result);
                            if (result.size() < limit) {
                                myRefreshLayout.finishLoadMoreWithNoMoreData();
                            }
                            if (result != null && result.size() > 0) {
                                userCardBeanList.addAll(result);
                            }
                            adapter.notifyDataSetChanged();
                        },
                        error -> {
                            // 处理错误
                            System.err.println("Error: " + error.getMessage());
                        }
                );
    }
    EdtDialog edtDialog;
    private void setRightButton() {
app/src/main/java/com/dayu/recharge/adapter/RechargeAdapter.java
@@ -1,6 +1,7 @@
package com.dayu.recharge.adapter;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
@@ -8,8 +9,16 @@
import android.widget.LinearLayout;
import android.widget.TextView;
import androidx.annotation.NonNull;
import androidx.databinding.DataBindingUtil;
import androidx.recyclerview.widget.RecyclerView;
import com.dayu.recharge.R;
import com.dayu.recharge.databinding.ItemRechargeBinding;
import com.dayu.recharge.databinding.ItemNoMoreBinding;
import com.dayu.recharge.databinding.ItemRechargeBinding;
import com.dayu.recharge.dbBean.RechargeBean;
import com.dayu.recharge.dbBean.UserCardBean;
import com.dayu.recharge.utils.DateUtil;
import java.util.List;
@@ -18,7 +27,7 @@
 * Created by zuoxiao on 2018/12/24.
 */
public class RechargeAdapter extends BaseAdapter {
public class RechargeAdapter extends BaseRecyclerAdapter<RecyclerView.ViewHolder> {
    List<RechargeBean> rechargeList;
    Context mContext;
@@ -28,51 +37,69 @@
        this.rechargeList = rechargeList;
    }
    @NonNull
    @Override
    public int getCount() {
        if (rechargeList == null) {
            return 0;
    public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
        if (viewType == VIEW_TYPE_EMPTY) {
            ItemNoMoreBinding emptyView = DataBindingUtil.inflate((LayoutInflater) mContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE), R.layout.item_no_more, parent, false);
            return new ViewHolderEmpty(emptyView);
        } else {
            ItemRechargeBinding binding = DataBindingUtil.inflate((LayoutInflater) mContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE), R.layout.item_recharge, parent, false);
            return new ViewHolder(binding);
        }
    }
    @Override
    public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int position) {
        if (holder instanceof ViewHolder) {
            if (rechargeList.size() > 0) {
                ((ViewHolder) holder).getBinding().userName.setText("用户名:" + rechargeList.get(position).getUserName());
                ((ViewHolder) holder).getBinding().userNo.setText("用户编号:" + rechargeList.get(position).getInitPeasantCode());
                ((ViewHolder) holder).getBinding().morny.setText("充值金额:" + rechargeList.get(position).getMorny());
                ((ViewHolder) holder).getBinding().date.setText("日期:" + DateUtil.dateToStamp(rechargeList.get(position).getDate(), DateUtil.type1));
            }
        }
    }
    @Override
    public int getItemCount() {
        //同时这里也需要添加判断,如果mData.size()为0的话,只引入一个布局,就是emptyView
        // 那么,这个recyclerView的itemCount为1
        if (rechargeList.size() == 0) {
            return 1;
        }
        return rechargeList.size();
    }
    @Override
    public Object getItem(int position) {
        return position;
    }
    @Override
    public long getItemId(int position) {
        return position;
    }
    @Override
    public View getView(int position, View convertView, ViewGroup parent) {
        ViewHolder holder = null;
        if (convertView == null) {
            holder = new ViewHolder();
            convertView = View.inflate(mContext, R.layout.item_recharge, null);
            holder.userName = (TextView) convertView.findViewById(R.id.userName);
            holder.userNo = (TextView) convertView.findViewById(R.id.userNo);
            holder.morny = (TextView) convertView.findViewById(R.id.morny);
            holder.date = (TextView) convertView.findViewById(R.id.date);
            convertView.setTag(holder);
    public int getItemViewType(int position) {
        if (rechargeList.size() == 0) {
            return VIEW_TYPE_EMPTY;
        } else {
            holder = (ViewHolder) convertView.getTag();
            return VIEW_TYPE_ITEM;
        }
        holder.userName.setText("用户名:" + rechargeList.get(position).getUserName());
        holder.userNo.setText("用户编号:" + rechargeList.get(position).getInitPeasantCode());
        holder.morny.setText("充值金额:" + rechargeList.get(position).getMorny());
        holder.date.setText("日期:" + DateUtil.dateToStamp(rechargeList.get(position).getDate(), DateUtil.type1));
        return convertView;
    }
    class ViewHolder {
        TextView userName;
        TextView userNo;
        TextView morny;
        TextView date;
    static class ViewHolder extends RecyclerView.ViewHolder {
        ItemRechargeBinding mBinding;
        public ItemRechargeBinding getBinding() {
            return mBinding;
        }
        public void setBinding(ItemRechargeBinding binding) {
            this.mBinding = binding;
        }
        public ViewHolder(ItemRechargeBinding itemView) {
            super(itemView.getRoot());
            this.mBinding = itemView;
        }
    }
}
app/src/main/java/com/dayu/recharge/adapter/ReplacementAdapter.java
New file
@@ -0,0 +1,97 @@
package com.dayu.recharge.adapter;
import android.app.Activity;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.ViewGroup;
import androidx.annotation.NonNull;
import androidx.databinding.DataBindingUtil;
import androidx.recyclerview.widget.RecyclerView;
import com.dayu.recharge.R;
import com.dayu.recharge.activity.ReplacementActivity;
import com.dayu.recharge.databinding.ItemNewCardBinding;
import com.dayu.recharge.databinding.ItemNoMoreBinding;
import com.dayu.recharge.databinding.ItemReplacementBinding;
import com.dayu.recharge.dbBean.UserCardBean;
import com.dayu.recharge.utils.DateUtil;
import java.util.List;
public class ReplacementAdapter extends BaseRecyclerAdapter<RecyclerView.ViewHolder> {
    List<UserCardBean> rechargeList;
    ReplacementActivity mContext;
    public ReplacementAdapter(ReplacementActivity context, List<UserCardBean> rechargeList) {
        mContext = context;
        this.rechargeList = rechargeList;
    }
    @NonNull
    @Override
    public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
        if (viewType == VIEW_TYPE_EMPTY) {
            ItemNoMoreBinding emptyView = DataBindingUtil.inflate((LayoutInflater) mContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE), R.layout.item_no_more, parent, false);
            return new ViewHolderEmpty(emptyView);
        } else {
            ItemReplacementBinding binding = DataBindingUtil.inflate((LayoutInflater) mContext.getSystemService(Context.LAYOUT_INFLATER_SERVICE), R.layout.item_replacement, parent, false);
            return new ViewHolder(binding);
        }
    }
    @Override
    public void onBindViewHolder(@NonNull RecyclerView.ViewHolder holder, int position) {
        if (holder instanceof ViewHolder) {
            if (rechargeList.size() > 0) {
                ((ViewHolder) holder).getBinding().userName.setText("用户名:" + rechargeList.get(position).getUserName());
                ((ViewHolder) holder).getBinding().userNo.setText("身份证号:" + rechargeList.get(position).getUserID());
                ((ViewHolder) holder).getBinding().water.setText("电话:" + rechargeList.get(position).getPhone());
                ((ViewHolder) holder).getBinding().date.setText("日期:" + DateUtil.dateToStamp(rechargeList.get(position).getDate(), DateUtil.type1));
                ((ViewHolder) holder).getBinding().item.setTag(position);
                ((ViewHolder) holder).getBinding().setActivity(mContext);
            }
        }
    }
    @Override
    public int getItemCount() {
        //同时这里也需要添加判断,如果mData.size()为0的话,只引入一个布局,就是emptyView
        // 那么,这个recyclerView的itemCount为1
        if (rechargeList.size() == 0) {
            return 1;
        }
        return rechargeList.size();
    }
    @Override
    public int getItemViewType(int position) {
        if (rechargeList.size() == 0) {
            return VIEW_TYPE_EMPTY;
        } else {
            return VIEW_TYPE_ITEM;
        }
    }
    static class ViewHolder extends RecyclerView.ViewHolder {
        ItemReplacementBinding mBinding;
        public ItemReplacementBinding getBinding() {
            return mBinding;
        }
        public void setBinding(ItemReplacementBinding binding) {
            this.mBinding = binding;
        }
        public ViewHolder(ItemReplacementBinding itemView) {
            super(itemView.getRoot());
            this.mBinding = itemView;
        }
    }
}
app/src/main/java/com/dayu/recharge/dao/RechargeDao.java
@@ -39,4 +39,7 @@
    @Query("select  * from RechargeBean where date>=:beginTime and date<=:endTime")
    List<RechargeBean> ansyFindByTime(long beginTime, long endTime);
    @Query("select  * from RechargeBean order by date desc LIMIT :limit OFFSET :offset")
    List<RechargeBean> findAll(int offset,int limit);
}
app/src/main/java/com/dayu/recharge/net/SocketNet.java
@@ -11,11 +11,13 @@
import com.dayu.recharge.dbBean.DeviceNumber;
import com.dayu.recharge.dbBean.IpBean;
import com.easysocket.EasySocket;
import com.easysocket.connection.action.SocketStatus;
import com.easysocket.entity.OriginReadData;
import com.easysocket.entity.SocketAddress;
import com.easysocket.interfaces.conn.ISocketActionListener;
import com.easysocket.interfaces.conn.SocketActionListener;
import com.dayu.recharge.MyApplication;
import com.easysocket.utils.HexUtil;
/**
@@ -53,7 +55,12 @@
        if (EasySocket.getInstance().getDefconnection() != null) {
//            EasySocket.getInstance().disconnect(false);
//            EasySocket.getInstance().connect();
//            if (EasySocket.getInstance().getDefconnection().getConnectionStatus()== SocketStatus.SOCKET_CONNECTED){
            EasySocket.getInstance().upMessage(dataMessage);
//            }else {
//
//            }
//            this.dataMessage = dataMessage;
        } else {
            MyApplication.myApplication.initEasySocket(false, null);
@@ -144,21 +151,17 @@
            rushState();
        }
        /**
         * socket接收的数据
         * @param socketAddress
         * @param readData
         * @param originReadData
         */
        @Override
        public void onSocketResponse(SocketAddress socketAddress, String readData) {
            Log.i("SocketActionListener", "SocketActionListener收到数据-->" + readData);
        }
        @Override
        public void onSocketResponse(SocketAddress socketAddress, OriginReadData originReadData) {
            super.onSocketResponse(socketAddress, originReadData);
            Log.i("SocketActionListener", "SocketActionListener收到数据-->" + originReadData.getBodyString());
            Log.i("SocketActionListener", "SocketActionListener收到数据-->" + HexUtil.bytesToHex(originReadData.getBodyBytes()));
            SocketData socketData = new SocketData();
            socketData.setBodyData(originReadData.getBodyBytes());
            socketData.setHeaderData(originReadData.getHeaderData());
app/src/main/java/com/dayu/recharge/utils/ExcelUtil.java
@@ -131,11 +131,7 @@
                        RechargeBean projectBean = (RechargeBean) objList.get(j);
                        list.add(projectBean.getSerial());
                        list.add(projectBean.getUserName());
                        if (projectBean.getUserId() != null) {
                            list.add(projectBean.getUserId());
                        } else {
                            list.add("");
                        }
                        list.add(projectBean.getOrderID());
                        list.add(DateUtil.dateToStamp(projectBean.getDate(), DateUtil.type2));
                        list.add(projectBean.getMorny());
                        list.add(projectBean.getBalance());
app/src/main/res/layout/activity_newcard_list.xml
@@ -10,7 +10,7 @@
        android:layout_width="match_parent"
        android:layout_height="@dimen/dimen_title_height"
        android:background="@drawable/title_bar_bg"
        app:centerText="注册记录"
        app:centerText="开户记录"
        app:leftImage="@mipmap/icon_back"
        app:rightText="筛选" />
@@ -26,7 +26,7 @@
            android:id="@+id/recyclerView"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:background="#fff"
            android:background="#ffffff"
            android:overScrollMode="never"
            android:padding="10dp" />
app/src/main/res/layout/activity_recharge_list.xml
@@ -14,15 +14,25 @@
        app:leftImage="@mipmap/icon_back"
        app:rightText="筛选" />
    <ListView
        android:id="@+id/recharge_list"
    <com.scwang.smart.refresh.layout.SmartRefreshLayout
        android:id="@+id/refreshLayout"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_above="@+id/recharge_total"
        android:layout_below="@+id/titleBar"
        android:cacheColorHint="#ffffff"
        android:divider="@null"
        android:dividerHeight="0dp" />
        android:layout_above="@id/recharge_total"
        android:layout_below="@+id/titleBar">
        <androidx.recyclerview.widget.RecyclerView
            android:id="@+id/recyclerView"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:background="#ffffff"
            android:overScrollMode="never"
            android:padding="10dp" />
        <com.scwang.smart.refresh.footer.ClassicsFooter
            android:layout_width="match_parent"
            android:layout_height="wrap_content" />
    </com.scwang.smart.refresh.layout.SmartRefreshLayout>
    <TextView
        android:id="@+id/recharge_total"
app/src/main/res/layout/activity_replacement.xml
@@ -14,13 +14,24 @@
        app:leftImage="@mipmap/icon_back"
        app:rightText="筛选" />
    <ListView
        android:id="@+id/newCard_listView"
    <com.scwang.smart.refresh.layout.SmartRefreshLayout
        android:id="@+id/refreshLayout"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:cacheColorHint="#ffffff"
        android:divider="@null"
        android:dividerHeight="0dp" />
        android:layout_above="@id/user_total"
        android:layout_below="@+id/titleBar">
        <androidx.recyclerview.widget.RecyclerView
            android:id="@+id/recyclerView"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:background="#fff"
            android:overScrollMode="never"
            android:padding="10dp" />
        <com.scwang.smart.refresh.footer.ClassicsFooter
            android:layout_width="match_parent"
            android:layout_height="wrap_content" />
    </com.scwang.smart.refresh.layout.SmartRefreshLayout>
</LinearLayout>
app/src/main/res/layout/item_new_card.xml
@@ -14,6 +14,7 @@
            android:layout_height="wrap_content"
            android:layout_marginLeft="15dp"
            android:layout_marginTop="10dp"
            android:layout_marginRight="15dp"
            android:orientation="vertical">
app/src/main/res/layout/item_recharge.xml
@@ -1,55 +1,60 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical">
<layout xmlns:android="http://schemas.android.com/apk/res/android">
    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginLeft="15dp"
        android:layout_marginRight="15dp"
        android:layout_marginTop="10dp"
        android:orientation="vertical">
        <TextView
            android:id="@+id/userName"
        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:text="用户名"
            android:textSize="14sp" />
            android:layout_marginLeft="15dp"
            android:layout_marginTop="10dp"
            android:layout_marginRight="15dp"
            android:orientation="vertical">
        <TextView
            android:id="@+id/userNo"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:text="用户编号"
            android:textSize="14sp" />
            <TextView
                android:id="@+id/userName"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_weight="1"
                android:text="用户名"
                android:textSize="14sp" />
        <TextView
            android:id="@+id/morny"
            <TextView
                android:id="@+id/userNo"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_weight="1"
                android:text="用户编号"
                android:textSize="14sp" />
            <TextView
                android:id="@+id/morny"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_weight="1"
                android:text="金额:"
                android:textSize="14sp" />
            <TextView
                android:id="@+id/date"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_weight="1"
                android:text="日期"
                android:textSize="14sp" />
        </LinearLayout>
        <View
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:text="金额:"
            android:textSize="14sp" />
        <TextView
            android:id="@+id/date"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:text="日期"
            android:textSize="14sp" />
            android:layout_height="1px"
            android:layout_marginTop="15dp"
            android:background="#000000" />
    </LinearLayout>
</layout>
    <View
        android:layout_width="match_parent"
        android:layout_height="1px"
        android:layout_marginTop="15dp"
        android:background="#000000" />
</LinearLayout>
app/src/main/res/layout/item_replacement.xml
New file
@@ -0,0 +1,76 @@
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android">
    <data>
        <variable
            name="activity"
            type="com.dayu.recharge.activity.ReplacementActivity" />
    </data>
    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:orientation="vertical">
        <LinearLayout
            android:id="@+id/item"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginLeft="15dp"
            android:layout_marginTop="10dp"
            android:layout_marginRight="15dp"
            android:onClick="@{ activity.itemClick}"
            android:orientation="vertical">
            <TextView
                android:id="@+id/userName"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_weight="1"
                android:text="用户名"
                android:textSize="14sp" />
            <TextView
                android:id="@+id/userNo"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_weight="1"
                android:text="户号:123123"
                android:textSize="14sp" />
            <TextView
                android:id="@+id/water"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_weight="1"
                android:text="水量:123123"
                android:textSize="14sp" />
            <TextView
                android:id="@+id/date"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_weight="1"
                android:text="日期"
                android:textSize="14sp" />
        </LinearLayout>
        <View
            android:layout_width="match_parent"
            android:layout_height="1px"
            android:layout_marginTop="15dp"
            android:background="#000000" />
    </LinearLayout>
</layout>
easysocket/src/main/java/com/easysocket/connection/connect/SuperConnection.java
@@ -321,6 +321,7 @@
     */
    private IConnectionManager sendBytes(byte[] bytes) {
        if (ioManager == null || connectionStatus.get() != SocketStatus.SOCKET_CONNECTED) {
            LogUtil.w("sendBytes错误-----ioManager为null或者connectionStatus状态不为已连接");
            return this;
        }
        ioManager.sendBytes(bytes);
easysocket/src/main/java/com/easysocket/connection/iowork/EasyReader.java
@@ -10,6 +10,7 @@
import com.easysocket.interfaces.conn.IConnectionManager;
import com.easysocket.interfaces.conn.ISocketActionDispatch;
import com.easysocket.interfaces.io.IReader;
import com.easysocket.utils.HexUtil;
import com.easysocket.utils.LogUtil;
import java.io.IOException;
@@ -138,7 +139,7 @@
                    // 保存body
                    originalData.setBodyData(bodyBuf.array());
                    LogUtil.d("Socket收到数据-->" + originalData.getBodyString());
                    LogUtil.d("Socket收到数据-->" +HexUtil.bytesToHex(originalData.getBodyBytes()) );
                    // 分发数据
                    actionDispatch.dispatchAction(IOAction.ACTION_READ_COMPLETE, originalData);
@@ -171,7 +172,7 @@
            throw new ReadUnrecoverableException("数据body的长度不能小于0");
        }
        LogUtil.d("Socket收到数据-->" + originalData.getBodyString());
        LogUtil.d("Socket收到数据-->" + HexUtil.bytesToHex(originalData.getBodyBytes()));
        // 分发
        actionDispatch.dispatchAction(IOAction.ACTION_READ_COMPLETE, originalData);
@@ -236,7 +237,7 @@
        byte[] data = new byte[len];
        originBuf.get(data, 0, len);
        readData.setBodyData(data);
        LogUtil.d("Socket收到数据-->" + readData.getBodyString());
        LogUtil.d("Socket收到数据-->" + HexUtil.bytesToHex(readData.getBodyBytes()));
        // 分发数据
        actionDispatch.dispatchAction(IOAction.ACTION_READ_COMPLETE, readData);
        // 相当于把指针重新指向positon=0
easysocket/src/main/java/com/easysocket/connection/iowork/EasyWriter.java
@@ -4,6 +4,7 @@
import com.easysocket.interfaces.conn.IConnectionManager;
import com.easysocket.interfaces.conn.ISocketActionDispatch;
import com.easysocket.interfaces.io.IWriter;
import com.easysocket.utils.HexUtil;
import com.easysocket.utils.LogUtil;
import java.io.IOException;
@@ -92,8 +93,8 @@
    @Override
    public void write(byte[] sendBytes) throws IOException {
        if (sendBytes != null) {
            LogUtil.d("Socket发送数据String-->" + new String(sendBytes, Charset.forName("utf-8")));
            LogUtil.d("Socket发送数据byte[]-->" + Arrays.toString(sendBytes));
            LogUtil.d("EasyWriter--Socket发送数据String-->" + HexUtil.bytesToHex(sendBytes));
            LogUtil.d("EasyWriter--Socket发送数据byte[]-->" + Arrays.toString(sendBytes));
            int packageSize = socketOptions.getMaxWriteBytes(); // 每次可以发送的最大数据
            int remainingCount = sendBytes.length;
            ByteBuffer writeBuf = ByteBuffer.allocate(packageSize);
easysocket/src/main/java/com/easysocket/utils/HexUtil.java
New file
@@ -0,0 +1,275 @@
package com.easysocket.utils;
import java.math.BigInteger;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
/**
 * Copyright (C), 2022,
 * Author: zuo
 * Date: 2022/3/9 14:55
 * Description:
 */
public class HexUtil {
    /**
     * hex字符串转byte数组
     *
     * @param inHex 待转换的Hex字符串
     * @return 转换后的byte数组结果
     */
    public static byte[] hexToByteArray(String inHex) {
        int hexlen = inHex.length();
        byte[] result;
        if (hexlen % 2 == 1) {
            //奇数
            hexlen++;
            result = new byte[(hexlen / 2)];
            inHex = "0" + inHex;
        } else {
            //偶数
            result = new byte[(hexlen / 2)];
        }
        int j = 0;
        for (int i = 0; i < hexlen; i += 2) {
            result[j] = hexToByte(inHex.substring(i, i + 2));
            j++;
        }
        return result;
    }
    /**
     * Hex字符串转byte
     *
     * @param inHex 待转换的Hex字符串
     * @return 转换后的byte
     */
    public static byte hexToByte(String inHex) {
        return (byte) Integer.parseInt(inHex, 16);
    }
    /**
     * 字节转十六进制
     *
     * @param b 需要进行转换的byte字节
     * @return 转换后的Hex字符串
     */
    public static String byteToHex(byte b) {
        String hex = Integer.toHexString(b & 0xFF);
        if (hex.length() < 2) {
            hex = "0" + hex;
        }
        return hex.toUpperCase();
    }
    /**
     * 字节数组转16进制
     *
     * @param bytes 需要转换的byte数组
     * @return 转换后的Hex字符串
     */
    public static String bytesToHex(byte[] bytes) {
        try {
            StringBuffer sb = new StringBuffer();
            for (int i = 0; i < bytes.length; i++) {
                String hex = Integer.toHexString(bytes[i] & 0xFF);
                if (hex.length() < 2) {
                    sb.append(0);
                }
                sb.append(hex);
            }
            return sb.toString();
        } catch (Exception e) {
            e.printStackTrace();
        }
        return "";
    }
    public static String byteArrayToHexString(byte[] byteArray) {
        StringBuilder hexString = new StringBuilder();
        for (byte b : byteArray) {
            // 将字节转换为无符号整数
            int unsignedInt = b & 0xff;
            // 将无符号整数转换为16进制字符串
            String hex = Integer.toHexString(unsignedInt);
            // 如果字符串长度小于2,在前面补0
            if (hex.length() < 2) {
                hex = "0" + hex;
            }
            hexString.append(hex);
        }
        return hexString.toString();
    }
    /**
     * 字节数组转16进制 不在末尾添加0
     *
     * @param bytes 需要转换的byte数组
     * @return 转换后的Hex字符串
     */
    public static String bytesToHexNoAddZero(byte[] bytes) {
        StringBuffer sb = new StringBuffer();
        for (int i = 0; i < bytes.length; i++) {
            String hex = Integer.toHexString(bytes[i] & 0xFF);
            sb.append(hex);
        }
        return sb.toString();
    }
    /**
     * 将 4字节的16进制字符串,转换为32位带符号的十进制浮点型
     *
     * @param str 4字节 16进制字符
     * @return
     */
    public static float hexToFloat(String str) {
        return Float.intBitsToFloat(new BigInteger(str, 16).intValue());
    }
    /**
     * 将带符号的32位浮点数装换为16进制
     *
     * @param value
     * @return
     */
    public static String folatToHexString(Float value) {
        return Integer.toHexString(Float.floatToIntBits(value));
    }
    /**
     * 十进制转16进制
     *
     * @param number
     * @return
     */
    public static String get10to16(int number) {
        return Integer.toHexString(number);
    }
    /**
     * 十进制转16进制 补齐偶数 高位在前低位在后
     *
     * @param number
     * @return
     */
    public static String get10to16CompleteHex(int number) {
        String hex = Integer.toHexString(number);
        if (hex.length() % 2 == 0) {
            return hex;
        } else {
            return "0" + hex;
        }
    }
    /**
     * 十进制转16进制低位在前高位在后
     *
     * @param number 十进制数
     * @param length 补足多少位
     * @return
     */
    public static String get10to16LowHigh(int number, int length) {
        String str = "";
        try {
            str = Integer.toHexString(number);
            str = getHexToLenght(str, length);
            str = spaceHex(str);
            str = HighLowHex(str);
        } catch (Exception e) {
            e.printStackTrace();
        }
        return str;
    }
    /**
     * 16进制转10进制高低位转换
     *
     * @param hex
     * @return
     */
    public static int get16to10LowHigh(String hex) {
        try {
            String str = "";
            str = spaceHex(hex);
            str = HighLowHex(str);
            return Integer.parseInt(str, 16);
        } catch (NumberFormatException e) {
            e.printStackTrace();
        }
        return 0;
    }
    /**
     * 返回特定长度的16进制字符串
     *
     * @param data
     * @param length
     * @return
     */
    public static String getHexToLenght(String data, int length) {
        StringBuffer stringBuilder = new StringBuffer(data);
        for (int i = 0; i < length - data.length(); i++) {
            stringBuilder.insert(0, "0");
        }
        return stringBuilder.toString();
    }
    /**
     * 十六进制数隔空位
     *
     * @param str
     * @return
     */
    public static String spaceHex(String str) {
        char[] array = str.toCharArray();
        if (str.length() <= 2) return str;
        StringBuffer bufferHex = new StringBuffer();
        for (int i = 0; i < array.length; i++) {
            int start = i + 1;
            if (start % 2 == 0) {
                bufferHex.append(array[i]).append(" ");
            } else {
                bufferHex.append(array[i]);
            }
        }
        return bufferHex.toString();
    }
    /**
     * 高位16进制转低位
     *
     * @param str
     * @return
     */
    private static String HighLowHex(String str) {
        if (str.trim().length() <= 2) return str;
        List<String> list = Arrays.asList(str.split(" "));
        Collections.reverse(list);
        StringBuffer stringBuffer = new StringBuffer();
        for (String string : list) {
            stringBuffer.append(string);
        }
        return stringBuffer.toString();
    }
    /**
     * @param hex
     * @return
     */
    public static int get16to10(String hex) {
        int x = 0;
        try {
            x = Integer.parseInt(hex, 16);
        } catch (NumberFormatException e) {
            e.printStackTrace();
        }
        return x;
    }
}
gradlew
@@ -1,7 +1,7 @@
#!/usr/bin/env sh
#!/bin/sh
#
# Copyright 2015 the original author or authors.
# Copyright © 2015-2021 the original authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -17,67 +17,101 @@
#
##############################################################################
##
##  Gradle start up script for UN*X
##
#
#   Gradle start up script for POSIX generated by Gradle.
#
#   Important for running:
#
#   (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is
#       noncompliant, but you have some other compliant shell such as ksh or
#       bash, then to run this script, type that shell name before the whole
#       command line, like:
#
#           ksh Gradle
#
#       Busybox and similar reduced shells will NOT work, because this script
#       requires all of these POSIX shell features:
#         * functions;
#         * expansions «$var», «${var}», «${var:-default}», «${var+SET}»,
#           «${var#prefix}», «${var%suffix}», and «$( cmd )»;
#         * compound commands having a testable exit status, especially «case»;
#         * various built-in commands including «command», «set», and «ulimit».
#
#   Important for patching:
#
#   (2) This script targets any POSIX shell, so it avoids extensions provided
#       by Bash, Ksh, etc; in particular arrays are avoided.
#
#       The "traditional" practice of packing multiple parameters into a
#       space-separated string is a well documented source of bugs and security
#       problems, so this is (mostly) avoided, by progressively accumulating
#       options in "$@", and eventually passing that to Java.
#
#       Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS,
#       and GRADLE_OPTS) rely on word-splitting, this is performed explicitly;
#       see the in-line comments for details.
#
#       There are tweaks for specific operating systems such as AIX, CygWin,
#       Darwin, MinGW, and NonStop.
#
#   (3) This script is generated from the Groovy template
#       https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
#       within the Gradle project.
#
#       You can find Gradle at https://github.com/gradle/gradle/.
#
##############################################################################
# Attempt to set APP_HOME
# Resolve links: $0 may be a link
PRG="$0"
# Need this for relative symlinks.
while [ -h "$PRG" ] ; do
    ls=`ls -ld "$PRG"`
    link=`expr "$ls" : '.*-> \(.*\)$'`
    if expr "$link" : '/.*' > /dev/null; then
        PRG="$link"
    else
        PRG=`dirname "$PRG"`"/$link"
    fi
app_path=$0
# Need this for daisy-chained symlinks.
while
    APP_HOME=${app_path%"${app_path##*/}"}  # leaves a trailing /; empty if no leading path
    [ -h "$app_path" ]
do
    ls=$( ls -ld "$app_path" )
    link=${ls#*' -> '}
    case $link in             #(
      /*)   app_path=$link ;; #(
      *)    app_path=$APP_HOME$link ;;
    esac
done
SAVED="`pwd`"
cd "`dirname \"$PRG\"`/" >/dev/null
APP_HOME="`pwd -P`"
cd "$SAVED" >/dev/null
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
APP_NAME="Gradle"
APP_BASE_NAME=`basename "$0"`
APP_BASE_NAME=${0##*/}
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD="maximum"
MAX_FD=maximum
warn () {
    echo "$*"
}
} >&2
die () {
    echo
    echo "$*"
    echo
    exit 1
}
} >&2
# OS specific support (must be 'true' or 'false').
cygwin=false
msys=false
darwin=false
nonstop=false
case "`uname`" in
  CYGWIN* )
    cygwin=true
    ;;
  Darwin* )
    darwin=true
    ;;
  MINGW* )
    msys=true
    ;;
  NONSTOP* )
    nonstop=true
    ;;
case "$( uname )" in                #(
  CYGWIN* )         cygwin=true  ;; #(
  Darwin* )         darwin=true  ;; #(
  MSYS* | MINGW* )  msys=true    ;; #(
  NONSTOP* )        nonstop=true ;;
esac
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
@@ -87,9 +121,9 @@
if [ -n "$JAVA_HOME" ] ; then
    if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
        # IBM's JDK on AIX uses strange locations for the executables
        JAVACMD="$JAVA_HOME/jre/sh/java"
        JAVACMD=$JAVA_HOME/jre/sh/java
    else
        JAVACMD="$JAVA_HOME/bin/java"
        JAVACMD=$JAVA_HOME/bin/java
    fi
    if [ ! -x "$JAVACMD" ] ; then
        die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
@@ -98,7 +132,7 @@
location of your Java installation."
    fi
else
    JAVACMD="java"
    JAVACMD=java
    which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Please set the JAVA_HOME variable in your environment to match the
@@ -106,80 +140,101 @@
fi
# Increase the maximum file descriptors if we can.
if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
    MAX_FD_LIMIT=`ulimit -H -n`
    if [ $? -eq 0 ] ; then
        if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
            MAX_FD="$MAX_FD_LIMIT"
        fi
        ulimit -n $MAX_FD
        if [ $? -ne 0 ] ; then
            warn "Could not set maximum file descriptor limit: $MAX_FD"
        fi
    else
        warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
    fi
fi
# For Darwin, add options to specify how the application appears in the dock
if $darwin; then
    GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
fi
# For Cygwin or MSYS, switch paths to Windows format before running java
if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
    APP_HOME=`cygpath --path --mixed "$APP_HOME"`
    CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
    JAVACMD=`cygpath --unix "$JAVACMD"`
    # We build the pattern for arguments to be converted via cygpath
    ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
    SEP=""
    for dir in $ROOTDIRSRAW ; do
        ROOTDIRS="$ROOTDIRS$SEP$dir"
        SEP="|"
    done
    OURCYGPATTERN="(^($ROOTDIRS))"
    # Add a user-defined pattern to the cygpath arguments
    if [ "$GRADLE_CYGPATTERN" != "" ] ; then
        OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
    fi
    # Now convert the arguments - kludge to limit ourselves to /bin/sh
    i=0
    for arg in "$@" ; do
        CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
        CHECK2=`echo "$arg"|egrep -c "^-"`                                 ### Determine if an option
        if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then                    ### Added a condition
            eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
        else
            eval `echo args$i`="\"$arg\""
        fi
        i=`expr $i + 1`
    done
    case $i in
        0) set -- ;;
        1) set -- "$args0" ;;
        2) set -- "$args0" "$args1" ;;
        3) set -- "$args0" "$args1" "$args2" ;;
        4) set -- "$args0" "$args1" "$args2" "$args3" ;;
        5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
        6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
        7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
        8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
        9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
    case $MAX_FD in #(
      max*)
        MAX_FD=$( ulimit -H -n ) ||
            warn "Could not query maximum file descriptor limit"
    esac
    case $MAX_FD in  #(
      '' | soft) :;; #(
      *)
        ulimit -n "$MAX_FD" ||
            warn "Could not set maximum file descriptor limit to $MAX_FD"
    esac
fi
# Escape application args
save () {
    for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
    echo " "
}
APP_ARGS=`save "$@"`
# Collect all arguments for the java command, stacking in reverse order:
#   * args from the command line
#   * the main class name
#   * -classpath
#   * -D...appname settings
#   * --module-path (only if needed)
#   * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables.
# Collect all arguments for the java command, following the shell quoting and substitution rules
eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
# For Cygwin or MSYS, switch paths to Windows format before running java
if "$cygwin" || "$msys" ; then
    APP_HOME=$( cygpath --path --mixed "$APP_HOME" )
    CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" )
    JAVACMD=$( cygpath --unix "$JAVACMD" )
    # Now convert the arguments - kludge to limit ourselves to /bin/sh
    for arg do
        if
            case $arg in                                #(
              -*)   false ;;                            # don't mess with options #(
              /?*)  t=${arg#/} t=/${t%%/*}              # looks like a POSIX filepath
                    [ -e "$t" ] ;;                      #(
              *)    false ;;
            esac
        then
            arg=$( cygpath --path --ignore --mixed "$arg" )
        fi
        # Roll the args list around exactly as many times as the number of
        # args, so each arg winds up back in the position where it started, but
        # possibly modified.
        #
        # NB: a `for` loop captures its iteration list before it begins, so
        # changing the positional parameters here affects neither the number of
        # iterations, nor the values presented in `arg`.
        shift                   # remove old arg
        set -- "$@" "$arg"      # push replacement arg
    done
fi
# Collect all arguments for the java command;
#   * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
#     shell script including quotes and variable substitutions, so put them in
#     double quotes to make sure that they get re-expanded; and
#   * put everything else in single quotes, so that it's not re-expanded.
set -- \
        "-Dorg.gradle.appname=$APP_BASE_NAME" \
        -classpath "$CLASSPATH" \
        org.gradle.wrapper.GradleWrapperMain \
        "$@"
# Stop when "xargs" is not available.
if ! command -v xargs >/dev/null 2>&1
then
    die "xargs is not available"
fi
# Use "xargs" to parse quoted args.
#
# With -n1 it outputs one arg per line, with the quotes and backslashes removed.
#
# In Bash we could simply go:
#
#   readarray ARGS < <( xargs -n1 <<<"$var" ) &&
#   set -- "${ARGS[@]}" "$@"
#
# but POSIX shell has neither arrays nor command substitution, so instead we
# post-process each arg (as a line of input to sed) to backslash-escape any
# character that might be a shell metacharacter, then use eval to reverse
# that process (while maintaining the separation between arguments), and wrap
# the whole thing up as a single "set" statement.
#
# This will of course break if any of these variables contains a newline or
# an unmatched quote.
#
eval "set -- $(
        printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" |
        xargs -n1 |
        sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' |
        tr '\n' ' '
    )" '"$@"'
exec "$JAVACMD" "$@"
gradlew.bat
@@ -14,7 +14,7 @@
@rem limitations under the License.
@rem
@if "%DEBUG%" == "" @echo off
@if "%DEBUG%"=="" @echo off
@rem ##########################################################################
@rem
@rem  Gradle startup script for Windows
@@ -25,7 +25,7 @@
if "%OS%"=="Windows_NT" setlocal
set DIRNAME=%~dp0
if "%DIRNAME%" == "" set DIRNAME=.
if "%DIRNAME%"=="" set DIRNAME=.
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%
@@ -40,7 +40,7 @@
set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if "%ERRORLEVEL%" == "0" goto execute
if %ERRORLEVEL% equ 0 goto execute
echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
@@ -75,13 +75,15 @@
:end
@rem End local scope for the variables with windows NT shell
if "%ERRORLEVEL%"=="0" goto mainEnd
if %ERRORLEVEL% equ 0 goto mainEnd
:fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code!
if  not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
exit /b 1
set EXIT_CODE=%ERRORLEVEL%
if %EXIT_CODE% equ 0 set EXIT_CODE=1
if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%
exit /b %EXIT_CODE%
:mainEnd
if "%OS%"=="Windows_NT" endlocal
local.properties
@@ -4,5 +4,5 @@
# Location of the SDK. This is only used by Gradle.
# For customization when using a Version Control System, please read the
# header note.
#Thu Dec 14 09:58:29 CST 2023
sdk.dir=D\:\\AndroidStudio\\sdk
#Mon Dec 18 10:17:13 CST 2023
sdk.dir=D\:\\android\\sdk